]> granicus.if.org Git - pdns/commitdiff
Build ipcrypt as a separate (static) library since it's written in C
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 12 Feb 2019 15:14:29 +0000 (16:14 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 25 Mar 2019 09:23:26 +0000 (10:23 +0100)
Otherwise we could compile it as C++ code, leading to this warning
from the compiler:

```
cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C
```

configure.ac
ext/Makefile.am
ext/ipcrypt/.gitignore [new file with mode: 0644]
ext/ipcrypt/Makefile.am [new file with mode: 0644]
pdns/Makefile.am
pdns/dnsdistdist/Makefile.am
pdns/dnsdistdist/configure.ac
pdns/dnsdistdist/ext/ipcrypt/Makefile.am [new symlink]

index 8ac60b12c51fdcc345e5ac25d43e5d17ad58f99f..1993f3cd9bb26005aa566d373654f3927a4f05bb 100644 (file)
@@ -297,6 +297,8 @@ AC_SUBST([AM_CPPFLAGS],
 
 AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
 AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'])
+AC_SUBST([IPCRYPT_CFLAGS], ['-I$(top_srcdir)/ext/ipcrypt'])
+AC_SUBST([IPCRYPT_LIBS], ['$(top_builddir)/ext/ipcrypt/libipcrypt.la'])
 
 CXXFLAGS="$SANITIZER_FLAGS $CXXFLAGS"
 
@@ -315,6 +317,7 @@ AC_CONFIG_FILES([
   docs/Makefile
   pdns/pdns.init
   ext/Makefile
+  ext/ipcrypt/Makefile
   ext/yahttp/Makefile
   ext/yahttp/yahttp/Makefile
   ext/json11/Makefile
index 49dc5a219216ad3860bb46a49888ee0f280db098..7c0a42d4199fc6feaaaf3168da99b1e499b1e689 100644 (file)
@@ -1,10 +1,12 @@
 SUBDIRS = \
-       yahttp \
-        json11
+       ipcrypt \
+       json11 \
+       yahttp
 
 DIST_SUBDIRS = \
-       yahttp \
-        json11
+       ipcrypt \
+       json11 \
+       yahttp
 
 EXTRA_DIST = \
        luawrapper/include/LuaContext.hpp
diff --git a/ext/ipcrypt/.gitignore b/ext/ipcrypt/.gitignore
new file mode 100644 (file)
index 0000000..24ad051
--- /dev/null
@@ -0,0 +1,5 @@
+*.la
+*.lo
+*.o
+Makefile
+Makefile.in
diff --git a/ext/ipcrypt/Makefile.am b/ext/ipcrypt/Makefile.am
new file mode 100644 (file)
index 0000000..a68b2d4
--- /dev/null
@@ -0,0 +1,5 @@
+noinst_LTLIBRARIES = libipcrypt.la
+
+libipcrypt_la_SOURCES = \
+       ipcrypt.c \
+       ipcrypt.h
index e1b6e1b20733963659e4e170e84ff7322a9b5965..3614fb9250a4eab1c0acfb663cb4f5b388273078 100644 (file)
@@ -312,7 +312,7 @@ pdnsutil_SOURCES = \
        ednsoptions.cc ednsoptions.hh \
        ednssubnet.cc \
        gss_context.cc gss_context.hh \
-       ipcipher.cc ipcipher.hh ../ext/ipcrypt/ipcrypt.c ../ext/ipcrypt/ipcrypt.h \
+       ipcipher.cc ipcipher.hh \
        iputils.cc iputils.hh \
        json.cc \
        logger.cc \
@@ -350,7 +350,8 @@ pdnsutil_LDADD = \
        $(JSON11_LIBS) \
        $(LIBDL) \
        $(BOOST_PROGRAM_OPTIONS_LIBS) \
-       $(LIBCRYPTO_LIBS)
+       $(LIBCRYPTO_LIBS) \
+       $(IPCRYPT_LIBS)
 
 if LIBSODIUM
 pdnsutil_SOURCES += sodiumsigners.cc
@@ -888,7 +889,7 @@ dnswasher_SOURCES = \
        dnspcap.cc dnspcap.hh \
        dnswasher.cc \
        dnswriter.hh \
-       ipcipher.cc ipcipher.hh ../ext/ipcrypt/ipcrypt.c ../ext/ipcrypt/ipcrypt.h \
+       ipcipher.cc ipcipher.hh \
        logger.cc \
        misc.cc \
        qtype.cc \
@@ -896,7 +897,7 @@ dnswasher_SOURCES = \
        unix_utility.cc
 
 dnswasher_LDFLAGS =    $(AM_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(LIBCRYPTO_LDFLAGS)
-dnswasher_LDADD =      $(BOOST_PROGRAM_OPTIONS_LIBS) $(LIBCRYPTO_LIBS)
+dnswasher_LDADD =      $(BOOST_PROGRAM_OPTIONS_LIBS) $(LIBCRYPTO_LIBS) $(IPCRYPT_LIBS)
 
 dnsbulktest_SOURCES = \
        base32.cc \
@@ -1277,7 +1278,7 @@ testrunner_SOURCES = \
        ednssubnet.cc \
        gettime.cc gettime.hh \
        gss_context.cc gss_context.hh \
-       ipcipher.cc ipcipher.hh ../ext/ipcrypt/ipcrypt.c ../ext/ipcrypt/ipcrypt.h \
+       ipcipher.cc ipcipher.hh \
        iputils.cc \
        ixfr.cc ixfr.hh \
        logger.cc \
@@ -1339,7 +1340,8 @@ testrunner_LDADD = \
        $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \
        $(RT_LIBS) \
        $(LUA_LIBS) \
-       $(LIBDL)
+       $(LIBDL) \
+       $(IPCRYPT_LIBS)
 
 if PKCS11
 testrunner_SOURCES += pkcs11signers.cc pkcs11signers.hh
index 8eb3f18eb832b0b5f416b841241c400f6d56487a..557ef33c6262e0f5a07348570bdd405ae4b7d6d1 100644 (file)
@@ -2,7 +2,8 @@ AM_CPPFLAGS += $(SYSTEMD_CFLAGS) $(LUA_CFLAGS) $(LIBEDIT_CFLAGS) $(LIBSODIUM_CFL
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS=ext/yahttp
+SUBDIRS=ext/ipcrypt \
+       ext/yahttp
 
 CLEANFILES = \
        dnsmessage.pb.cc \
@@ -165,7 +166,8 @@ dnsdist_LDADD = \
        $(SANITIZER_FLAGS) \
        $(SYSTEMD_LIBS) \
        $(NET_SNMP_LIBS) \
-       $(LIBCAP_LIBS)
+       $(LIBCAP_LIBS) \
+       $(IPCRYPT_LIBS)
 
 if HAVE_RE2
 dnsdist_LDADD += $(RE2_LIBS)
@@ -173,7 +175,7 @@ endif
 
 if HAVE_LIBCRYPTO
 dnsdist_LDADD += $(LIBCRYPTO_LIBS)
-dnsdist_SOURCES += ipcipher.cc ipcipher.hh ext/ipcrypt/ipcrypt.c ext/ipcrypt/ipcrypt.h
+dnsdist_SOURCES += ipcipher.cc ipcipher.hh
 endif
 
 if HAVE_DNS_OVER_TLS
index a65ea40d7a26fb122ad101816bd0f0d9b9424ffa..743784573b5e764a54515565e60c71fc8953c579 100644 (file)
@@ -51,6 +51,8 @@ AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ])
 
 AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
 AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'])
+AC_SUBST([IPCRYPT_CFLAGS], ['-I$(top_srcdir)/ext/ipcrypt'])
+AC_SUBST([IPCRYPT_LIBS], ['$(top_builddir)/ext/ipcrypt/libipcrypt.la'])
 
 PDNS_WITH_LUA([mandatory])
 PDNS_CHECK_LUA_HPP
@@ -110,8 +112,9 @@ AS_IF([test "x$PACKAGEVERSION" != "x"],
 )
 
 AC_CONFIG_FILES([Makefile
-       ext/yahttp/Makefile
-       ext/yahttp/yahttp/Makefile])
+        ext/yahttp/Makefile
+        ext/yahttp/yahttp/Makefile
+        ext/ipcrypt/Makefile])
 
 AC_OUTPUT
 
diff --git a/pdns/dnsdistdist/ext/ipcrypt/Makefile.am b/pdns/dnsdistdist/ext/ipcrypt/Makefile.am
new file mode 120000 (symlink)
index 0000000..8111f1d
--- /dev/null
@@ -0,0 +1 @@
+../../../../ext/ipcrypt/Makefile.am
\ No newline at end of file