Support building on x86_64
authorSam Hartman <hartmans@mit.edu>
Fri, 10 Sep 2004 23:01:11 +0000 (23:01 +0000)
committerSam Hartman <hartmans@mit.edu>
Fri, 10 Sep 2004 23:01:11 +0000 (23:01 +0000)
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
src/aclocal.m4

index 0ec2e0e61679d999f85e4df48f59126bf79a1c65..6a83fd27ffa2d9d1a9983879db76b4a798eb6de7 100644 (file)
@@ -1,3 +1,12 @@
+2004-09-08  Sam Hartman  <hartmans@krbdev-linux.mit.edu>
+
+       * 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  <tlyu@mit.edu>
 
        * Makefile.in: Install krb5-config manpage.
index 69a0e45ad26ad435f1fe14c9b54a5f2f67573cd3..faad34fa6ea474ddacc2c0aa5602b879f8d9decd 100644 (file)
@@ -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 <resolv.h>])],
+       [#include <resolv.h>])
   fi
-  AC_SUBST(RESOLV_LIB)
   ])
 dnl
 dnl