From: Remi Gacogne Date: Fri, 12 Jan 2018 16:39:28 +0000 (+0100) Subject: dnsdist: Fix building without libssl X-Git-Tag: dnsdist-1.3.0~146^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bcd558c3b8ebd9eac69546af532dec792a62dff9;p=pdns dnsdist: Fix building without libssl --- diff --git a/pdns/dnsdistdist/m4/dnsdist_check_gnutls.m4 b/pdns/dnsdistdist/m4/dnsdist_check_gnutls.m4 index 56de1a5b5..4d8eaf784 100644 --- a/pdns/dnsdistdist/m4/dnsdist_check_gnutls.m4 +++ b/pdns/dnsdistdist/m4/dnsdist_check_gnutls.m4 @@ -1,9 +1,10 @@ AC_DEFUN([DNSDIST_CHECK_GNUTLS], [ AC_MSG_CHECKING([whether we will be linking in GnuTLS]) + HAVE_GNUTLS=0 AC_ARG_ENABLE([gnutls], AS_HELP_STRING([--enable-gnutls],[use GnuTLS @<:@default=auto@:>@]), [enable_gnutls=$enableval], - [enable_gnutls=no], + [enable_gnutls=auto], ) AC_MSG_RESULT([$enable_gnutls]) @@ -11,6 +12,7 @@ AC_DEFUN([DNSDIST_CHECK_GNUTLS], [ AS_IF([test "x$enable_gnutls" = "xyes" -o "x$enable_gnutls" = "xauto"], [ # we require gnutls_certificate_set_x509_key_file, added in 3.1.11 PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.1.11], [ + [HAVE_GNUTLS=1] AC_DEFINE([HAVE_GNUTLS], [1], [Define to 1 if you have GnuTLS]) ], [ : ]) ]) diff --git a/pdns/dnsdistdist/m4/dnsdist_check_libssl.m4 b/pdns/dnsdistdist/m4/dnsdist_check_libssl.m4 index 96f46aba4..cbdde940d 100644 --- a/pdns/dnsdistdist/m4/dnsdist_check_libssl.m4 +++ b/pdns/dnsdistdist/m4/dnsdist_check_libssl.m4 @@ -1,9 +1,25 @@ AC_DEFUN([DNSDIST_CHECK_LIBSSL], [ + AC_MSG_CHECKING([whether we will be linking in OpenSSL libssl]) HAVE_LIBSSL=0 - AC_MSG_CHECKING([if OpenSSL libssl is available]) - PKG_CHECK_MODULES([LIBSSL], [libssl], [ - [HAVE_LIBSSL=1], - AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have OpenSSL libssl]) + AC_ARG_ENABLE([libssl], + AS_HELP_STRING([--enable-libssl],[use OpenSSL libssl @<:@default=auto@:>@]), + [enable_libssl=$enableval], + [enable_libssl=auto], + ) + AC_MSG_RESULT([$enable_libssl]) + + AS_IF([test "x$enable_libssl" != "xno"], [ + AS_IF([test "x$enable_libssl" = "xyes" -o "x$enable_libssl" = "xauto"], [ + PKG_CHECK_MODULES([LIBSSL], [libssl], [ + [HAVE_LIBSSL=1] + AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have OpenSSL libssl]) + ], [ : ]) + ]) ]) AM_CONDITIONAL([HAVE_LIBSSL], [test "x$LIBSSL_LIBS" != "x"]) + AS_IF([test "x$enable_libssl" = "xyes"], [ + AS_IF([test x"$LIBSSL_LIBS" = "x"], [ + AC_MSG_ERROR([OpenSSL libssl requested but libraries were not found]) + ]) + ]) ]) diff --git a/pdns/dnsdistdist/m4/pdns_check_libcrypto.m4 b/pdns/dnsdistdist/m4/pdns_check_libcrypto.m4 new file mode 120000 index 000000000..b56d43abb --- /dev/null +++ b/pdns/dnsdistdist/m4/pdns_check_libcrypto.m4 @@ -0,0 +1 @@ +../../../m4/pdns_check_libcrypto.m4 \ No newline at end of file