From: Peter van Dijk Date: Wed, 24 Apr 2019 15:17:58 +0000 (+0200) Subject: refactor tls/https lib handling to cover all option combinations X-Git-Tag: dnsdist-1.4.0-alpha2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=529f261b75c6af445e978c4d386a7efbafa2be97;p=thirdparty%2Fpdns.git refactor tls/https lib handling to cover all option combinations --- diff --git a/pdns/dnsdistdist/Makefile.am b/pdns/dnsdistdist/Makefile.am index 35600a2ea0..2112afa53e 100644 --- a/pdns/dnsdistdist/Makefile.am +++ b/pdns/dnsdistdist/Makefile.am @@ -191,8 +191,12 @@ if HAVE_RE2 dnsdist_LDADD += $(RE2_LIBS) endif +if HAVE_LIBSSL +dnsdist_LDADD += $(LIBSSL_LIBS) +endif + if HAVE_LIBCRYPTO -dnsdist_LDADD += $(LIBCRYPTO_LIBS) +dnsdist_LDADD += $(LIBCRYPTO_LDFLAGS) $(LIBCRYPTO_LIBS) dnsdist_SOURCES += ipcipher.cc ipcipher.hh endif @@ -200,10 +204,6 @@ if HAVE_DNS_OVER_TLS if HAVE_GNUTLS dnsdist_LDADD += -lgnutls endif - -if HAVE_LIBSSL -dnsdist_LDADD += $(LIBSSL_LIBS) -endif endif if HAVE_DNS_OVER_HTTPS @@ -213,10 +213,6 @@ if HAVE_LIBH2OEVLOOP dnsdist_LDADD += $(LIBH2OEVLOOP_LIBS) endif -if HAVE_LIBSSL -dnsdist_LDADD += $(LIBSSL_LIBS) -endif - endif if !HAVE_LUA_HPP diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index 456879f335..83563abada 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -65,26 +65,29 @@ AM_CONDITIONAL([HAVE_GNUTLS], [false]) AM_CONDITIONAL([HAVE_LIBSSL], [false]) PDNS_CHECK_LIBCRYPTO -DNSDIST_WITH_LIBSSL DNSDIST_ENABLE_DNS_OVER_TLS +DNSDIST_ENABLE_DNS_OVER_HTTPS + +AS_IF([test "x$enable_dns_over_tls" != "xno" -o "x$enable_dns_over_https" != "xno"], [ + DNSDIST_WITH_LIBSSL +]) AS_IF([test "x$enable_dns_over_tls" != "xno"], [ DNSDIST_WITH_GNUTLS - AS_IF([test "$HAVE_GNUTLS" = "0" -a "$HAVE_LIBSSL" = "0"], [ + AS_IF([test "x$HAVE_GNUTLS" != "x1" -a "x$HAVE_LIBSSL" != "x1"], [ AC_MSG_ERROR([DNS over TLS support requested but neither GnuTLS nor OpenSSL are available]) ]) ]) -DNSDIST_ENABLE_DNS_OVER_HTTPS PDNS_CHECK_LIBH2OEVLOOP AS_IF([test "x$enable_dns_over_https" != "xno"], [ - AS_IF([test "$HAVE_LIBH2OEVLOOP" = "0"], [ + AS_IF([test "x$HAVE_LIBH2OEVLOOP" != "x1"], [ AC_MSG_ERROR([DNS over HTTPS support requested but libh2o-evloop was not found]) ]) - AS_IF([test "$HAVE_LIBSSL" = "0"], [ + AS_IF([test "x$HAVE_LIBSSL" != "x1"], [ AC_MSG_ERROR([DNS over HTTPS support requested but OpenSSL was not found]) ]) ])