]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
configure.ac: fix polarssl autodetection
authorSteffan Karger <steffan@karger.me>
Mon, 18 Jan 2016 20:49:40 +0000 (21:49 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 18 Jan 2016 20:57:44 +0000 (21:57 +0100)
A missing , in the previous configure.ac patch caused the autodetection to
fail.  While fixing that, I noticed I can simplify the check by using the
documented ${ac_cv_search_function} cache variable instead of the nested
AC_SEARCH_LIBS.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1453150181-21453-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11010
Signed-off-by: Gert Doering <gert@greenie.muc.de>
configure.ac

index 73dd0325a7c4a4ee9e9a87b08cdcc6bde71d7839..7ff2435ac9579a9ff85e88746148a27d2eda5799 100644 (file)
@@ -832,30 +832,28 @@ elif test "${with_crypto_library}" = "polarssl"; then
        AC_ARG_VAR([POLARSSL_CFLAGS], [C compiler flags for polarssl])
        AC_ARG_VAR([POLARSSL_LIBS], [linker flags for polarssl])
 
+       saved_CFLAGS="${CFLAGS}"
+       saved_LIBS="${LIBS}"
+
        if test -z "${POLARSSL_CFLAGS}" -a -z "${POLARSSL_LIBS}"; then
         # if the user did not explicitly specify flags, try to autodetect
                AC_SEARCH_LIBS(
                        [ssl_init],
-                       [mbedtls],
-                       [POLARSSL_LIBS=-lmbedtls]
+                       [mbedtls polarssl],
                        [
-                               AC_SEARCH_LIBS(
-                                       [ssl_init],
-                                       [polarssl],
-                                       [POLARSSL_LIBS=-lpolarssl]
-                                       [],
-                                       [${PKCS11_HELPER_LIBS}]
-                               )
+                               if test "${ac_cv_search_ssl_init}" != "none required"; then
+                                       POLARSSL_LIBS=${ac_cv_search_ssl_init}
+                               fi
                        ],
+                       [AC_MSG_ERROR([Could not find PolarSSL/mbed TLS.])],
                        [${PKCS11_HELPER_LIBS}]
                )
        fi
 
-       AC_MSG_CHECKING([polarssl version])
-       saved_CFLAGS="${CFLAGS}"
-       saved_LIBS="${LIBS}"
        CFLAGS="${POLARSSL_CFLAGS} ${PKCS11_HELPER_CFLAGS} ${CFLAGS}"
        LIBS="${POLARSSL_LIBS} ${PKCS11_HELPER_LIBS} ${LIBS}"
+
+       AC_MSG_CHECKING([polarssl version])
        AC_COMPILE_IFELSE(
                [AC_LANG_PROGRAM(
                        [[