Node:Particular Headers, Next:Generic Headers, Up:Header Files
These macros check for particular system header files--whether they exist, and in some cases whether they declare certain symbols.
| AC_HEADER_DIRENT | Macro | 
| Check for the following header files.  For the first one that is
found and defines DIR, define the listed C preprocessor macro:
 The directory-library declarations in your source code should look
something like the following:
 #if HAVE_DIRENT_H # include <dirent.h> # define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include <sys/ndir.h> # endif # if HAVE_SYS_DIR_H # include <sys/dir.h> # endif # if HAVE_NDIR_H # include <ndir.h> # endif #endif Using the above declarations, the program would declare variables to be
of type  This macro also checks for the SCO Xenix  | 
| AC_HEADER_MAJOR | Macro | 
| If sys/types.hdoes not definemajor,minor, andmakedev, butsys/mkdev.hdoes, defineMAJOR_IN_MKDEV; otherwise, ifsys/sysmacros.hdoes, defineMAJOR_IN_SYSMACROS. | 
| AC_HEADER_STAT | Macro | 
| If the macros S_ISDIR,S_ISREGet al. defined insys/stat.hdo not work properly (returning false positives),
defineSTAT_MACROS_BROKEN.  This is the case on Tektronix UTekV,
Amdahl UTS and Motorola System V/88. | 
| AC_HEADER_STDC | Macro | 
| Define STDC_HEADERSif the system has ANSI C header files. 
Specifically, this macro checks forstdlib.h,stdarg.h,string.h, andfloat.h; if the system has those, it
probably has the rest of the ANSI C header files.  This macro also
checks whetherstring.hdeclaresmemchr(and thus
presumably the othermemfunctions), whetherstdlib.hdeclarefree(and thus presumablymallocand other related
functions), and whether thectype.hmacros work on characters
with the high bit set, as ANSI C requires.Use  On systems without ANSI C headers, there is so much variation that
it is probably easier to declare the functions you use than to figure
out exactly what the system header files declare.  Some systems contain
a mix of functions ANSI and BSD; some are mostly ANSI but
lack  AC_HEADER_STDC AC_CHECK_FUNCS(strchr memcpy) then, in your code, you can put declarations like this:
 #if STDC_HEADERS # include <string.h> #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif If you use a function like  | 
| AC_HEADER_SYS_WAIT | Macro | 
| If sys/wait.hexists and is compatible with POSIX.1, defineHAVE_SYS_WAIT_H.  Incompatibility can occur ifsys/wait.hdoes not exist, or if it uses the old BSDunion waitinstead
ofintto store a status value.  Ifsys/wait.his not
POSIX.1 compatible, then instead of including it, define the
POSIX.1 macros with their usual interpretations.  Here is an
example:#include <sys/types.h> #if HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif | 
_POSIX_VERSION is defined when unistd.h is included on
POSIX.1 systems.  If there is no unistd.h, it is definitely
not a POSIX.1 system.  However, some non-POSIX.1 systems do
have unistd.h.
The way to check if the system supports POSIX.1 is:
#if HAVE_UNISTD_H # include <sys/types.h> # include <unistd.h> #endif #ifdef _POSIX_VERSION /* Code for POSIX.1 systems. */ #endif
| AC_HEADER_TIME | Macro | 
| If a program may include both time.handsys/time.h,
defineTIME_WITH_SYS_TIME.  On some older systems,sys/time.hincludestime.h, buttime.his not
protected against multiple inclusion, so programs should not explicitly
include both files.  This macro is useful in programs that use, for
example,struct timevalorstruct timezoneas well asstruct tm.  It is best used in conjunction withHAVE_SYS_TIME_H, which can be checked for usingAC_CHECK_HEADERS(sys/time.h).#if TIME_WITH_SYS_TIME # include <sys/time.h> # include <time.h> #else # if HAVE_SYS_TIME_H # include <sys/time.h> # else # include <time.h> # endif #endif | 
| AC_HEADER_TIOCGWINSZ | Macro | 
| If the use of TIOCGWINSZrequires<sys/ioctl.h>, then
defineGWINSZ_IN_SYS_IOCTL.  OtherwiseTIOCGWINSZcan be
found in<termios.h>.Use:
 #if HAVE_TERMIOS_H # include <termios.h> #endif #if GWINSZ_IN_SYS_IOCTL # include <sys/ioctl.h> #endif |