From fd7ff1d74136c674bc1a63bafe59ae926370fed1 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Fri, 10 Sep 2004 23:01:11 +0000 Subject: [PATCH] Support building on x86_64 Include resolv.h when looking for res_nsearch and res_search. Ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16741 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ChangeLog | 9 +++++++++ src/aclocal.m4 | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0ec2e0e61..6a83fd27f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2004-09-08 Sam Hartman + + * aclocal.m4 : Remove use of resolv_lib; none of the makefiles + actually use it and if we don't set it we can simplify the DNS + tests significantly. If the -lresolv library exists we use it. + This may create a bit of a problem for people with nsswitch + configurations that don't prefer dns. We include resolv.h before + checking for res_*. + 2004-09-08 Tom Yu * Makefile.in: Install krb5-config manpage. diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 69a0e45ad..faad34fa6 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -1348,7 +1348,7 @@ AC_DEFUN(AC_LIBRARY_NET, [ AC_CHECK_LIB(socket, gethostbyname, LIBS="-lsocket -lnsl $LIBS", [AC_CHECK_LIB(resolv, gethostbyname, - LIBS="-lresolv $LIBS" ; RESOLV_LIB=-lresolv)], + LIBS="-lresolv $LIBS" )], -lnsl) ]) ]) @@ -1357,16 +1357,16 @@ AC_DEFUN(AC_LIBRARY_NET, [ AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))) KRB5_AC_ENABLE_DNS if test "$enable_dns" = yes ; then - AC_CHECK_FUNC(res_nsearch, , [AC_CHECK_LIB(resolv, res_nsearch, - [LIBS="$LIBS -lresolv" ; RESOLV_LIB=-lresolv - AC_DEFINE(HAVE_RES_NSEARCH,1,[Define if BIND 8 routine res_nsearch is available]) - ], - [AC_CHECK_FUNC(res_search, , AC_CHECK_LIB(resolv, res_search, - LIBS="$LIBS -lresolv" ; RESOLV_LIB=-lresolv, - AC_MSG_ERROR(Cannot find resolver support routine res_search in -lresolv.) - ))])]) + dnl We assume that if libresolv exists we can link against it + dnl This may get us a gethostby* that doesn't respect nsswitch + AC_CHECK_LIB(resolv, main) + AC_CHECK_DECL(res_nsearch, + AC_DEFINE(HAVE_RES_NSEARCH,,[Have the RES_NSEARCH function]), + [AC_CHECK_DECL(res_search, + AC_DEFINE(HAVE_RES_SEARCH,,[Have the res_search function]), + AC_MSG_ERROR(Failed to find resolver search routine), [#include ])], + [#include ]) fi - AC_SUBST(RESOLV_LIB) ]) dnl dnl -- 2.26.2