]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
autotools: merge `if`s in GnuTLS/OpenSSL feature detection
authorViktor Szakats <commit@vsz.me>
Fri, 24 Oct 2025 16:03:52 +0000 (18:03 +0200)
committerViktor Szakats <commit@vsz.me>
Fri, 24 Oct 2025 20:53:26 +0000 (22:53 +0200)
Closes #19222

m4/curl-gnutls.m4
m4/curl-openssl.m4

index fb98f8d8fbb4426b268bc15eb7dba9b3c04c1387..0872ee52b68360590c91a925f3bd1c5a381eae66 100644 (file)
@@ -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
-
 ])
index 5175bb85d2624ad0f692ad34fea6df33507249f5..18c929e2b27e9bbd22908d8beb3f9e447e91420d 100644 (file)
@@ -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([[