]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix default build with libgnutls but absent GnuTLS headers (#1332)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Thu, 27 Apr 2023 16:42:02 +0000 (16:42 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sat, 29 Apr 2023 15:23:51 +0000 (03:23 +1200)
Ensure that when libgnutls is found but any of the required GnuTLS
headers cannot be used, GnuTLS support is not enabled by default and an
explicit request for GnuTLS support is fatally rejected during
./configure. Otherwise, the build fails later anyway, during "make".

The problem was exposed by a mingw-cross build.

configure.ac

index d8c3b38cf674803fb8fb32908eddf811845b37b8..08f818c01d624c8849dd0921ea39873b7e5f6435 100644 (file)
@@ -1288,7 +1288,8 @@ if test "x$with_gnutls" != "xno"; then
     ## by testing for a 3.4.0+ function which we use
     AC_CHECK_LIB(gnutls,gnutls_pcert_export_x509,[LIBGNUTLS_LIBS="-lgnutls"])
   ])
-  AC_CHECK_HEADERS(gnutls/gnutls.h gnutls/x509.h gnutls/abstract.h)
+  # if any of the required headers is not found, signal we can't support gnutls
+  AC_CHECK_HEADERS([gnutls/gnutls.h gnutls/x509.h gnutls/abstract.h], [], [LIBGNUTLS_LIBS=""])
 
   SQUID_STATE_ROLLBACK(squid_gnutls_state) #de-pollute LIBS