searches for botan includes in the wrong place, patch to properly use pkg-config #555

Closed
Habbie opened this Issue Apr 26, 2013 · 1 comment

Projects

None yet

1 participant

@Habbie
Member
Habbie commented Apr 26, 2013

Hi,

darix' patch on Habbie/powerdns#47 makes PowerDNS properly use pkg-config to pull in botan, which allows building on Debian with botan.

Greetings
Marc

diff --git a/configure.ac b/configure.ac
index 6751a77..1a89478 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,6 +183,21 @@ AC_ARG_ENABLE(cryptopp,
 AC_MSG_RESULT($enable_cryptopp)
 AM_CONDITIONAL(CRYPTOPP,test x"$enable_cryptopp" = "xyes")

+if test "x$enable_botan110" = "xyes"
+then
+   PKG_CHECK_MODULES(BOTAN110, botan-1.10, HAVE_BOTAN110=yes, AC_MSG_ERROR([+Could not find botan 1.10]))
+        AC_SUBST(BOTAN110_LIBS)
+        AC_SUBST(BOTAN110_CFLAGS)
+        AC_DEFINE(HAVE_BOTAN110,1,[If we have botan 1.10])
+fi
+
+if test "x$enable_botan18" = "xyes"
+then
+   PKG_CHECK_MODULES(BOTAN18, botan-1.8, HAVE_BOTAN18=yes, AC_MSG_ERROR([+Could not find botan 1.8]))
+        AC_SUBST(BOTAN18_LIBS)
+        AC_SUBST(BOTAN18_CFLAGS)
+        AC_DEFINE(HAVE_BOTAN18,1,[If we have botan 1.8])
+fi

 AC_MSG_CHECKING(whether we should build static binaries)

diff --git a/pdns/Makefile.am b/pdns/Makefile.am
index 3bca54f..f819ffc 100644
--- a/pdns/Makefile.am
+++ b/pdns/Makefile.am
@@ -53,16 +53,19 @@ ednssubnet.cc ednssubnet.hh cachecleaner.hh dnslabel.hh dnslabel.cc
 #
 pdns_server_LDFLAGS=@moduleobjects@ @modulelibs@ @DYNLINKFLAGS@ @LIBDL@ @THREADFLAGS@  $(BOOST_SERIALIZATION_LDFLAGS)  -rdynamic
 pdns_server_LDADD= ext/polarssl-1.1.2/library/libpolarssl.a $(BOOST_SERIALIZATION_LIBS) $(LUA_LIBS) $(SQLITE3_LIBS)
+pdns_server_CPPFLAGS =


 if BOTAN110
 pdns_server_SOURCES += botan110signers.cc botansigners.cc
-pdns_server_LDADD += -lbotan-1.10 -lgmp
+pdns_server_LDADD += $(BOTAN110_LIBS) -lgmp
+pdns_server_CPPFLAGS += $(BOTAN110_CFLAGS)
 endif

 if BOTAN18
 pdns_server_SOURCES += botan18signers.cc botansigners.cc
-pdns_server_LDADD += -lbotan -lgmp
+pdns_server_LDADD += $(BOTAN18_LIBS) -lgmp
+pdns_server_CPPFLAGS += $(BOTAN18_CFLAGS)
 endif

 if CRYPTOPP
@@ -88,15 +91,18 @@ pdnssec_SOURCES=pdnssec.cc dbdnsseckeeper.cc sstuff.hh dnsparser.cc dnsparser.hh

 pdnssec_LDFLAGS=@moduleobjects@ @modulelibs@ @DYNLINKFLAGS@ @LIBDL@ @THREADFLAGS@  $(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS)
 pdnssec_LDADD= ext/polarssl-1.1.2/library/libpolarssl.a $(BOOST_PROGRAM_OPTIONS_LIBS) $(BOOST_SERIALIZATION_LIBS) $(SQLITE3_LIBS)
+pdnssec_CPPFLAGS=

 if BOTAN110
 pdnssec_SOURCES += botan110signers.cc botansigners.cc
-pdnssec_LDADD += -lbotan-1.10 -lgmp
+pdnssec_LDADD += $(BOTAN110_LIBS) -lgmp
+pdnssec_CPPFLAGS += $(BOTAN110_CFLAGS)
 endif

 if BOTAN18
 pdnssec_SOURCES += botan18signers.cc botansigners.cc
-pdnssec_LDADD += -lbotan -lgmp
+pdnssec_LDADD += $(BOTAN18_LIBS) -lgmp
+pdnssec_CPPFLAGS += $(BOTAN18_CFLAGS)
 endif

 if CRYPTOPP
@Habbie Habbie was assigned Apr 26, 2013
@Habbie Habbie closed this Apr 26, 2013
@Habbie
Member
Habbie commented Apr 26, 2013

Author: peter
committed in r2696

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment