]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Add a specialized check for resolv.h. Thanks to Gerrit P. Haase,
authorStepan Kasal <kasal@ucw.cz>
Fri, 17 Dec 2004 14:32:51 +0000 (14:32 +0000)
committerStepan Kasal <kasal@ucw.cz>
Fri, 17 Dec 2004 14:32:51 +0000 (14:32 +0000)
Reini Urban and Paul Eggert for reporting the dependencies.

* lib/autoconf/headers.m4 (AC_HEADER_RESOLV): New macro.
* doc/autoconf.texi (AC_HEADER_RESOLV): Document it.
(AC_HEADER_STAT): @cvindex{STAT_MACROS_BROKEN}, not @acindex.

ChangeLog
doc/autoconf.texi
lib/autoconf/headers.m4

index 30eb287206f450da76118074276eed837d70f28f..6e0402ccd89d9bf48c4386cb8fc99c9291b713a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-12-17  Stepan Kasal  <kasal@ucw.cz>
+
+       Add a specialized check for resolv.h.  Thanks to Gerrit P. Haase,
+       Reini Urban and Paul Eggert for reporting the dependencies.
+
+       * lib/autoconf/headers.m4 (AC_HEADER_RESOLV): New macro.
+       * doc/autoconf.texi (AC_HEADER_RESOLV): Document it.
+       (AC_HEADER_STAT): @cvindex{STAT_MACROS_BROKEN}, not @acindex.
+
 2004-12-17  Stepan Kasal  <kasal@ucw.cz>
 
        * bin/autoscan.in: Open autoscan.log only after ``parse_args'';
index 76055c27f435abedddb1216fcb3122743b87792c..6a23a61923715a1a5bffa27022bc1ee5425325de 100644 (file)
@@ -4759,10 +4759,34 @@ If @file{sys/types.h} does not define @code{major}, @code{minor}, and
 @code{MAJOR_IN_SYSMACROS}.
 @end defmac
 
+@defmac AC_HEADER_RESOLV
+@acindex{HEADER_RESOLV}
+@cvindex HAVE_RESOLV_H
+@hdrindex{resolv.h}
+Checks for header @file{resolv.h}, checking for prerequisities first.
+To properly use @file{resolv.h}, your code should contain something like
+the following:
+
+@verbatim
+#if HAVE_SYS_TYPES_H
+#  include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#  include <netinet/in.h>   /* inet_ functions / structs */
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#  include <arpa/nameser.h> /* DNS HEADER struct */
+#endif
+#ifdef HAVE_NETDB_H
+#  include <netdb.h>
+#endif
+#include <resolv.h>
+@end verbatim
+@end defmac
 
 @defmac AC_HEADER_STAT
 @acindex{HEADER_STAT}
-@acindex{STAT_MACROS_BROKEN}
+@cvindex STAT_MACROS_BROKEN
 @hdrindex{sys/stat.h}
 If the macros @code{S_ISDIR}, @code{S_ISREG}, etc.@: defined in
 @file{sys/stat.h} do not work properly (returning false positives),
index 13edf945fbe68463d85617d9b822694717e3f5cb..b1ec24bef619e80f6dff5ab2cb24789ca422bc3b 100644 (file)
@@ -440,6 +440,33 @@ fi
 ])# AC_HEADER_MAJOR
 
 
+# AC_HEADER_RESOLV
+# ----------------
+# According to http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?resolver+3
+# (or http://www.chemie.fu-berlin.de/cgi-bin/man/sgi_irix?resolver+3),
+# sys/types.h, netinet/in.h and arpa/nameser.h are required on IRIX.
+# netinet/in.h is needed on Cygwin, too.
+# With Solaris 9, netdb.h is required, to get symbols like HOST_NOT_FOUND.
+#
+AN_HEADER(resolv.h,    [AC_HEADER_RESOLV])
+AC_DEFUN([AC_HEADER_RESOLV],
+[AC_CHECK_HEADERS(sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h,
+                 [], [],
+[[#if HAVE_SYS_TYPES_H
+#  include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#  include <netinet/in.h>   /* inet_ functions / structs */
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#  include <arpa/nameser.h> /* DNS HEADER struct */
+#endif
+#ifdef HAVE_NETDB_H
+#  include <netdb.h>
+#endif]])
+])# AC_HEADER_RESOLV
+
+
 # AC_HEADER_STAT
 # --------------
 # FIXME: Shouldn't this be named AC_HEADER_SYS_STAT?