From 91f44dc0aadb90ae73a340bcb6e1187ba8d13403 Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Thu, 3 Jun 2004 21:25:53 +0000 Subject: [PATCH] Better detection of the resolv library --- SRC/plugins/dns/Makefile.am | 2 +- SRC/plugins/dns/configure.ac | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SRC/plugins/dns/Makefile.am b/SRC/plugins/dns/Makefile.am index eb008fd..7da8ae4 100644 --- a/SRC/plugins/dns/Makefile.am +++ b/SRC/plugins/dns/Makefile.am @@ -1,6 +1,6 @@ if DNSBUILD pkglib_LTLIBRARIES = dns.la dns_la_SOURCES = dns.c -dns_la_LDFLAGS = -module -lresolv +dns_la_LDFLAGS = -module endif diff --git a/SRC/plugins/dns/configure.ac b/SRC/plugins/dns/configure.ac index d15b9d5..5110c4d 100644 --- a/SRC/plugins/dns/configure.ac +++ b/SRC/plugins/dns/configure.ac @@ -15,11 +15,13 @@ dnl Some Unices has res_init but has it renamed in libc as something else so we dnl must include to get the redefinition. (Stolen from rsync) dnl autoconf AC_CHECK_FUNCS does not allow headers to be easily included :-( [AC_MSG_CHECKING([$ac_func again by including ]) - LIBS=-lresolv AC_TRY_LINK([#include + AC_TRY_LINK([#include ], [$ac_func();], [AC_MSG_RESULT([yes])], - [AC_MSG_WARN([No DNS resolver development environment found, not building this plugin]) && DNS_BUILD=0] + [AC_MSG_CHECKING([$ac_func again by using -lresolv]) + LIBS=-lresolv AC_CHECK_FUNCS($ac_func,, + [AC_MSG_WARN([No DNS resolver development environment found, not building this plugin]) && DNS_BUILD=0])] )]) fi