summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authornikita <nikita@NetBSD.org>2020-09-14 20:38:16 +0200
committernikita <nikita@NetBSD.org>2020-09-14 20:38:16 +0200
commitea5627408e41592ac8750032de41b97038811d88 (patch)
tree851007eaf0e4e3ec6b97756e209b512792933b88 /configure.ac
parentb8e9ccfa48a0b35e2c9dd560334237e591175be8 (diff)
parent5a1fc8d33808d7b22f57bdf9403cda7ff07b0670 (diff)
downloadgnurl-ea5627408e41592ac8750032de41b97038811d88.tar.gz
gnurl-ea5627408e41592ac8750032de41b97038811d88.tar.bz2
gnurl-ea5627408e41592ac8750032de41b97038811d88.zip
Merge tag 'curl-7_71_1'
curl 7.71.1
Diffstat (limited to 'configure.ac')
-rwxr-xr-xconfigure.ac133
1 files changed, 105 insertions, 28 deletions
diff --git a/configure.ac b/configure.ac
index 741b4249b..cddd3303a 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1137,7 +1137,7 @@ if test X"$OPT_BROTLI" != Xno; then
LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
version=`$PKGCONFIG --modversion libbrotlidec`
- DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/-L//'`
+ DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
fi
;;
@@ -1363,12 +1363,14 @@ dnl Check if the operating system allows programs to write to their own argv[]
dnl **********************************************************************
AC_MSG_CHECKING([if argv can be written to])
-CURL_RUN_IFELSE([
-int main(int argc, char ** argv) {
- argv[0][0] = ' ';
- return (argv[0][0] == ' ')?0:1;
+CURL_RUN_IFELSE([[
+int main(int argc, char **argv)
+{
+ (void)argc;
+ argv[0][0] = ' ';
+ return (argv[0][0] == ' ')?0:1;
}
-],[
+]],[
curl_cv_writable_argv=yes
],[
curl_cv_writable_argv=no
@@ -1805,7 +1807,7 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
- LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
+ LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/^-L//'`
dnl use the values pkg-config reported. This is here
dnl instead of below with CPPFLAGS and LDFLAGS because we only
@@ -1830,6 +1832,8 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
# only set this if pkg-config wasn't used
CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
fi
+ # Linking previously failed, try extra paths from --with-ssl or pkg-config.
+ # Use a different function name to avoid reusing the earlier cached result.
AC_CHECK_LIB(crypto, HMAC_Init_ex,[
HAVECRYPTO="yes"
LIBS="-lcrypto $LIBS"], [
@@ -1851,6 +1855,7 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
[
AC_MSG_RESULT(no)
dnl ok, so what about both -ldl and -lpthread?
+ dnl This may be necessary for static libraries.
AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
LIBS="$CLEANLIBS -lcrypto -ldl -lpthread"
@@ -2122,7 +2127,7 @@ if test -z "$ssl_backends" -o "x$OPT_GNUTLS" != xno; then
addld=`$PKGCONFIG --libs-only-L gnutls`
addcflags=`$PKGCONFIG --cflags-only-I gnutls`
version=`$PKGCONFIG --modversion gnutls`
- gtlslib=`echo $addld | $SED -e 's/-L//'`
+ gtlslib=`echo $addld | $SED -e 's/^-L//'`
else
dnl without pkg-config, we try libgnutls-config as that was how it
dnl used to be done
@@ -2357,6 +2362,15 @@ AC_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to
AC_HELP_STRING([--without-wolfssl], [disable WolfSSL detection]),
OPT_WOLFSSL=$withval)
+case "$OPT_WOLFSSL" in
+ yes|no)
+ wolfpkg=""
+ ;;
+ *)
+ wolfpkg="$withval/lib/pkgconfig"
+ ;;
+esac
+
if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then
ssl_msg=
@@ -2366,22 +2380,41 @@ if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then
OPT_WOLFSSL=""
fi
+ CURL_CHECK_PKGCONFIG(wolfssl, [$wolfpkg])
+ AC_MSG_NOTICE([Check dir $wolfpkg])
+
addld=""
addlib=""
addcflags=""
-
- if test "x$USE_WOLFSSL" != "xyes"; then
+ if test "$PKGCONFIG" != "no" ; then
+ addlib=`CURL_EXPORT_PCDIR([$wolfpkg])
+ $PKGCONFIG --libs-only-l wolfssl`
+ addld=`CURL_EXPORT_PCDIR([$wolfpkg])
+ $PKGCONFIG --libs-only-L wolfssl`
+ addcflags=`CURL_EXPORT_PCDIR([$wolfpkg])
+ $PKGCONFIG --cflags-only-I wolfssl`
+ version=`CURL_EXPORT_PCDIR([$wolfpkg])
+ $PKGCONFIG --modversion wolfssl`
+ 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
+ fi
+
+ if test "x$USE_WOLFSSL" != "xyes"; then
LDFLAGS="$LDFLAGS $addld"
+ AC_MSG_NOTICE([Add $addld to LDFLAGS])
if test "$addcflags" != "-I/usr/include"; then
CPPFLAGS="$CPPFLAGS $addcflags"
+ AC_MSG_NOTICE([Add $addcflags to CPPFLAGS])
fi
my_ac_save_LIBS="$LIBS"
- LIBS="-lwolfssl -lm $LIBS"
+ LIBS="$addlib $LIBS"
+ AC_MSG_NOTICE([Add $addlib to LIBS])
AC_MSG_CHECKING([for wolfSSL_Init in -lwolfssl])
AC_LINK_IFELSE([
@@ -2423,9 +2456,23 @@ if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then
dnl Recent WolfSSL versions build without SSLv3 by default
dnl WolfSSL needs configure --enable-opensslextra to have *get_peer*
+ dnl DES* is needed for NTLM support and lives in the OpenSSL compatibility
+ dnl layer
AC_CHECK_FUNCS(wolfSSLv3_client_method \
wolfSSL_get_peer_certificate \
- wolfSSL_UseALPN)
+ wolfSSL_UseALPN )
+
+ 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_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])
+ WOLFSSL_NTLM=1
+ ]
+ )
if test -n "$wolfssllibpath"; then
dnl when shared libs were found in a path that the run-time
@@ -2874,7 +2921,7 @@ if test X"$OPT_LIBMETALINK" != Xno; then
$PKGCONFIG --cflags-only-I libmetalink`
version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
$PKGCONFIG --modversion libmetalink`
- libmetalinklib=`echo $addld | $SED -e 's/-L//'`
+ libmetalinklib=`echo $addld | $SED -e 's/^-L//'`
fi
if test -n "$addlib"; then
@@ -2965,7 +3012,7 @@ if test X"$OPT_LIBSSH2" != Xno; then
LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
version=`$PKGCONFIG --modversion libssh2`
- DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'`
+ DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
fi
;;
@@ -3039,7 +3086,7 @@ elif test X"$OPT_LIBSSH" != Xno; then
LD_SSH=`$PKGCONFIG --libs-only-L libssh`
CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
version=`$PKGCONFIG --modversion libssh`
- DIR_SSH=`echo $LD_SSH | $SED -e 's/-L//'`
+ DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
fi
;;
@@ -3149,7 +3196,7 @@ if test X"$OPT_LIBRTMP" != Xno; then
LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
version=`$PKGCONFIG --modversion librtmp`
- DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
+ DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'`
else
dnl To avoid link errors, we do not allow --librtmp without
dnl a pkgconfig file
@@ -3387,7 +3434,7 @@ if test "$want_idn" = "yes"; then
$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
- IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
+ IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
else
dnl pkg-config not available or provides no info
IDN_LIBS="-lidn2"
@@ -3402,7 +3449,7 @@ if test "$want_idn" = "yes"; then
IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
- IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
+ IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
else
dnl pkg-config not available or provides no info
IDN_LIBS="-lidn2"
@@ -3611,7 +3658,7 @@ if test X"$want_tcp2" != Xno; then
LIBS="$LIB_TCP2 $LIBS"
if test "x$cross_compiling" != "xyes"; then
- DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/-L//'`
+ DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
fi
AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new,
[
@@ -3667,7 +3714,7 @@ if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
if test "x$cross_compiling" != "xyes"; then
- DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/-L//'`
+ DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
fi
AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_ctx_initial,
[
@@ -3722,7 +3769,7 @@ if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
if test "x$cross_compiling" != "xyes"; then
- DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/-L//'`
+ DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
fi
AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_ctx_initial,
[
@@ -3810,7 +3857,7 @@ if test X"$want_nghttp3" != Xno; then
LIBS="$LIB_NGHTTP3 $LIBS"
if test "x$cross_compiling" != "xyes"; then
- DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/-L//'`
+ DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
fi
AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new,
[
@@ -3900,7 +3947,7 @@ if test X"$want_quiche" != Xno; then
LIBS="$LIB_QUICHE $LIBS"
if test "x$cross_compiling" != "xyes"; then
- DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/-L//'`
+ DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
fi
AC_CHECK_LIB(quiche, quiche_connect,
[
@@ -3911,6 +3958,7 @@ if test X"$want_quiche" != Xno; then
QUICHE_ENABLED=1
AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
AC_SUBST(USE_QUICHE, [1])
+ AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
@@ -4155,6 +4203,19 @@ AC_CHECK_TYPE(sa_family_t,
#endif
])
+# check for suseconds_t
+AC_CHECK_TYPE([suseconds_t],[
+ AC_DEFINE(HAVE_SUSECONDS_T, 1,
+ [Define to 1 if suseconds_t is an available type.])
+], ,[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+])
+
AC_MSG_CHECKING([if time_t is unsigned])
CURL_RUN_IFELSE(
[
@@ -4415,9 +4476,17 @@ if test "$want_pthreads" != "no"; then
AC_CHECK_HEADER(pthread.h,
[ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
save_CFLAGS="$CFLAGS"
-
- dnl first check for function without lib
+ dnl When statically linking against boringssl, -lpthread is added to LIBS.
+ dnl Make sure to that this does not pass the check below, we really want
+ dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
+ dnl lib1541 and lib1565 tests are built with these options. Otherwise
+ dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
+ save_LIBS="$LIBS"
+
+ LIBS=
+ dnl Check for libc variants without a separate pthread lib like bionic
AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
+ LIBS="$save_LIBS"
dnl on HPUX, life is more complicated...
case $host in
@@ -4830,6 +4899,13 @@ dnl to let curl-config output the static libraries correctly
ENABLE_STATIC="$enable_static"
AC_SUBST(ENABLE_STATIC)
+dnl merge the pkg-config Libs.private field into Libs when static-only
+if test "x$enable_shared" = "xno"; then
+ LIBCURL_NO_SHARED=$LIBCURL_LIBS
+else
+ LIBCURL_NO_SHARED=
+fi
+AC_SUBST(LIBCURL_NO_SHARED)
dnl
dnl For keeping supported features and protocols also in pkg-config file
@@ -4889,7 +4965,8 @@ fi
if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
-o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
- -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1"; then
+ -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \
+ -o "x$WOLFSSL_NTLM" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
if test "x$CURL_DISABLE_HTTP" != "x1" -a \
@@ -4982,7 +5059,8 @@ if test "x$CURL_DISABLE_SMB" != "x1" \
-a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \
-a \( "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
-o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
- -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \); then
+ -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \
+ -o "x$WOLFSSL_NTLM" = "x1" \); then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
if test "x$SSL_ENABLED" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
@@ -5003,7 +5081,6 @@ if test "x$USE_LIBSSH" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
fi
if test "x$USE_WOLFSSH" = "x1"; then
- SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
fi
if test "x$CURL_DISABLE_RTSP" != "x1"; then