1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
@node ax_auto_include_headers
@unnumberedsec ax_auto_include_headers
@majorheading Synopsis
@smallexample
AX_AUTO_INCLUDE_HEADERS(INCLUDE-FILE ...)
@end smallexample
@majorheading Description
Given a space-separated list of INCLUDE-FILEs, AX_AUTO_INCLUDE_HEADERS
will output a conditional #include for each INCLUDE-FILE. The following
example demonstrates how AX_AUTO_INCLUDE_HEADERS's might be used in a
configure.ac script:
@smallexample
AH_BOTTOM([
AX_AUTO_INCLUDE_HEADERS([sys/resource.h invent.h sys/sysinfo.h])dnl
])
@end smallexample
The preceding invocation instructs autoheader to put the following code
at the bottom of the config.h file:
@smallexample
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
#ifdef HAVE_INVENT_H
# include <invent.h>
#endif
#ifdef HAVE_SYS_SYSINFO_H
# include <sys/sysinfo.h>
#endif
@end smallexample
Note that AX_AUTO_INCLUDE_HEADERS merely outputs #ifdef/#include/#endif
blocks. The configure.ac script still needs to invoke AC_CHECK_HEADERS
to #define the various HAVE_*_H preprocessor macros.
Here's an easy way to get from config.h a complete list of header files
who existence is tested by the configure script:
@smallexample
cat config.h | perl -ane '/ HAVE_\S+_H / && do @{$_=$F[$#F-1]; s/^HAVE_//; s/_H/.h/; s|_|/|g; tr/A-Z/a-z/; print "$_ "@}'
@end smallexample
You can then manually edit the resulting list and incorporate it into
one or more calls to AX_AUTO_INCLUDE_HEADERS.
@majorheading Source Code
Download the
@uref{http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_auto_include_headers.m4,latest
version of @file{ax_auto_include_headers.m4}} or browse
@uref{http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=history;f=m4/ax_auto_include_headers.m4,the
macro's revision history}.
@majorheading License
@w{Copyright @copyright{} 2008 Scott Pakin @email{pakin@@uiuc.edu}}
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty provided the copyright notice
and this notice are preserved. This file is offered as-is, without any
warranty.
|