From 30b9ebfa2cadef86978f2c2886e16d4fc960f2ed Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 30 Mar 2023 10:49:13 +1100 Subject: [PATCH 1/2] Handle old with old API Define the types and classes we use from the new API. --- bin/tests/system/rpz/testlib/test-data.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bin/tests/system/rpz/testlib/test-data.h b/bin/tests/system/rpz/testlib/test-data.h index d8027f8b27..63ae0f6cca 100644 --- a/bin/tests/system/rpz/testlib/test-data.h +++ b/bin/tests/system/rpz/testlib/test-data.h @@ -31,6 +31,22 @@ #define LIBRPZ_LIB_OPEN 2 #include +#if __NAMESER < 19991006 +/* + * If the new API is not available define the values we use. + */ + +#define ns_c_in 1 + +#define ns_t_invalid 0 +#define ns_t_a 1 +#define ns_t_cname 5 +#define ns_t_txt 16 +#define ns_t_aaaa 28 +#define ns_t_dname 39 + +#endif + #include "trpz.h" #define NODE_FLAG_IPV6_ADDRESS 0x1 From da999a7a1bb217130d646e2a11b845602b4a9ca4 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 3 Apr 2023 16:12:08 +1000 Subject: [PATCH 2/2] Define and use DLOPEN_LIBS --- bin/tests/system/Makefile.am | 2 +- bin/tests/system/rpz/testlib/Makefile.am | 2 +- configure.ac | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/tests/system/Makefile.am b/bin/tests/system/Makefile.am index 380ad49d8e..db30c0ef29 100644 --- a/bin/tests/system/Makefile.am +++ b/bin/tests/system/Makefile.am @@ -66,7 +66,7 @@ rpz_dnsrps_CPPFLAGS = \ rpz_dnsrps_LDADD = \ $(LDADD) \ $(LIBDNS_LIBS) \ - -ldl + $(DLOPEN_LIBS) TESTS = diff --git a/bin/tests/system/rpz/testlib/Makefile.am b/bin/tests/system/rpz/testlib/Makefile.am index ac66f688fa..6e32f9cf98 100644 --- a/bin/tests/system/rpz/testlib/Makefile.am +++ b/bin/tests/system/rpz/testlib/Makefile.am @@ -9,4 +9,4 @@ AM_CFLAGS += -Wall -pedantic check_LTLIBRARIES = libdummyrpz.la libdummyrpz_la_SOURCES= dummylib.c test-data.c trpz.h test-data.h libdummyrpz_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath $(abs_builddir) -LDADD += -lpthread -ldl +LDADD += -lpthread $(DLOPEN_LIBS) diff --git a/configure.ac b/configure.ac index 255dfe10dd..ab9d9f57da 100644 --- a/configure.ac +++ b/configure.ac @@ -108,9 +108,13 @@ AC_PROG_MKDIR_P # Initialize libtool LT_INIT([disable-static dlopen pic-only]) +DLOPEN_LIBS="$lt_cv_dlopen_libs" +AC_SUBST(DLOPEN_LIBS) + AS_IF([test "$enable_static" != "no" && test "$enable_developer" != "yes"], [AC_MSG_ERROR([Static linking is not supported as it disables dlopen() and certain security features (e.g. RELRO, ASLR)])]) + # # Set the default CFLAGS, CPPFLAGS, and LDFLAGS #