From 14e63c19a080a7666cffe435a0aa3d455cfec5f9 Mon Sep 17 00:00:00 2001 From: Ehren Bendler Date: Tue, 14 Jul 2020 22:38:38 -0400 Subject: configure: cleanup wolfssl + pkg-config conflicts when cross compiling. Also choose a different wolfSSL function to test for NTLM support. Fixes #5605 Closes #5682 --- configure.ac | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 03fbda34d..3d40872ec 100755 --- a/configure.ac +++ b/configure.ac @@ -2381,6 +2381,7 @@ if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then OPT_WOLFSSL="" fi + dnl try pkg-config magic CURL_CHECK_PKGCONFIG(wolfssl, [$wolfpkg]) AC_MSG_NOTICE([Check dir $wolfpkg]) @@ -2399,9 +2400,12 @@ if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then wolfssllibpath=`echo $addld | $SED -e 's/^-L//'` else addlib=-lwolfssl - addld=-L$OPT_WOLFSSL/lib$libsuff - addcflags=-I$OPT_WOLFSSL/include - wolfssllibpath=$OPT_WOLFSSL/lib$libsuff + dnl use system defaults if user does not supply a path + if test -n "$OPT_WOLFSSL"; then + addld=-L$OPT_WOLFSSL/lib$libsuff + addcflags=-I$OPT_WOLFSSL/include + wolfssllibpath=$OPT_WOLFSSL/lib$libsuff + fi fi if test "x$USE_WOLFSSL" != "xyes"; then @@ -2453,7 +2457,7 @@ if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then dnl wolfssl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined! AX_COMPILE_CHECK_SIZEOF(long long) - LIBS="-lwolfssl -lm $LIBS" + LIBS="$addlib -lm $LIBS" dnl Recent WolfSSL versions build without SSLv3 by default dnl WolfSSL needs configure --enable-opensslextra to have *get_peer* @@ -2465,12 +2469,19 @@ if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then dnl if this symbol is present, we want the include path to include the dnl OpenSSL API root as well - AC_CHECK_FUNC(wolfSSL_DES_set_odd_parity, + AC_CHECK_FUNC(wolfSSL_DES_ecb_encrypt, [ - AC_DEFINE(HAVE_WOLFSSL_DES_SET_ODD_PARITY, 1, - [if you have wolfSSL_DES_set_odd_parity]) - CPPFLAGS="$addcflags/wolfssl $CPPFLAGS" - AC_MSG_NOTICE([Add $addcflags/wolfssl to CPPFLAGS]) + AC_DEFINE(HAVE_WOLFSSL_DES_ECB_ENCRYPT, 1, + [if you have wolfSSL_DES_ecb_encrypt]) + if test -n "$addcflags"; then + CPPFLAGS="$addcflags/wolfssl $CPPFLAGS" + AC_MSG_NOTICE([Add $addcflags/wolfssl to CPPFLAGS]) + else + dnl user didn't give a path, so guess/hope they installed wolfssl + dnl headers to system default location + CPPFLAGS="-I$includedir/wolfssl $CPPFLAGS" + AC_MSG_NOTICE([Add $includedir/wolfssl to CPPFLAGS]) + fi WOLFSSL_NTLM=1 ] ) -- cgit v1.2.1