try autoreconfing our way to a happier AC_CHECK_LIB

This commit is contained in:
Nalin Dahyabhai 2006-03-30 22:26:55 +00:00
parent d0a5f0000b
commit 1df83267bd
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,17 @@
Try to correctly find res_mkquery in libresolv, even in cases where a
preprocessor-based rename in <resolv.h> may screw us up.
--- hesiod-3.1.0/configure.in 2006-03-30 11:22:11.000000000 -0500
+++ hesiod-3.1.0/configure.in 2006-03-30 13:31:02.000000000 -0500
@@ -12,7 +12,11 @@
AC_EGREP_HEADER(pw_change, pwd.h, AC_DEFINE(HAVE_PW_CHANGE))
AC_EGREP_HEADER(pw_expire, pwd.h, AC_DEFINE(HAVE_PW_EXPIRE))
-AC_CHECK_FUNC(res_mkquery, :, [AC_CHECK_LIB(resolv, res_mkquery)])
+AC_CHECK_FUNC(res_mkquery, :, [AC_CHECK_LIB(resolv, res_mkquery,,[
+saveLIBS="$LIBS"
+LIBS="-lresolv $LIBS"
+AC_TRY_LINK([#include <resolv.h>],[res_mkquery(0,NULL,0,0,NULL,0,NULL,NULL,0);],[AC_DEFINE(HAVE_RES_MKQUERY,1,[Define if your libresolv provides res_mkquery.])],[LIBS="$saveLIBS"])
+])])
AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)

View File

@ -10,6 +10,7 @@ Summary: Hesiod libraries.
Group: System Environment/Libraries
License: MIT
Buildroot: %{_tmppath}/hesiod-root
BuildRequires: autoconf, automake, libtool
%description
Hesiod is a system which uses existing DNS functionality to provide access
@ -156,6 +157,7 @@ the header files and libraries required for building programs which use Hesiod.
%patch1 -p1 -b .env
%patch2 -p1 -b .str
%patch3 -p1 -b .dnsparse
autoreconf
%build
%configure