From e011b32bcca2db199aa71e256a46929ce76c90ef Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Fri, 9 Mar 2007 15:57:24 +0000 Subject: [PATCH] Better detection of res_mkquery (it failed on 64bits machines) --- SRC/plugins/dns/configure.ac | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/SRC/plugins/dns/configure.ac b/SRC/plugins/dns/configure.ac index 5e92073..0b0e5b2 100644 --- a/SRC/plugins/dns/configure.ac +++ b/SRC/plugins/dns/configure.ac @@ -10,10 +10,24 @@ DNS_BUILD=1 AC_CHECK_FUNCS(poptGetContext,, [AC_CHECK_LIB(popt,poptGetContext,,[AC_MSG_WARN([No popt development environment found, not building this plugin]) && DNS_BUILD=0])]) if test "$DNS_BUILD" != "0"; then + AC_CHECK_FUNC(res_mkquery, , [AC_CHECK_LIB(bind, res_mkquery, , [AC_CHECK_LIB(resolv, res_mkquery, , - [AC_MSG_WARN([No DNS resolver development environment found, not building this plugin]) && DNS_BUILD=0])])]) +dnl http://bugs.debian.org/254089 + [ saved_LIBS="$LIBS" + LIBS="$LIBS -lresolv" + AC_MSG_CHECKING(for res_mkquery in -lresolv again) + AC_LINK_IFELSE([[ +#include +int main() +{ + res_mkquery (0, 0, 0, 0, 0, 0, 0, 0, 0); + return 0; +}]], + LIBS="$saved_LIBS -lresolv"; AC_MSG_RESULT(yes), + LIBS="$saved_LIBS"; AC_MSG_RESULT(no) + [AC_MSG_WARN([No DNS resolver development environment found, not building this plugin]) && DNS_BUILD=0])])])]) fi AC_MSG_CHECKING([_res ])