configure: cleanup wolfssl + pkg-config conflicts when cross compiling.

Also choose a different wolfSSL function to test for NTLM support.

Fixes #5605
Closes #5682
This commit is contained in:
Ehren Bendler 2020-07-14 22:38:38 -04:00 committed by Daniel Stenberg
parent ba390221ef
commit 14e63c19a0
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 21 additions and 10 deletions

View File

@ -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
]
)

View File

@ -641,7 +641,7 @@ int netware_init(void);
defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_SECTRANSP) || \
defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO) || \
defined(USE_MBEDTLS) || \
(defined(USE_WOLFSSL) && defined(HAVE_WOLFSSL_DES_SET_ODD_PARITY))
(defined(USE_WOLFSSL) && defined(HAVE_WOLFSSL_DES_ECB_ENCRYPT))
#define USE_NTLM