Well, for a start I'm applying this part of my patch. I don't think we need to debate about it, it is straight forward. Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * acheaders.m4 (AC_CHECK_HEADER, AC_CHECK_HEADERS): Support $4 = INCLUDES. Index: NEWS =================================================================== RCS file: /cvs/autoconf/NEWS,v retrieving revision 1.152 diff -u -u -r1.152 NEWS --- NEWS 2001/06/12 14:46:13 1.152 +++ NEWS 2001/06/13 07:37:59 @@ -8,6 +8,10 @@ - configure accepts --prefix='' again. - AC_CHECK_LIB works properly when its first argument is not a literal. + +** Generic macros +- AC_CHECK_HEADER and AC_CHECK_HEADERS support a fourth argument to + specify pre-includes. * Major changes in Autoconf 2.50 Index: acheaders.m4 =================================================================== RCS file: /cvs/autoconf/acheaders.m4,v retrieving revision 1.9 diff -u -u -r1.9 acheaders.m4 --- acheaders.m4 2001/06/12 14:46:13 1.9 +++ acheaders.m4 2001/06/13 07:37:59 @@ -60,12 +60,15 @@ ## 1. Generic tests for headers. ## ## ------------------------------ ## -# AC_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ---------------------------------------------------------------------- +# AC_CHECK_HEADER(HEADER-FILE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], +# [INCLUDES]) +# --------------------------------------------------------- AC_DEFUN([AC_CHECK_HEADER], [AS_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl AC_CACHE_CHECK([for $1], ac_Header, - [AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@include <$1>])], + [AC_PREPROC_IFELSE([AC_LANG_SOURCE([m4_n([$4])dnl +@%:@include <$1>])], [AS_VAR_SET(ac_Header, yes)], [AS_VAR_SET(ac_Header, no)])]) AS_IF([test AS_VAR_GET(ac_Header) = yes], [$2], [$3])[]dnl @@ -83,6 +86,7 @@ # AC_CHECK_HEADERS(HEADER-FILE... # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# [INCLUDES]) # ---------------------------------------------------------- AC_DEFUN([AC_CHECK_HEADERS], [AH_CHECK_HEADERS([$1])dnl @@ -90,7 +94,8 @@ do AC_CHECK_HEADER($ac_header, [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$ac_header)) $2], - [$3])dnl + [$3], + [$4])dnl done ]) Index: doc/autoconf.texi =================================================================== RCS file: /cvs/autoconf/doc/autoconf.texi,v retrieving revision 1.463 diff -u -u -r1.463 autoconf.texi --- doc/autoconf.texi 2001/06/12 14:46:13 1.463 +++ doc/autoconf.texi 2001/06/13 07:38:03 @@ -3860,15 +3860,20 @@ as well as find out whether it is present, you have to write your own test for it (@pxref{Writing Tests}). -@defmac AC_CHECK_HEADER (@var{header-file}, @ovar{action-if-found}, @ovar{action-if-not-found}) +@defmac AC_CHECK_HEADER (@var{header-file}, @ovar{action-if-found}, +@ovar{action-if-not-found}, @ovar{includes}) @maindex CHECK_HEADER If the system header file @var{header-file} exists, execute shell commands @var{action-if-found}, otherwise execute @var{action-if-not-found}. If you just want to define a symbol if the header file is available, consider using @code{AC_CHECK_HEADERS} instead. + +This macro actually checks whether @var{header-file} can be included +without error. If @var{includes} is specified, they are included before +@var{header-file}. Note that the @var{includes} are @emph{not} +defaulted. They might be in future releases. @end defmac -@defmac AC_CHECK_HEADERS (@var{header-file}@dots{}, @ovar{action-if-found}, @ovar{action-if-not-found}) +@defmac AC_CHECK_HEADERS (@var{header-file}@dots{}, @ovar{action-if-found}, +@ovar{action-if-not-found}, @ovar{includes}) @maindex CHECK_HEADERS @cvindex HAVE_@var{header} For each given system header file @var{header-file} in the @@ -3878,6 +3883,11 @@ files is found. You can give it a value of @samp{break} to break out of the loop on the first match. If @var{action-if-not-found} is given, it is executed when one of the header files is not found. + +This macro actually checks whether @var{header-file} can be included +without error. If @var{includes} is specified, they are included before +@var{header-file}. Note that the @var{includes} are @emph{not} +defaulted. They might be in future releases. @end defmac @node Declarations, Structures, Header Files, Existing Tests