]> granicus.if.org Git - pdns/commitdiff
Don't link in readline with everything
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 1 May 2015 14:01:13 +0000 (16:01 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 1 May 2015 16:52:31 +0000 (18:52 +0200)
Closes #2476

configure.ac
m4/pdns_check_readline.m4 [new file with mode: 0644]
pdns/Makefile.am
pdns/dnsdistdist/Makefile.am
pdns/dnsdistdist/configure.ac
pdns/dnsdistdist/populate

index fae08413e14e3dae25f92620187065ed7c3afe35..80a014cbc318119e6452a61bf093e1364700010f 100644 (file)
@@ -113,7 +113,7 @@ AC_CHECK_HEADERS(
 )
 
 
-AX_LIB_READLINE
+PDNS_CHECK_READLINE
 PDNS_CHECK_RAGEL
 PDNS_CHECK_LIBSODIUM
 
diff --git a/m4/pdns_check_readline.m4 b/m4/pdns_check_readline.m4
new file mode 100644 (file)
index 0000000..c9db26c
--- /dev/null
@@ -0,0 +1,12 @@
+AC_DEFUN([PDNS_CHECK_READLINE], [
+  OLD_LIBS="$LIBS"
+  $LIBS=""
+  AX_LIB_READLINE
+  AC_SUBST([READLINE_LIBS], [$LIBS])
+  LIBS="$OLDLIBS"
+  AS_IF([test "$1" = "mandatory"],[
+    AS_IF([test x"$READLINE_LIBS" = "x"],[
+      AC_MSG_ERROR([readline support is mandatory])
+    ])
+  ])
+])
index e1f86e1433e42496e81cd639041d656a20f12741..88af92f456c82b6fcd3ab49d919ec1ccb72bd7bc 100644 (file)
@@ -585,7 +585,7 @@ dnsdist_LDFLAGS = \
        $(AM_LDFLAGS) 
 
 dnsdist_LDADD = \
-       -lreadline -lrt \
+       $(READLINE_LIBS) -lrt \
        $(LUA_LIBS) ${LIBSODIUM_LIBS} $(YAHTTP_LIBS)
 
 nsec3dig_SOURCES = \
index 8e5c01a1116ea8924141a6ebfb8d7bf763ef683d..d1fb73a638bcbe47fa0d313dc4ce2b65f48772d6 100644 (file)
@@ -55,6 +55,6 @@ dnsdist_LDFLAGS = \
        -pthread 
 
 dnsdist_LDADD = \
-       -lreadline -lrt \
+       $(READLINE_LIBS) -lrt \
        $(LUA_LIBS) $(YAHTTP_LIBS) ${LIBSODIUM_LIBS}
 
index 7d3d66dc6a34ef03c173551f7afda74e7725b533..305970dc0609dc36f0125c8a2545faf7a7e884df 100644 (file)
@@ -7,7 +7,7 @@ AC_PROG_CC
 AC_PROG_CXX
 PDNS_CHECK_LIBSODIUM
 AC_PROG_LIBTOOL
-AX_LIB_READLINE
+PDNS_CHECK_READLINE([mandatory])
 BOOST_REQUIRE([1.35])
 BOOST_FOREACH
 AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
index 997bd5fb59e973d755ca8308e39d2747875120cd..d79fca18d68384cd8971b9ff553f2f7870e06047 100755 (executable)
@@ -11,6 +11,7 @@ ln -fs ../base32.hh ../base64.hh ../dnsdist.cc ../dnsdist.hh ../dnsdist-lua.cc .
 
 mkdir m4
 ln -fs ../../../m4/pdns_check_libsodium.m4 m4/
+ln -fs ../../../m4/pdns_check_readline.m4 m4/
 ln -fs ../../../m4/ax_lib_readline.m4 m4/
 ln -fs ../../../m4/boost.m4 m4/
 ln -fs ../../../m4/pdns_with_lua.m4 m4/