* aclocal.m4 (AC_LIBRARY_NET): Look for res_search() prototype,
authorTom Yu <tlyu@mit.edu>
Fri, 17 Sep 2004 17:02:53 +0000 (17:02 +0000)
committerTom Yu <tlyu@mit.edu>
Fri, 17 Sep 2004 17:02:53 +0000 (17:02 +0000)
then for symbol in library, in case there's symbol renaming
happening in the headers.  Clean up some style nits.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16766 dc483132-0cff-0310-8789-dd5450dbe970

src/ChangeLog
src/aclocal.m4

index 2d8444f61ed97c577827f1aa68dd1552f72b449c..7e1ff2a60cbfa5ffaef0a36f655d42ab39fc76d8 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-17  Tom Yu  <tlyu@mit.edu>
+
+       * aclocal.m4 (AC_LIBRARY_NET): Look for res_search() prototype,
+       then for symbol in library, in case there's symbol renaming
+       happening in the headers.  Clean up some style nits.
+
 2004-09-15  Tom Yu  <tlyu@mit.edu>
 
        * aclocal.m4 (AC_LIBRARY_NET): Only look for res_search() in
index fc6176bdd585bb9bce7c4f27b799bd2c40940ba9..04e0f8b2108fc5fd270f926221634c84118461c2 100644 (file)
@@ -1358,25 +1358,40 @@ AC_REQUIRE([KRB5_AC_NEED_BIND_8_COMPAT])
     AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl)))
   KRB5_AC_ENABLE_DNS
   if test "$enable_dns" = yes ; then
-    dnl We assume that if libresolv exists we can link against it
-    dnl This may get us a gethostby* that doesn't respect nsswitch
+    # We assume that if libresolv exists we can link against it.
+    # 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_FUNC(res_search, 
-           AC_DEFINE(HAVE_RES_SEARCH,,[Have the res_search function]), 
-           AC_MSG_ERROR(Failed to find resolver search routine),
-           [#include <sys/types.h>
+    krb5_res_search_found=no
+    AC_CHECK_DECL(res_nsearch,
+      [AC_DEFINE(HAVE_RES_NSEARCH, 1, [Have the res_nsearch function])
+krb5_res_search_found=yes], ,
+[[#include <sys/types.h>
 #include <netinet/in.h>
 #include <arpa/nameser.h>
 #include <resolv.h>
-])], [#include <sys/types.h>
+]])
+    if test $krb5_res_search_found != yes; then
+      AC_CHECK_DECL(res_search,
+       [AC_DEFINE(HAVE_RES_SEARCH, 1, [Have the res_search function])
+krb5_res_search_found=yes], ,
+[[#include <sys/types.h>
 #include <netinet/in.h>
 #include <arpa/nameser.h>
 #include <resolv.h>
-])
+]])
+    fi
+    if test $krb5_res_search_found != yes; then
+      AC_CHECK_FUNC(res_search,
+       [AC_DEFINE(HAVE_RES_SEARCH, 1, [Have the res_search function])],
+       [AC_MSG_ERROR(Failed to find resolver search routine)],
+[[#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+]])
+    fi
   fi
-  ])
+])
 dnl
 dnl
 dnl KRB5_AC_ENABLE_DNS