4459 |
|
|
4460 |
@defmac AC_CHECK_HEADER (@var{header-file}, @ovar{action-if-found}, @ovar{action-if-not-found}, @dvar{includes, default-includes}) |
@defmac AC_CHECK_HEADER (@var{header-file}, @ovar{action-if-found}, @ovar{action-if-not-found}, @dvar{includes, default-includes}) |
4461 |
@acindex CHECK_HEADER |
@acindex CHECK_HEADER |
4462 |
If the system header file @var{header-file} is usable, execute shell |
If the system header file @var{header-file} is compilable, execute shell |
4463 |
commands @var{action-if-found}, otherwise execute |
commands @var{action-if-found}, otherwise execute |
4464 |
@var{action-if-not-found}. If you just want to define a symbol if the |
@var{action-if-not-found}. If you just want to define a symbol if the |
4465 |
header file is available, consider using @code{AC_CHECK_HEADERS} |
header file is available, consider using @code{AC_CHECK_HEADERS} |
4466 |
instead. |
instead. |
4467 |
|
|
4468 |
The meaning of ``usable'' depends upon the content of @var{includes}: |
Previous versions of Autoconf merely checked whether the header was |
4469 |
|
accepted by the preprocessor. This was changed because the old test |
4470 |
@table @asis |
was inappropriate for typical uses. Headers are typically used to |
4471 |
@item if @var{includes} is empty |
compile, not merely to preprocess, and the old behavior sometimes |
4472 |
check whether |
accepted headers that clashed at compile-time. If you need to check |
4473 |
|
whether a header is preprocessable, you can use @code{AC_TRY_CPP} or |
4474 |
@example |
one of its variants (@pxref{Examining Declarations}). |
|
@var{header-file} |
|
|
@end example |
|
|
|
|
|
@noindent |
|
|
can be @emph{preprocessed} without error. |
|
|
|
|
|
@item if @var{include} is set |
|
|
Check whether |
|
|
|
|
|
@example |
|
|
@var{includes} |
|
|
#include <@var{header-file}> |
|
|
@end example |
|
|
|
|
|
@noindent |
|
|
can be @emph{compiled} without error. You may use |
|
|
@code{AC_CHECK_HEADER} (and @code{AC_CHECK_HEADERS}) to check whether |
|
|
two headers are compatible. |
|
|
@end table |
|
|
|
|
|
You may pass any kind of dummy content for @var{includes}, such as a |
|
|
single space or a comment, to check whether @var{header-file} compiles |
|
|
with success. |
|
4475 |
@end defmac |
@end defmac |
4476 |
|
|
4477 |
@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}) |
4484 |
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 |
4485 |
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 |
4486 |
is executed when one of the header files is not found. |
is executed when one of the header files is not found. |
|
|
|
|
Be sure to read the documentation of @code{AC_CHECK_HEADER} to |
|
|
understand the influence of @var{includes}. |
|
4487 |
@end defmac |
@end defmac |
4488 |
|
|
4489 |
@node Declarations |
@node Declarations |