]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acheaders.m4 (AC_CHECK_HEADER, AC_CHECK_HEADERS): Support $4 =
authorAkim Demaille <akim@epita.fr>
Wed, 13 Jun 2001 07:51:09 +0000 (07:51 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 13 Jun 2001 07:51:09 +0000 (07:51 +0000)
INCLUDES.

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

index afc1f929b74f4b6255210fb32ee851224421622e..5e432d45679df94eef3a9ea9a6511b70ff30e22c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-13  Akim Demaille  <akim@epita.fr>
+
+       * acheaders.m4 (AC_CHECK_HEADER, AC_CHECK_HEADERS): Support $4 =
+       INCLUDES.
+
 2001-06-12  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
 
        * acspecific.m4 (AC_PATH_XTRA): Check if linking against libX11
diff --git a/NEWS b/NEWS
index 10fdd6ba724b417efd88b523eea68bad0e6fa0ce..39ce02b2f7afb3986fae976d07679c9ff3a1dff7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,10 @@ Now include stdint.h.
 - 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.
 \f
 * Major changes in Autoconf 2.50
 
index 56c0b3d0b7ca4172afd3bbe016a2088da4edb56b..17287581b13ca25a320fa075a2fb0f26194b4140 100644 (file)
 ## 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 @@ m4_define([AH_CHECK_HEADERS],
 
 # 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 @@ for ac_header in $1
 do
 AC_CHECK_HEADER($ac_header,
                 [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$ac_header)) $2],
-                [$3])dnl
+                [$3],
+                [$4])dnl
 done
 ])
 
index 2ec87f9365bf9e97c0198cfa51e38ff544e2df7a..e843628a7accce704ae2294ad3d5a480c8d1c19c 100644 (file)
@@ -3860,15 +3860,20 @@ These macros are used to find system header files not covered by the
 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 @@ is given, it is additional shell code to execute when one of the header
 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
index 56c0b3d0b7ca4172afd3bbe016a2088da4edb56b..17287581b13ca25a320fa075a2fb0f26194b4140 100644 (file)
 ## 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 @@ m4_define([AH_CHECK_HEADERS],
 
 # 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 @@ for ac_header in $1
 do
 AC_CHECK_HEADER($ac_header,
                 [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$ac_header)) $2],
-                [$3])dnl
+                [$3],
+                [$4])dnl
 done
 ])