]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Add an option to disable ipcrypt2 w/ autotools
authorRemi Gacogne <remi.gacogne@powerdns.com>
Sun, 1 Feb 2026 16:02:36 +0000 (17:02 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 3 Feb 2026 11:41:46 +0000 (12:41 +0100)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/dnsdistdist/Makefile.am
pdns/dnsdistdist/configure.ac
pdns/dnsdistdist/m4/pdns_enable_ipcrypt2.m4 [new file with mode: 0644]

index 184a86deb12025df106b7fde73f33ba5fc4e3aba..0d04dd216043a23d051c017fb934849a82fb8b2e 100644 (file)
@@ -23,9 +23,12 @@ SUBDIRS=dnsdist-rust-lib \
        dnsdist-rust-lib/rust \
        ext/arc4random \
        ext/ipcrypt \
-       ext/ipcrypt2 \
        ext/yahttp
 
+if HAVE_IPCRYPT2
+SUBDIRS += ext/ipcrypt2
+endif
+
 CLEANFILES = \
        htmlfiles.h.tmp \
        htmlfiles.h \
@@ -455,7 +458,6 @@ dnsdist_LDADD = \
        $(NET_SNMP_LIBS) \
        $(LIBCAP_LIBS) \
        $(IPCRYPT_LIBS) \
-       $(IPCRYPT2_LIBS) \
        $(ARC4RANDOM_LIBS)
 
 testrunner_LDFLAGS = \
@@ -472,7 +474,6 @@ testrunner_LDADD = \
        $(RT_LIBS) \
        $(SYSTEMD_LIBS) \
        $(LIBCAP_LIBS) \
-       $(IPCRYPT2_LIBS) \
        $(ARC4RANDOM_LIBS)
 
 if HAVE_CDB
@@ -505,6 +506,11 @@ testrunner_LDADD += $(LIBCRYPTO_LDFLAGS) $(LIBCRYPTO_LIBS)
 dnsdist_SOURCES += ipcipher.cc ipcipher.hh
 endif
 
+if HAVE_IPCRYPT2
+dnsdist_SOURCES += ext/ipcrypt2/ipcrypt2.c ext/ipcrypt2/include/ipcrypt2.h ext/ipcrypt2/softaes/untrinsics.h
+testrunner_SOURCES += ext/ipcrypt2/ipcrypt2.c ext/ipcrypt2/include/ipcrypt2.h ext/ipcrypt2/softaes/untrinsics.h
+endif
+
 if HAVE_LMDB
 dnsdist_LDADD += $(LMDB_LDFLAGS) $(LMDB_LIBS)
 testrunner_LDADD += $(LMDB_LDFLAGS) $(LMDB_LIBS)
index cd4ac5561c9c929ec5155e3499dad00cfebbd037..b8f223270f3fe0e0270ae8a5d0054e0b6a09532b 100644 (file)
@@ -143,6 +143,7 @@ AS_IF([test "x$enable_yaml" != "xno"], [
 DNSDIST_WITH_CDB
 PDNS_CHECK_LMDB
 PDNS_ENABLE_IPCIPHER
+PDNS_ENABLE_IPCRYPT2
 PDNS_CHECK_AARCH64_UINT64X2_T
 
 AX_CXX_COMPILE_STDCXX_17([noext], [mandatory])
@@ -245,6 +246,10 @@ AS_IF([test "x$HAVE_IPCIPHER" = "x1"],
   [AC_MSG_NOTICE([ipcipher: yes])],
   [AC_MSG_NOTICE([ipcipher: no])]
 )
+AS_IF([test "x$enable_ipcrypt2" != "xno"],
+  [AC_MSG_NOTICE([ipcrypt2: yes])],
+  [AC_MSG_NOTICE([ipcrypt2: no])]
+)
 AS_IF([test "x$LIBEDIT_LIBS" != "x"],
   [AC_MSG_NOTICE([libedit: yes])],
   [AC_MSG_NOTICE([libedit: no])]
diff --git a/pdns/dnsdistdist/m4/pdns_enable_ipcrypt2.m4 b/pdns/dnsdistdist/m4/pdns_enable_ipcrypt2.m4
new file mode 100644 (file)
index 0000000..e4897d9
--- /dev/null
@@ -0,0 +1,14 @@
+AC_DEFUN([PDNS_ENABLE_IPCRYPT2], [
+  AC_MSG_CHECKING([whether to enable ipcrypt2 support])
+  AC_ARG_ENABLE([ipcrypt2],
+    AS_HELP_STRING([--enable-ipcrypt2], [enable ipcrypt2 support @<:@default=yes@:>@]),
+    [enable_ipcrypt2=$enableval],
+    [enable_ipcrypt2=yes]
+  )
+  AC_MSG_RESULT([$enable_ipcrypt2])
+
+  AM_CONDITIONAL([HAVE_IPCRYPT2], [test "x$enable_ipcrypt2" != "xno"])
+  AM_COND_IF([HAVE_IPCRYPT2], [
+    AC_DEFINE([HAVE_IPCRYPT2], [1], [Define to 1 if you enable ipcrypt2 support])
+  ])
+])