]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3552] Revamped configure code
authorFrancis Dupont <fdupont@isc.org>
Sat, 31 Aug 2024 10:13:47 +0000 (12:13 +0200)
committerFrancis Dupont <fdupont@isc.org>
Fri, 11 Oct 2024 13:20:20 +0000 (15:20 +0200)
doc/sphinx/arm/install.rst
m4macros/ax_crypto.m4

index 9d2cca94d6d4b451d0e16316d3497066721fbb52..7a198e6040c9cddd86f8e931ed9615bcffa5ef17 100644 (file)
@@ -325,9 +325,10 @@ options. Some commonly used options are:
    Define the path to find the Boost headers. Normally this is not
    necessary.
 
- - ``--with-botan-config``
-   Specify the path to the botan-config script to build with Botan for
-   cryptographic functions. It is preferable to use OpenSSL (see below).
+ - ``--with-botan``
+   Specify the name of the Botan pkg-config library e.g. ``botan-2``
+   to build with Botan for cryptographic functions. It is preferable
+   to use OpenSSL (see below).
 
  - ``--with-openssl``
    Use the OpenSSL cryptographic library instead of Botan. By default
@@ -339,7 +340,7 @@ options. Some commonly used options are:
    The default is to not build it.
 
  - ``--with-site-packages``
-   Install the kea-shell Python packages in the specified directory; this 
+   Install the kea-shell Python packages in the specified directory; this
    is only useful when :iscman:`kea-shell` is enabled, and is
    mostly helpful for Debian-related distributions. While most systems store
    Python packages in ``${prefix}/usr/lib/pythonX/site-packages``, Debian
index 389582c9d5d8160f62dee2a4b652c7561f604f88..d1bc1ca8923fad40ef852723a95d7118459a25ae 100644 (file)
@@ -89,58 +89,40 @@ AC_ARG_WITH([openssl],
             [use_openssl="$withval"],
             [use_openssl="auto"])
 
-botan_config="yes"
+use_botan="yes"
 if test "${use_openssl}" != "auto" -a "${use_openssl}" != "no" ; then
-   botan_config="no"
+   use_botan="no"
 fi
-AC_ARG_WITH([botan-config],
-  [AS_HELP_STRING([--with-botan-config=PATH],
-    [specify the path to the botan-config script])],
-  [botan_config="$withval"])
-distcheck_botan="--with-botan-config=$botan_config"
-if test "${botan_config}" = "no" ; then
+AC_ARG_WITH([botan],
+  [AS_HELP_STRING([--with-botan[[=PATH]]],
+  [Enables Botan, name to the pkg-config library can be specified optionally])],
+  [use_botan="$withval"])
+if test "${use_botan}" = ""; then
+    use_botan="yes"
+fi
+distcheck_botan="--with-botan=${use_botan}"
+if test "${use_botan}" = "no" ; then
     if test "${use_openssl}" = "no" ; then
        AC_MSG_ERROR([Need Botan or OpenSSL for libcryptolink])
     fi
-elif test "${botan_config}" != "yes" ; then
-    if test -x "${botan_config}" ; then
-        if test -d "${botan_config}" ; then
-            AC_MSG_ERROR([${botan_config} is a directory])
-        fi
-    else
-        AC_MSG_ERROR([--with-botan-config should point to a botan-config program and not a directory (${botan_config})])
-    fi
+elif test "${use_botan}" != "yes" ; then
+    BOTAN_VERSIONS="${use_botan}"
 else
-    BOTAN_CONFIG=""
-    AC_PATH_PROG([PKG_CONFIG], [pkg-config])
-    if test "$PKG_CONFIG" != "" ; then
-        BOTAN_VERSIONS="botan-2"
-        for version in $BOTAN_VERSIONS; do
-            ACX_TRY_BOTAN_TOOL([pkg-config], ["$version --silence-errors"],
-                               [ BOTAN_CONFIG="$PKG_CONFIG $version" ]
-                              )
-            if test "$BOTAN_CONFIG" != "" ; then
-                break
-            fi
-        done
-    fi
+    BOTAN_VERSIONS="botan-2"
 fi
 
-if test "$BOTAN_CONFIG" != ""
-then
-    CRYPTO_LIBS=`${BOTAN_CONFIG} --libs`
-    CRYPTO_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 CRYPTO_INCLUDES (but using include instead of lib) below.
-    if [ ${BOTAN_CONFIG} --prefix >/dev/null 2>&1 ] ; then
-        echo ${CRYPTO_LIBS} | grep -- -L > /dev/null || \
-            CRYPTO_LIBS="-L`${BOTAN_CONFIG} --prefix`/lib ${CRYPTO_LIBS}"
-        echo ${CRYPTO_INCLUDES} | grep -- -I > /dev/null || \
-            CRYPTO_INCLUDES="-I`${BOTAN_CONFIG} --prefix`/include ${CRYPTO_INCLUDES}"
-    fi
+BOTAN_CONFIG=""
+AC_PATH_PROG([PKG_CONFIG], [pkg-config])
+if test "$PKG_CONFIG" != "" ; then
+    for version in $BOTAN_VERSIONS; do
+        ACX_TRY_BOTAN_TOOL([pkg-config], ["$version --silence-errors"],
+                           [BOTAN_CONFIG="$PKG_CONFIG $version"])
+        if test "$BOTAN_CONFIG" != "" ; then
+            CRYPTO_LIBS=`${BOTAN_CONFIG} --libs`
+            CRYPTO_INCLUDES=`${BOTAN_CONFIG} --cflags`
+            break
+        fi
+    done
 fi
 
 if test "x${CRYPTO_LIBS}" != "x"
@@ -159,14 +141,6 @@ EOF
    $RM -f conftest.cpp
    AC_MSG_RESULT([$CRYPTO_VERSION])
 
-   # botan-config script (and the way we call pkg-config) returns -L and -l
-   # as one string, but we need them in separate values
-   CRYPTO_LDFLAGS=
-   for flag in ${CRYPTO_LIBS}; do
-       CRYPTO_LDFLAGS="${CRYPTO_LDFLAGS} `echo $flag | ${SED} -ne '/^\(\-L\)/p'`"
-       CRYPTO_LIBS="${CRYPTO_LIBS} `echo $flag | ${SED} -ne '/^\(\-l\)/p'`"
-   done
-
    # # check -R, "-Wl,-R" or -rpath
    AX_ISC_RPATH