AC_CHECK_LIB(bearssl, br_ssl_client_init_full,
dnl libbearssl found, set the variable
- [
- AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled])
- AC_SUBST(USE_BEARSSL, [1])
- BEARSSL_ENABLED=1
- USE_BEARSSL="yes"
- ssl_msg="BearSSL"
- test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
- ], [], -lbearssl)
+ [
+ AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled])
+ AC_SUBST(USE_BEARSSL, [1])
+ BEARSSL_ENABLED=1
+ USE_BEARSSL="yes"
+ ssl_msg="BearSSL"
+ test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
+ ], [], -lbearssl)
fi
addld=""
LDFLAGS="$LDFLAGS $addld"
if test "$addcflags" != "-I/usr/include"; then
- CPPFLAGS="$CPPFLAGS $addcflags"
+ CPPFLAGS="$CPPFLAGS $addcflags"
fi
AC_CHECK_LIB(bearssl, br_ssl_client_init_full,
- [
- AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled])
- AC_SUBST(USE_BEARSSL, [1])
- BEARSSL_ENABLED=1
- USE_BEARSSL="yes"
- ssl_msg="BearSSL"
- test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
- ],
- [
- CPPFLAGS=$_cppflags
- LDFLAGS=$_ldflags
- ], -lbearssl)
+ [
+ AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled])
+ AC_SUBST(USE_BEARSSL, [1])
+ BEARSSL_ENABLED=1
+ USE_BEARSSL="yes"
+ ssl_msg="BearSSL"
+ test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
+ ],
+ [
+ CPPFLAGS=$_cppflags
+ LDFLAGS=$_ldflags
+ ], -lbearssl)
fi
if test "x$USE_BEARSSL" = "xyes"; then
CURL_CHECK_DEF([__DECC], [], [silent])
CURL_CHECK_DEF([__DECC_VER], [], [silent])
if test "$curl_cv_have_def___DECC" = "yes" &&
- test "$curl_cv_have_def___DECC_VER" = "yes"; then
+ test "$curl_cv_have_def___DECC_VER" = "yes"; then
AC_MSG_RESULT([yes])
compiler_id="DEC_C"
flags_dbg_yes="-g2"
$tmp_EXTERN char *dummy(char *buff);
char *dummy(char *buff)
{
- if(buff)
- return ++buff;
- else
- return buff;
+ if(buff)
+ return ++buff;
+ else
+ return buff;
}
]],[[
char b[16];
dnl changes contained within this macro.
AC_DEFUN([CURL_RUN_IFELSE], [
- case $host_os in
- darwin*)
+ case $host_os in
+ darwin*)
AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
- ;;
- *)
+ ;;
+ *)
oldcc=$CC
old=$LD_LIBRARY_PATH
CC="sh ./run-compiler"
AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
LD_LIBRARY_PATH=$old # restore
CC=$oldcc
- ;;
- esac
+ ;;
+ esac
])
dnl CURL_COVERAGE
dnl check if enabled by argument
AC_ARG_ENABLE(code-coverage,
- AS_HELP_STRING([--enable-code-coverage], [Provide code coverage]),
- coverage="$enableval")
+ AS_HELP_STRING([--enable-code-coverage], [Provide code coverage]),
+ coverage="$enableval")
dnl if not gcc switch off again
AS_IF([ test "$GCC" != "yes" ], coverage="no" )
r=0
dnl Check the sizes in a reasonable order
for typesize in 8 4 2 16 1; do
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
$2
]],
- [switch(0) {
- case 0:
- case (sizeof($1) == $typesize):;
- }
+ [switch(0) {
+ case 0:
+ case (sizeof($1) == $typesize):;
+ }
]) ],
[
- r=$typesize],
+ r=$typesize],
[
- r=0])
+ r=0])
dnl get out of the loop once matched
if test $r -gt 0; then
break;
LIBS="$addlib $LIBS"
LDFLAGS="$LDFLAGS $addld"
if test "$addcflags" != "-I/usr/include"; then
- CPPFLAGS="$CPPFLAGS $addcflags"
+ CPPFLAGS="$CPPFLAGS $addcflags"
fi
dnl this function is selected since it was introduced in 3.1.10
AC_CHECK_LIB(gnutls, gnutls_x509_crt_get_dn2,
- [
- AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
- AC_SUBST(USE_GNUTLS, [1])
- GNUTLS_ENABLED=1
- USE_GNUTLS="yes"
- ssl_msg="GnuTLS"
- QUIC_ENABLED=yes
- test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
- ],
- [
- LIBS="$CLEANLIBS"
- CPPFLAGS="$CLEANCPPFLAGS"
- ])
+ [
+ AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
+ AC_SUBST(USE_GNUTLS, [1])
+ GNUTLS_ENABLED=1
+ USE_GNUTLS="yes"
+ ssl_msg="GnuTLS"
+ QUIC_ENABLED=yes
+ test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
+ ],
+ [
+ LIBS="$CLEANLIBS"
+ CPPFLAGS="$CLEANCPPFLAGS"
+ ])
if test "x$USE_GNUTLS" = "xyes"; then
AC_MSG_NOTICE([detected GnuTLS version $version])
fi
AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
- [
- AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
- AC_SUBST(USE_MBEDTLS, [1])
- MBEDTLS_ENABLED=1
- USE_MBEDTLS="yes"
- ssl_msg="mbedTLS"
- test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
- ],
- [
- CPPFLAGS=$_cppflags
- LDFLAGS=$_ldflags
- ], -lmbedx509 -lmbedcrypto)
+ [
+ AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
+ AC_SUBST(USE_MBEDTLS, [1])
+ MBEDTLS_ENABLED=1
+ USE_MBEDTLS="yes"
+ ssl_msg="mbedTLS"
+ test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
+ ],
+ [
+ CPPFLAGS=$_cppflags
+ LDFLAGS=$_ldflags
+ ], -lmbedx509 -lmbedcrypto)
fi
if test "x$USE_MBEDTLS" = "xyes"; then
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
AC_CHECK_LIB(crypto, HMAC_Update,[
- HAVECRYPTO="yes"
- LIBS="-lcrypto $LIBS"
- ],[
- if test -n "$LIB_OPENSSL" ; then
- LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
- fi
- if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then
- # only set this if pkg-config wasn't used
- CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include"
- fi
- # Linking previously failed, try extra paths from --with-openssl 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"], [
-
- dnl still no, but what about with -ldl?
- AC_MSG_CHECKING([OpenSSL linking with -ldl])
- LIBS="-lcrypto $CLEANLIBS -ldl"
- AC_LINK_IFELSE([ AC_LANG_PROGRAM([[
- #include <openssl/err.h>
- ]], [[
- ERR_clear_error();
- ]]) ],
- [
- AC_MSG_RESULT(yes)
- HAVECRYPTO="yes"
- ],
- [
- 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="-lcrypto $CLEANLIBS -ldl -lpthread"
- AC_LINK_IFELSE([
- AC_LANG_PROGRAM([[
- #include <openssl/err.h>
- ]], [[
- ERR_clear_error();
- ]])],
- [
- AC_MSG_RESULT(yes)
- HAVECRYPTO="yes"
- ],
- [
- AC_MSG_RESULT(no)
- LDFLAGS="$CLEANLDFLAGS"
- CPPFLAGS="$CLEANCPPFLAGS"
- LIBS="$CLEANLIBS"
-
- ])
-
- ])
-
- ])
+ HAVECRYPTO="yes"
+ LIBS="-lcrypto $LIBS"
+ ],[
+ if test -n "$LIB_OPENSSL" ; then
+ LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
+ fi
+ if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then
+ # only set this if pkg-config wasn't used
+ CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include"
+ fi
+ # Linking previously failed, try extra paths from --with-openssl 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"], [
+
+ dnl still no, but what about with -ldl?
+ AC_MSG_CHECKING([OpenSSL linking with -ldl])
+ LIBS="-lcrypto $CLEANLIBS -ldl"
+ AC_LINK_IFELSE([ AC_LANG_PROGRAM([[
+ #include <openssl/err.h>
+ ]], [[
+ ERR_clear_error();
+ ]]) ],
+ [
+ AC_MSG_RESULT(yes)
+ HAVECRYPTO="yes"
+ ],
+ [
+ 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="-lcrypto $CLEANLIBS -ldl -lpthread"
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[
+ #include <openssl/err.h>
+ ]], [[
+ ERR_clear_error();
+ ]])],
+ [
+ AC_MSG_RESULT(yes)
+ HAVECRYPTO="yes"
+ ],
+ [
+ AC_MSG_RESULT(no)
+ LDFLAGS="$CLEANLDFLAGS"
+ CPPFLAGS="$CLEANCPPFLAGS"
+ LIBS="$CLEANLIBS"
+ ])
+ ])
+ ])
])
if test X"$HAVECRYPTO" = X"yes"; then
#ifndef OPENSSL_IS_AWSLC
#error not AWS-LC
#endif
- ]])
+ ]])
],[
AC_MSG_RESULT([yes])
ssl_msg="AWS-LC"
AC_MSG_CHECKING([for LibreSSL])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
-#include <openssl/opensslv.h>
+ #include <openssl/opensslv.h>
]],[[
int dummy = LIBRESSL_VERSION_NUMBER;
]])
AC_MSG_CHECKING([for OpenSSL >= v3])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
-#include <openssl/opensslv.h>
+ #include <openssl/opensslv.h>
]],[[
#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
return 0;
if test "$OPENSSL_ENABLED" = "1"; then
if test -n "$LIB_OPENSSL"; then
- dnl when the ssl shared libs were found in a path that the run-time
- dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
- dnl to prevent further configure tests to fail due to this
- if test "x$cross_compiling" != "xyes"; then
- CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL"
- export CURL_LIBRARY_PATH
- AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH])
- fi
+ dnl when the ssl shared libs were found in a path that the run-time
+ dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
+ dnl to prevent further configure tests to fail due to this
+ if test "x$cross_compiling" != "xyes"; then
+ CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL"
+ export CURL_LIBRARY_PATH
+ AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH])
+ fi
fi
check_for_ca_bundle=1
LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE openssl"
fi
if test X"$OPT_OPENSSL" != Xno &&
- test "$OPENSSL_ENABLED" != "1"; then
+ test "$OPENSSL_ENABLED" != "1"; then
AC_MSG_NOTICE([OPT_OPENSSL: $OPT_OPENSSL])
AC_MSG_NOTICE([OPENSSL_ENABLED: $OPENSSL_ENABLED])
AC_MSG_ERROR([--with-openssl was given but OpenSSL could not be detected])
AC_MSG_CHECKING([for SRP support in OpenSSL])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
-#include <openssl/ssl.h>
+ #include <openssl/ssl.h>
]],[[
SSL_CTX_set_srp_username(NULL, "");
SSL_CTX_set_srp_password(NULL, "");
AC_MSG_CHECKING([for QUIC support and OpenSSL >= 3.3])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
-#include <openssl/ssl.h>
+ #include <openssl/ssl.h>
]],[[
#if (OPENSSL_VERSION_NUMBER < 0x30300000L)
#error need at least version 3.3.0
darwin*)
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <TargetConditionals.h>
+ #include <sys/types.h>
+ #include <TargetConditionals.h>
]],[[
-#if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
- return 0;
-#else
-#error Not macOS
-#endif
+ #if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
+ return 0;
+ #else
+ #error Not macOS
+ #endif
]])
],[
build_for_macos="yes"
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])
+ CPPFLAGS="$CPPFLAGS $addcflags"
+ AC_MSG_NOTICE([Add $addcflags to CPPFLAGS])
fi
my_ac_save_LIBS="$LIBS"
return wolfSSL_Init();
]])
],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled])
- AC_SUBST(USE_WOLFSSL, [1])
- WOLFSSL_ENABLED=1
- USE_WOLFSSL="yes"
- ssl_msg="wolfSSL"
- QUIC_ENABLED=yes
- test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
- ],
- [
- AC_MSG_RESULT(no)
- CPPFLAGS=$_cppflags
- LDFLAGS=$_ldflags
- wolfssllibpath=""
- ])
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled])
+ AC_SUBST(USE_WOLFSSL, [1])
+ WOLFSSL_ENABLED=1
+ USE_WOLFSSL="yes"
+ ssl_msg="wolfSSL"
+ QUIC_ENABLED=yes
+ test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
+ ],
+ [
+ AC_MSG_RESULT(no)
+ CPPFLAGS=$_cppflags
+ LDFLAGS=$_ldflags
+ wolfssllibpath=""
+ ])
LIBS="$my_ac_save_LIBS"
fi
test $xc_bad_var_cflags = yes ||
test $xc_bad_var_ldflags = yes ||
test $xc_bad_var_cppflags = yes; then
- AC_MSG_ERROR([Can not continue. Fix errors mentioned immediately above this line.])
+ AC_MSG_ERROR([Can not continue. Fix errors mentioned immediately above this line.])
fi
])
test $xc_bad_var_cflags = yes ||
test $xc_bad_var_ldflags = yes ||
test $xc_bad_var_cppflags = yes; then
- AC_MSG_WARN([Continuing even with errors mentioned immediately above this line.])
+ AC_MSG_WARN([Continuing even with errors mentioned immediately above this line.])
fi
])