From: Neil Cook Date: Tue, 24 Jul 2018 12:16:00 +0000 (+0200) Subject: Make NOD and Boost FS conditional for compilation based on configure flag X-Git-Tag: dnsdist-1.3.3~184^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b7b7c32f5aa5d4b476f8a7907f1520df8ed3ab04;p=thirdparty%2Fpdns.git Make NOD and Boost FS conditional for compilation based on configure flag --- diff --git a/pdns/recursordist/Makefile.am b/pdns/recursordist/Makefile.am index ed7366294d..70a0346152 100644 --- a/pdns/recursordist/Makefile.am +++ b/pdns/recursordist/Makefile.am @@ -11,8 +11,12 @@ AM_CPPFLAGS += \ AM_CXXFLAGS = \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DPKGLIBDIR=\"$(pkglibdir)\" \ - -DLOCALSTATEDIR=\"$(socketdir)\" \ + -DLOCALSTATEDIR=\"$(socketdir)\" + +if NOD_ENABLED +AM_CXXFLAGS += \ -DNODCACHEDIR=\"$(nodcachedir)\" +endif AM_LDFLAGS = \ $(PROGRAM_LDFLAGS) \ @@ -123,7 +127,6 @@ pdns_recursor_SOURCES = \ mtasker_context.cc mtasker_context.hh \ namespaces.hh \ negcache.hh negcache.cc \ - nod.hh nod.cc \ nsecrecords.cc \ opensslsigners.cc opensslsigners.hh \ packetcache.hh \ @@ -185,13 +188,20 @@ pdns_recursor_LDADD = \ $(NET_SNMP_LIBS) \ $(SYSTEMD_LIBS) \ $(RT_LIBS) \ - $(BOOST_FILESYSTEM_LIBS) \ $(BOOST_SYSTEM_LIBS) \ $(PROBDS_LIBS) pdns_recursor_LDFLAGS = $(AM_LDFLAGS) \ $(LIBCRYPTO_LDFLAGS) $(BOOST_CONTEXT_LDFLAGS) \ - $(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) + $(BOOST_SYSTEM_LDFLAGS) + +if NOD_ENABLED +pdns_recursor_SOURCES += nod.hh nod.cc +pdns_recursor_LDADD += \ + $(BOOST_FILESYSTEM_LIBS) +pdns_recursor_LDFLAGS += \ + $(BOOST_FILESYSTEM_LDFLAGS) +endif testrunner_SOURCES = \ arguments.cc \ @@ -219,7 +229,6 @@ testrunner_SOURCES = \ mtasker_context.cc \ negcache.hh negcache.cc \ namespaces.hh \ - nod.hh nod.cc \ nsecrecords.cc \ pdnsexception.hh \ opensslsigners.cc opensslsigners.hh \ @@ -252,7 +261,6 @@ testrunner_SOURCES = \ test-mtasker.cc \ test-nmtree.cc \ test-negcache_cc.cc \ - test-nod_cc.cc \ test-rcpgenerator_cc.cc \ test-recpacketcache_cc.cc \ test-recursorcache_cc.cc \ @@ -273,7 +281,6 @@ testrunner_LDFLAGS = \ $(BOOST_CONTEXT_LDFLAGS) \ $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \ $(LIBCRYPTO_LDFLAGS) \ - $(BOOST_FILESYSTEM_LDFLAGS) \ $(BOOST_SYSTEM_LDFLAGS) testrunner_LDADD = \ @@ -281,10 +288,19 @@ testrunner_LDADD = \ $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \ $(LIBCRYPTO_LIBS) \ $(RT_LIBS) \ - $(BOOST_FILESYSTEM_LIBS) \ $(BOOST_SYSTEM_LIBS) \ $(PROBDS_LIBS) +if NOD_ENABLED +testrunner_SOURCES += nod.hh nod.cc \ + test-nod_cc.cc + +testrunner_LDADD += \ + $(BOOST_FILESYSTEM_LIBS) +testrunner_LDFLAGS += \ + $(BOOST_FILESYSTEM_LDFLAGS) +endif + if BOTAN pdns_recursor_SOURCES += \ botansigners.cc diff --git a/pdns/recursordist/configure.ac b/pdns/recursordist/configure.ac index 1c54df3ca1..9fd1fd6851 100644 --- a/pdns/recursordist/configure.ac +++ b/pdns/recursordist/configure.ac @@ -78,8 +78,11 @@ AC_DEFUN([PDNS_SELECT_CONTEXT_IMPL], [ fi ]) -BOOST_FILESYSTEM -AS_IF([test -z "$BOOST_FILESYSTEM_LIBS"], [ AC_MSG_ERROR([Boost filesystem library is not installed])]) +AS_IF([test "x$NOD_ENABLED" != "xn"], + [ + BOOST_FILESYSTEM + AS_IF([test -z "$BOOST_FILESYSTEM_LIBS"], [ AC_MSG_ERROR([Boost filesystem library is not installed])])], + []) PDNS_CHECK_CLOCK_GETTIME diff --git a/pdns/recursordist/m4/pdns_enable_nod.m4 b/pdns/recursordist/m4/pdns_enable_nod.m4 index 8584e3cf64..dbca38d40e 100644 --- a/pdns/recursordist/m4/pdns_enable_nod.m4 +++ b/pdns/recursordist/m4/pdns_enable_nod.m4 @@ -13,5 +13,7 @@ AC_DEFUN([PDNS_ENABLE_NOD],[ [AC_DEFINE([NOD_ENABLED], [1], [Define to 1 if nod is enabled])] ) + AM_CONDITIONAL([NOD_ENABLED], [test "x$enable_nod" != "xno"]) + AC_MSG_RESULT([$enable_nod]) ])