Browse Source

configure: tweak checking for botan

If no botan-config was found we would end up doing:
checking for botan-config... no
/scratch/src/bind10/configure: line 16704: --libs: command not found
/scratch/src/bind10/configure: line 16705: --cflags: command not found

Instead, do not run botan-config if there was no botan-config found
as we will bail out gracefully later on if the botan headers could not
be found.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 13 years ago
parent
commit
6129c3537c
1 changed files with 15 additions and 14 deletions
  1. 15 14
      configure.ac

+ 15 - 14
configure.ac

@@ -517,21 +517,22 @@ else
         AC_PATH_PROG([BOTAN_CONFIG], [botan-config])
         AC_PATH_PROG([BOTAN_CONFIG], [botan-config])
     fi
     fi
 fi
 fi
-
-BOTAN_LIBS=`${BOTAN_CONFIG} --libs`
-BOTAN_INCLUDES=`${BOTAN_CONFIG} --cflags`
-
-# We expect botan-config --libs to contain -L<path_to_libbotan>, but
-# this is not always the case.  As a heuristics workaround we add
-# -L`botan-config --prefix/lib` in this case (if not present already).
-# Same for BOTAN_INCLUDES (but using include instead of lib) below.
-if [ $BOTAN_CONFIG --prefix >/dev/null 2>&1 ] ; then
-    echo ${BOTAN_LIBS} | grep -- -L > /dev/null || \
-        BOTAN_LIBS="-L`${BOTAN_CONFIG} --prefix`/lib ${BOTAN_LIBS}"
-    echo ${BOTAN_INCLUDES} | grep -- -I > /dev/null || \
-        BOTAN_INCLUDES="-I`${BOTAN_CONFIG} --prefix`/include ${BOTAN_INCLUDES}"
+if test "x${BOTAN_CONFIG}" != "x"
+then
+    BOTAN_LIBS=`${BOTAN_CONFIG} --libs`
+    BOTAN_INCLUDES=`${BOTAN_CONFIG} --cflags`
+
+    # We expect botan-config --libs to contain -L<path_to_libbotan>, but
+    # this is not always the case.  As a heuristics workaround we add
+    # -L`botan-config --prefix/lib` in this case (if not present already).
+    # Same for BOTAN_INCLUDES (but using include instead of lib) below.
+    if [ ${BOTAN_CONFIG} --prefix >/dev/null 2>&1 ] ; then
+        echo ${BOTAN_LIBS} | grep -- -L > /dev/null || \
+            BOTAN_LIBS="-L`${BOTAN_CONFIG} --prefix`/lib ${BOTAN_LIBS}"
+        echo ${BOTAN_INCLUDES} | grep -- -I > /dev/null || \
+            BOTAN_INCLUDES="-I`${BOTAN_CONFIG} --prefix`/include ${BOTAN_INCLUDES}"
+    fi
 fi
 fi
-
 # botan-config script (and the way we call pkg-config) returns -L and -l
 # botan-config script (and the way we call pkg-config) returns -L and -l
 # as one string, but we need them in separate values
 # as one string, but we need them in separate values
 BOTAN_LDFLAGS=
 BOTAN_LDFLAGS=