2004-10-27 Stepan Kasal * 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. Thanks to Gerrit P. Haase and Reini Urban for pointing this out. Index: doc/autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.837 diff -u -r1.837 autoconf.texi --- doc/autoconf.texi 11 Oct 2004 21:42:06 -0000 1.837 +++ doc/autoconf.texi 27 Oct 2004 07:35:59 -0000 @@ -4740,10 +4740,34 @@ @code{MAJOR_IN_SYSMACROS}. @end defmac address@hidden AC_HEADER_RESOLV address@hidden address@hidden HAVE_RESOLV_H address@hidden +Checks for header @file{resolv.h}, checking for prerequisities first. +To properly use @file{resolv.h}, your code should contain something like +the following: + address@hidden +#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_SYS_SOCKET_H +# include /* DNS HEADER struct */ +#endif +#include address@hidden verbatim address@hidden defmac @defmac AC_HEADER_STAT @acindex{HEADER_STAT} address@hidden address@hidden @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 27 Oct 2004 07:57:09 -0000 @@ -440,6 +440,35 @@ ])# AC_HEADER_MAJOR +# AC_HEADER_RESOLV +# ---------------- +AN_HEADER(resolv.h, [AC_HEADER_RESOLV]) +AC_DEFUN([AC_HEADER_RESOLV], +[AC_CHECK_HEADERS(sys/types.h netinet/in.h arpa/nameser.h sys/socket.h) +AC_CACHE_CHECK(for resolv.h, + ac_cv_header_resolv_h, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#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_SYS_SOCKET_H +# include /* DNS HEADER struct */ +#endif]])], + ac_cv_header_resolv_h=yes, + ac_cv_header_resolv_h=no)]) +if test $ac_cv_header_resolv_h = yes; then + AC_DEFINE(HAVE_RESOLV_H, 1, + [Define to 1 if you have the header file.]) +fi +])# AC_HEADER_RESOLV + + # AC_HEADER_STAT # -------------- # FIXME: Shouldn't this be named AC_HEADER_SYS_STAT?