]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Properly handle JEMALLOC_* Autoconf variables
authorMichał Kępień <michal@isc.org>
Tue, 12 Oct 2021 08:44:30 +0000 (10:44 +0200)
committerMichał Kępień <michal@isc.org>
Tue, 12 Oct 2021 08:44:30 +0000 (10:44 +0200)
The AX_CHECK_JEMALLOC() m4 macro sets the JEMALLOC_CFLAGS variable, not
JEMALLOC_CPPFLAGS.  Furthermore, the JEMALLOC_CFLAGS and JEMALLOC_LIBS
variables should only be included in the build flags if jemalloc was
successfully configured.  Tweak lib/isc/Makefile.am accordingly.

configure.ac
lib/isc/Makefile.am

index e68e78b1cc731f25174bc89b066f5a1374cc2d92..543ed9ba195e26e5e8543eda6c4a5a034f4703f5 100644 (file)
@@ -1338,6 +1338,8 @@ AS_CASE([$with_jemalloc],
 AS_IF([test "$with_jemalloc" = "no"],
       [AC_CHECK_FUNCS([malloc_size malloc_usable_size])])
 
+AM_CONDITIONAL([HAVE_JEMALLOC], [test "$with_jemalloc" = "yes"])
+
 #
 # was --with-tuning specified?
 #
index 521ed9e2667249bca16f9c7e48df272dba39a4a5..3ee7cc2fa98166cdcb82c35dc4f0a1bb4a2a66dd 100644 (file)
@@ -212,7 +212,6 @@ libisc_la_SOURCES =         \
 
 libisc_la_CPPFLAGS =           \
        $(AM_CPPFLAGS)          \
-       $(JEMALLOC_CPPFLAGS)    \
        $(LIBISC_CFLAGS)        \
        $(LIBUV_CFLAGS)         \
        $(OPENSSL_CFLAGS)       \
@@ -223,22 +222,17 @@ libisc_la_LDFLAGS =               \
        -release "$(PACKAGE_VERSION)"
 
 libisc_la_LIBADD =             \
-       $(JEMALLOC_LIBS)        \
        $(LIBUV_LIBS)           \
        $(OPENSSL_LIBS)         \
        $(ZLIB_LIBS)
 
-if HAVE_LIBNGHTTP2
-libisc_la_SOURCES +=           \
-       netmgr/http.c           \
-       netmgr/tlsstream.c
-
+if HAVE_JEMALLOC
 libisc_la_CPPFLAGS +=          \
-       $(LIBNGHTTP2_CFLAGS)
+       $(JEMALLOC_CFLAGS)
 
 libisc_la_LIBADD +=            \
-       $(LIBNGHTTP2_LIBS)
-endif
+       $(JEMALLOC_LIBS)
+endif HAVE_JEMALLOC
 
 if HAVE_JSON_C
 libisc_la_CPPFLAGS +=          \
@@ -248,6 +242,18 @@ libisc_la_LIBADD +=                \
        $(JSON_C_LIBS)
 endif HAVE_JSON_C
 
+if HAVE_LIBNGHTTP2
+libisc_la_SOURCES +=           \
+       netmgr/http.c           \
+       netmgr/tlsstream.c
+
+libisc_la_CPPFLAGS +=          \
+       $(LIBNGHTTP2_CFLAGS)
+
+libisc_la_LIBADD +=            \
+       $(LIBNGHTTP2_LIBS)
+endif
+
 if HAVE_LIBXML2
 libisc_la_CPPFLAGS +=          \
        $(LIBXML2_CFLAGS)