aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
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 768f52f4..f0fbcb0a 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1056,7 +1056,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
;;
@@ -1282,12 +1282,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
@@ -1719,7 +1721,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
@@ -1744,6 +1746,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"], [
@@ -1765,6 +1769,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"
@@ -2035,7 +2040,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
@@ -2270,6 +2275,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=
@@ -2279,22 +2293,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([
@@ -2336,9 +2369,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
@@ -2785,7 +2832,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
@@ -2875,7 +2922,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
;;
@@ -2948,7 +2995,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
;;
@@ -3056,7 +3103,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
@@ -3292,7 +3339,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"
@@ -3307,7 +3354,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"
@@ -3514,7 +3561,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,
[
@@ -3570,7 +3617,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,
[
@@ -3625,7 +3672,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,
[
@@ -3713,7 +3760,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,
[
@@ -3803,7 +3850,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,
[
@@ -3814,6 +3861,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]),
@@ -4058,6 +4106,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(
[
@@ -4311,9 +4372,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
@@ -4726,6 +4795,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
@@ -4785,7 +4861,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 \
@@ -4878,7 +4955,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"
@@ -4899,7 +4977,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