From: Viktor Szakats Date: Fri, 24 Oct 2025 16:03:52 +0000 (+0200) Subject: autotools: merge `if`s in GnuTLS/OpenSSL feature detection X-Git-Tag: rc-8_17_0-3~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2b30d29c3c1b6fbda1c50e91c2948bb1986f4bd8;p=thirdparty%2Fcurl.git autotools: merge `if`s in GnuTLS/OpenSSL feature detection Closes #19222 --- diff --git a/m4/curl-gnutls.m4 b/m4/curl-gnutls.m4 index fb98f8d8fb..0872ee52b6 100644 --- a/m4/curl-gnutls.m4 +++ b/m4/curl-gnutls.m4 @@ -137,11 +137,10 @@ if test "x$OPT_GNUTLS" != xno; then test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" fi -dnl --- -dnl Check which crypto backend GnuTLS uses -dnl --- - if test "$GNUTLS_ENABLED" = "1"; then + dnl --- + dnl Check which crypto backend GnuTLS uses + dnl --- USE_GNUTLS_NETTLE= # First check if we can detect either crypto library via transitive linking AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ]) @@ -154,17 +153,14 @@ if test "$GNUTLS_ENABLED" = "1"; then AC_MSG_ERROR([GnuTLS found, but nettle was not found]) fi LIBS="-lnettle $LIBS" -fi -dnl --- -dnl We require GnuTLS with SRP support. -dnl --- -if test "$GNUTLS_ENABLED" = "1"; then + dnl --- + dnl We require GnuTLS with SRP support. + dnl --- AC_CHECK_LIB(gnutls, gnutls_srp_verifier, [ AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier]) HAVE_GNUTLS_SRP=1 ]) fi - ]) diff --git a/m4/curl-openssl.m4 b/m4/curl-openssl.m4 index 5175bb85d2..18c929e2b2 100644 --- a/m4/curl-openssl.m4 +++ b/m4/curl-openssl.m4 @@ -340,10 +340,10 @@ if test X"$OPT_OPENSSL" != Xno && AC_MSG_ERROR([--with-openssl was given but OpenSSL could not be detected]) fi -dnl --- -dnl We check OpenSSL for DES support. -dnl --- if test "$OPENSSL_ENABLED" = "1"; then + dnl --- + dnl We check OpenSSL for DES support. + dnl --- AC_MSG_CHECKING([for DES support in OpenSSL]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ @@ -361,12 +361,10 @@ if test "$OPENSSL_ENABLED" = "1"; then ],[ AC_MSG_RESULT([no]) ]) -fi -dnl --- -dnl We require OpenSSL with SRP support. -dnl --- -if test "$OPENSSL_ENABLED" = "1"; then + dnl --- + dnl We require OpenSSL with SRP support. + dnl --- AC_MSG_CHECKING([for SRP support in OpenSSL]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ @@ -385,12 +383,10 @@ if test "$OPENSSL_ENABLED" = "1"; then ],[ AC_MSG_RESULT([no]) ]) -fi -dnl --- -dnl Whether the OpenSSL configuration will be loaded automatically -dnl --- -if test X"$OPENSSL_ENABLED" = X"1"; then + dnl --- + dnl Whether the OpenSSL configuration will be loaded automatically + dnl --- AC_ARG_ENABLE(openssl-auto-load-config, AS_HELP_STRING([--enable-openssl-auto-load-config],[Enable automatic loading of OpenSSL configuration]) AS_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading of OpenSSL configuration]), @@ -399,12 +395,10 @@ AS_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading o AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration won't be loaded automatically]) fi ]) -fi -dnl --- -dnl We may use OpenSSL QUIC. -dnl --- -if test "$OPENSSL_ENABLED" = "1"; then + dnl --- + dnl We may use OpenSSL QUIC. + dnl --- AC_MSG_CHECKING([for QUIC support and OpenSSL >= 3.3]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[