4493 |
header file is available, consider using @code{AC_CHECK_HEADERS} |
header file is available, consider using @code{AC_CHECK_HEADERS} |
4494 |
instead. |
instead. |
4495 |
|
|
4496 |
Previous versions of Autoconf merely checked whether the header was |
For compatibility issues with older versions of Autoconf, please read |
4497 |
accepted by the preprocessor. This was changed because the old test |
below. |
|
was inappropriate for typical uses. Headers are typically used to |
|
|
compile, not merely to preprocess, and the old behavior sometimes |
|
|
accepted headers that clashed at compile-time. If you need to check |
|
|
whether a header is preprocessable, you can use @code{AC_TRY_CPP} or |
|
|
one of its variants (@pxref{Examining Declarations}). |
|
4498 |
@end defmac |
@end defmac |
4499 |
|
|
4500 |
@defmac AC_CHECK_HEADERS (@var{header-file}@dots{}, @ovar{action-if-found}, @ovar{action-if-not-found}, @dvar{includes, default-includes}) |
@defmac AC_CHECK_HEADERS (@var{header-file}@dots{}, @ovar{action-if-found}, @ovar{action-if-not-found}, @dvar{includes, default-includes}) |
4507 |
files is found. You can give it a value of @samp{break} to break out of |
files is found. You can give it a value of @samp{break} to break out of |
4508 |
the loop on the first match. If @var{action-if-not-found} is given, it |
the loop on the first match. If @var{action-if-not-found} is given, it |
4509 |
is executed when one of the header files is not found. |
is executed when one of the header files is not found. |
4510 |
|
|
4511 |
|
For compatibility issues with older versions of Autoconf, please read |
4512 |
|
below. |
4513 |
@end defmac |
@end defmac |
4514 |
|
|
4515 |
|
Previous versions of Autoconf merely checked whether the header was |
4516 |
|
accepted by the preprocessor. This was changed because the old test was |
4517 |
|
inappropriate for typical uses. Headers are typically used to compile, |
4518 |
|
not merely to preprocess, and the old behavior sometimes accepted |
4519 |
|
headers that clashed at compile-time. If you need to check whether a |
4520 |
|
header is preprocessable, you can use @code{AC_TRY_CPP} or one of its |
4521 |
|
variants (@pxref{Examining Declarations}). |
4522 |
|
|
4523 |
|
This scheme, which improves the robustness of the test, also requires |
4524 |
|
that you make sure that headers that must be included before the |
4525 |
|
@var{header-file} be part of the @var{includes}, (@pxref{Default |
4526 |
|
Includes}). If looking for @file{bar.h}, which requires that |
4527 |
|
@file{foo.h} be included before if it exists, we suggest the following |
4528 |
|
scheme: |
4529 |
|
|
4530 |
|
@verbatim |
4531 |
|
AC_CHECK_HEADERS([foo.h]) |
4532 |
|
AC_CHECK_HEADERS([bar.h], [], [], |
4533 |
|
[#if HAVE_FOO_H |
4534 |
|
# include <foo.h> |
4535 |
|
# endif |
4536 |
|
]) |
4537 |
|
@end verbatim |
4538 |
|
|
4539 |
@node Declarations |
@node Declarations |
4540 |
@section Declarations |
@section Declarations |
4541 |
@cindex Declaration, checking |
@cindex Declaration, checking |