INCLUDES.
+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
- 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
## 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
# AC_CHECK_HEADERS(HEADER-FILE...
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# [INCLUDES])
# ----------------------------------------------------------
AC_DEFUN([AC_CHECK_HEADERS],
[AH_CHECK_HEADERS([$1])dnl
do
AC_CHECK_HEADER($ac_header,
[AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$ac_header)) $2],
- [$3])dnl
+ [$3],
+ [$4])dnl
done
])
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
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
## 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
# AC_CHECK_HEADERS(HEADER-FILE...
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# [INCLUDES])
# ----------------------------------------------------------
AC_DEFUN([AC_CHECK_HEADERS],
[AH_CHECK_HEADERS([$1])dnl
do
AC_CHECK_HEADER($ac_header,
[AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$ac_header)) $2],
- [$3])dnl
+ [$3],
+ [$4])dnl
done
])