2004-12-03 Stepan Kasal 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. Index: doc/autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.846 diff -u -r1.846 autoconf.texi --- doc/autoconf.texi 29 Nov 2004 21:43:11 -0000 1.846 +++ doc/autoconf.texi 3 Dec 2004 09:43:08 -0000 @@ -4750,10 +4750,34 @@ @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 +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +#include +@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: lib/autoconf/headers.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/headers.m4,v retrieving revision 1.41 diff -u -r1.41 headers.m4 --- lib/autoconf/headers.m4 1 Jun 2004 05:33:28 -0000 1.41 +++ lib/autoconf/headers.m4 3 Dec 2004 09:43:08 -0000 @@ -440,6 +440,32 @@ ])# AC_HEADER_MAJOR +# AC_HEADER_RESOLV +# ---------------- +# According to http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?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 +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif]]) +])# AC_HEADER_RESOLV + + # AC_HEADER_STAT # -------------- # FIXME: Shouldn't this be named AC_HEADER_SYS_STAT?