* acheaders.m4 (AC_CHECK_HEADER, AC_CHECK_HEADERS): Support $4 =

INCLUDES.
This commit is contained in:
Akim Demaille 2001-06-13 07:51:09 +00:00
parent f789ff53d8
commit bc0cb140fd
5 changed files with 39 additions and 10 deletions

View File

@ -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

4
NEWS
View File

@ -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.
* Major changes in Autoconf 2.50

View File

@ -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 @@ 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
])

View 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

View File

@ -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 @@ 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
])