* Major changes in Autoconf 2.50a -*- outline -*-
** Default includes
-- Now include stdint.h.
-- sys/types.h and sys/stat.h are guarded.
+Now include stdint.h.
** Bug fixes
- Mostly in the test suite.
- configure accepts --prefix='' again.
- AC_CHECK_LIB works properly when its first argument is not a
literal.
-- HAVE_INTTYPES_H is defined only if not conflicting with previous
- headers.
-
-** Generic macros
-- AC_CHECK_HEADER and AC_CHECK_HEADERS support a fourth argument to
- specify pre-includes.
\f
* Major changes in Autoconf 2.50
[AC_REQUIRE([AC_TYPE_UID_T])dnl
AC_CHECK_HEADERS(unistd.h)
AC_CACHE_CHECK([for working chown], ac_cv_func_chown_works,
-[AC_RUN_IFELSE([AC_LANG_SOURCE([[#if SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/types.h>
+#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
AC_CACHE_CHECK([whether closedir returns void],
[ac_cv_func_closedir_void],
[AC_RUN_IFELSE([AC_LANG_SOURCE(
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[#include <sys/types.h>
#include <$ac_header_dirent>
int closedir ();
# AC_FUNC_GETPGRP
# ---------------
AC_DEFUN([AC_FUNC_GETPGRP],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK(whether getpgrp takes no argument, ac_cv_func_getpgrp_void,
+[AC_CACHE_CHECK(whether getpgrp takes no argument, ac_cv_func_getpgrp_void,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
/*
* If this system has a BSD-style getpgrp(),
* Snarfed from Chet Ramey's bash pgrp.c test program
*/
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
int pid;
int pg1, pg2, pg3, pg4;
# AC_FUNC_MMAP
# ------------
AC_DEFUN([AC_FUNC_MMAP],
-[AC_CHECK_HEADERS(sys/types.h sys/stat.h stdlib.h unistd.h)
+[AC_CHECK_HEADERS(stdlib.h unistd.h)
AC_CHECK_FUNCS(getpagesize)
AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap_fixed_mapped,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
The main things grep needs to know about mmap are:
* does it exist and is it safe to write into the mmap'd area
* how to use it (BSD variants) */
-
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
#include <fcntl.h>
#include <sys/mman.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+#include <sys/stat.h>
/* This mess was copied from the GNU getpagesize.h. */
#if !HAVE_GETPAGESIZE
# function's arguments, and define those types in `SELECT_TYPE_ARG1',
# `SELECT_TYPE_ARG234', and `SELECT_TYPE_ARG5'.
AC_DEFUN([AC_FUNC_SELECT_ARGTYPES],
-[AC_REQUIRE([AC_HEADER_TIME])dnl
-AC_CHECK_HEADERS(sys/types.h sys/select.h sys/socket.h)
+[AC_CHECK_HEADERS(sys/select.h sys/socket.h)
AC_CACHE_CHECK([types of arguments for select],
[ac_cv_func_select_args],
[for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[#include <sys/types.h>
#if HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
# HAVE_LSTAT_EMPTY_STRING_BUG) and arrange to compile the wrapper
# function.
m4_define([_AC_FUNC_STAT],
-[AC_CHECK_HEADERS(sys/types.h sys/stat.h)
-AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])dnl
+[AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])dnl
AC_CACHE_CHECK([whether $1 accepts an empty string],
[ac_cv_func_$1_empty_string_bug],
[AC_TRY_RUN(
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+[#include <sys/types.h>
+#include <sys/stat.h>
int
main ()
# AC_FUNC_UTIME_NULL
# ------------------
AC_DEFUN([AC_FUNC_UTIME_NULL],
-[AC_CHECK_HEADERS(sys/types.h sys/stat.h)
-AC_CACHE_CHECK(whether utime accepts a null argument, ac_cv_func_utime_null,
+[AC_CACHE_CHECK(whether utime accepts a null argument, ac_cv_func_utime_null,
[rm -f conftest.data; >conftest.data
# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong.
AC_TRY_RUN(
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
+[#include <sys/types.h>
+#include <sys/stat.h>
int
main ()
{
# -------------
AC_DEFUN([AC_FUNC_VFORK],
[AC_REQUIRE([AC_TYPE_PID_T])dnl
-AC_CHECK_HEADERS(sys/types.h sys/stat.h unistd.h vfork.h)
+AC_CHECK_HEADERS(unistd.h vfork.h)
AC_CACHE_CHECK(for working vfork, ac_cv_func_vfork_works,
[AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+#include <sys/types.h>
+#include <sys/stat.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
# AC_FUNC_WAIT3
# -------------
AC_DEFUN([AC_FUNC_WAIT3],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3_rusage,
+[AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3_rusage,
[AC_TRY_RUN(
-[#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
-
+#include <stdio.h>
/* HP-UX has wait3 but does not fill in rusage at all. */
int
main ()
dnl If ever you change this variable, please keep autoconf.texi in sync.
ac_includes_default="\
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+#include <sys/types.h>
+#include <sys/stat.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif"
])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_CHECK_HEADERS(sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h inttypes.h stdint.h unistd.h, [], [], $ac_includes_default)
+AC_CHECK_HEADERS(stdlib.h string.h memory.h strings.h inttypes.h stdint.h unistd.h)
])
## 1. Generic tests for headers. ##
## ------------------------------ ##
-# AC_CHECK_HEADER(HEADER-FILE,
-# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
-# [INCLUDES])
-# ---------------------------------------------------------
+# AC_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# ----------------------------------------------------------------------
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([m4_n([$4])dnl
-@%:@include <$1>])],
+ [AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@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
# AC_CHECK_HEADERS(HEADER-FILE...
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# [INCLUDES])
# ----------------------------------------------------------
AC_DEFUN([AC_CHECK_HEADERS],
[AH_CHECK_HEADERS([$1])dnl
do
AC_CHECK_HEADER($ac_header,
[AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$ac_header)) $2],
- [$3],
- [$4])dnl
+ [$3])dnl
done
])
m4_define([_AC_CHECK_HEADER_DIRENT],
[AS_VAR_PUSHDEF([ac_Header], [ac_cv_header_dirent_$1])dnl
AC_CACHE_CHECK([for $1 that defines DIR], ac_Header,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <$1>
],
[DIR *dirp = 0;])],
# ----------------
AC_DEFUN([AC_HEADER_DIRENT],
[AH_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h)
-AC_CHECK_HEADERS(sys/types.h)
ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
_AC_CHECK_HEADER_DIRENT($ac_hdr,
# ---------------
AC_DEFUN([AC_HEADER_MAJOR],
[AC_CACHE_CHECK(whether sys/types.h defines makedev,
- ac_cv_header_sys_types_h_makedev,
+ ac_cv_header_sys_types_h_makedev,
[AC_TRY_LINK([#include <sys/types.h>
], [return makedev(0, 0);],
ac_cv_header_sys_types_h_makedev=yes, ac_cv_header_sys_types_h_makedev=no)
# --------------
# FIXME: Shouldn't this be named AC_HEADER_SYS_STAT?
AC_DEFUN([AC_HEADER_STAT],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK(whether stat file-mode macros are broken,
+[AC_CACHE_CHECK(whether stat file-mode macros are broken,
ac_cv_header_stat_broken,
-[AC_EGREP_CPP([You lose], [#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_EGREP_CPP([You lose], [#include <sys/types.h>
#include <sys/stat.h>
#if defined(S_ISBLK) && defined(S_IFDIR)
# AC_HEADER_SYS_WAIT
# ------------------
AC_DEFUN([AC_HEADER_SYS_WAIT],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([for sys/wait.h that is POSIX.1 compatible],
- ac_cv_header_sys_wait_h,
+[AC_CACHE_CHECK([for sys/wait.h that is POSIX.1 compatible],
+ ac_cv_header_sys_wait_h,
[AC_COMPILE_IFELSE(
-[AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/wait.h>
#ifndef WEXITSTATUS
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
# AC_HEADER_TIME
# --------------
AC_DEFUN([AC_HEADER_TIME],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([whether time.h and sys/time.h may both be included],
- ac_cv_header_time,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_CACHE_CHECK([whether time.h and sys/time.h may both be included],
+ ac_cv_header_time,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
],
# _AC_HEADER_TIOCGWINSZ_IN_TERMIOS_H
# ----------------------------------
m4_define([_AC_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([whether termios.h defines TIOCGWINSZ],
+[AC_CACHE_CHECK([whether termios.h defines TIOCGWINSZ],
ac_cv_sys_tiocgwinsz_in_termios_h,
[AC_EGREP_CPP([yes],
- [#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+ [#include <sys/types.h>
#include <termios.h>
#ifdef TIOCGWINSZ
yes
# _AC_HEADER_TIOCGWINSZ_IN_SYS_IOCTL
# ----------------------------------
m4_define([_AC_HEADER_TIOCGWINSZ_IN_SYS_IOCTL],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([whether sys/ioctl.h defines TIOCGWINSZ],
+[AC_CACHE_CHECK([whether sys/ioctl.h defines TIOCGWINSZ],
ac_cv_sys_tiocgwinsz_in_sys_ioctl_h,
[AC_EGREP_CPP([yes],
- [#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+ [#include <sys/types.h>
#include <sys/ioctl.h>
#ifdef TIOCGWINSZ
yes
[AC_REQUIRE([AC_PROG_CC])dnl
AC_BEFORE([$0], [AC_C_INLINE])dnl
AC_BEFORE([$0], [AC_C_CONST])dnl
-AC_CHECK_HEADERS(sys/types.h sys/stat.h)
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
dnl a magic option to avoid problems with ANSI preprocessor commands
dnl like #elif.
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
[[#include <stdarg.h>
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
+#include <sys/types.h>
+#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
# AC_C_BIGENDIAN
# --------------
AC_DEFUN([AC_C_BIGENDIAN],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
+[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
[ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/param.h>
],
[#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
#endif
])],
[# It does; now see whether it defined to BIG_ENDIAN or not.
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/param.h>
], [#if BYTE_ORDER != BIG_ENDIAN
not big endian
# AC_DECL_SYS_SIGLIST
# -------------------
AC_DEFUN([AC_DECL_SYS_SIGLIST],
-[AC_CHECK_HEADERS(sys/types.h unistd.h)
-AC_CACHE_CHECK([for sys_siglist declaration in signal.h or unistd.h],
- ac_cv_decl_sys_siglist,
+[AC_CACHE_CHECK([for sys_siglist declaration in signal.h or unistd.h],
+ ac_cv_decl_sys_siglist,
[AC_COMPILE_IFELSE(
-[AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_LANG_PROGRAM([#include <sys/types.h>
#include <signal.h>
/* NetBSD declares sys_siglist in unistd.h. */
#if HAVE_UNISTD_H
# interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'.
AC_DEFUN([AC_SYS_RESTARTABLE_SYSCALLS],
[AC_REQUIRE([AC_HEADER_SYS_WAIT])dnl
-AC_CHECK_HEADERS(sys/types.h unistd.h)
+AC_CHECK_HEADERS(unistd.h)
AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[/* Exit 0 (true) if wait returns something other than -1,
i.e. the pid of the child, which means that wait was restarted
after getting the signal. */
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
#include <signal.h>
#if HAVE_UNISTD_H
# include <unistd.h>
# AC_SYS_POSIX_TERMIOS
# --------------------
AC_DEFUN([AC_SYS_POSIX_TERMIOS],
-[AC_CHECK_HEADERS(sys/types.h unistd.h)
-AC_CACHE_CHECK([POSIX termios], ac_cv_sys_posix_termios,
-[AC_TRY_LINK([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+[AC_CACHE_CHECK([POSIX termios], ac_cv_sys_posix_termios,
+[AC_TRY_LINK([#include <sys/types.h>
+#include <unistd.h>
@%:@include <termios.h>],
[/* SunOS 4.0.3 has termios.h but not the library calls. */
tcgetattr(0, 0);],
# -----------------
AC_DEFUN([AC_TYPE_GETGROUPS],
[AC_REQUIRE([AC_TYPE_UID_T])dnl
-AC_CHECK_HEADERS(sys/types.h)
AC_CACHE_CHECK(type of array argument to getgroups, ac_cv_type_getgroups,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[/* Thanks to Mike Rendell for this test. */
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
#define NGID 256
#undef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y))
# --------------
# Note that identifiers starting with SIG are reserved by ANSI C.
AC_DEFUN([AC_TYPE_SIGNAL],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([return type of signal handlers], ac_cv_type_signal,
+[AC_CACHE_CHECK([return type of signal handlers], ac_cv_type_signal,
[AC_COMPILE_IFELSE(
-[AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_LANG_PROGRAM([#include <sys/types.h>
#include <signal.h>
#ifdef signal
# undef signal
# FIXME: This macro is badly named, it should be AC_CHECK_TYPE_STRUCT_TM.
# Or something else, but what? AC_CHECK_TYPE_STRUCT_TM_IN_SYS_TIME?
AC_DEFUN([AC_STRUCT_TM],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([whether struct tm is in sys/time.h or time.h],
- ac_cv_struct_tm,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_CACHE_CHECK([whether struct tm is in sys/time.h or time.h],
+ ac_cv_struct_tm,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <time.h>
],
[struct tm *tp; tp->tm_sec;])],
# external array `tzname' is found, define `HAVE_TZNAME'.
AC_DEFUN([AC_STRUCT_TIMEZONE],
[AC_REQUIRE([AC_STRUCT_TM])dnl
-AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#include <sys/types.h>
#include <$ac_cv_struct_tm>
])
if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
@example
@group
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+#include <sys/types.h>
+#include <sys/stat.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
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}, @ovar{includes})
+@defmac AC_CHECK_HEADER (@var{header-file}, @ovar{action-if-found}, @ovar{action-if-not-found})
@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}, @ovar{includes})
+@defmac AC_CHECK_HEADERS (@var{header-file}@dots{}, @ovar{action-if-found}, @ovar{action-if-not-found})
@maindex CHECK_HEADERS
@cvindex HAVE_@var{header}
For each given system header file @var{header-file} in the
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
[AC_REQUIRE([AC_PROG_CC])dnl
AC_BEFORE([$0], [AC_C_INLINE])dnl
AC_BEFORE([$0], [AC_C_CONST])dnl
-AC_CHECK_HEADERS(sys/types.h sys/stat.h)
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
dnl a magic option to avoid problems with ANSI preprocessor commands
dnl like #elif.
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
[[#include <stdarg.h>
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
+#include <sys/types.h>
+#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
# AC_C_BIGENDIAN
# --------------
AC_DEFUN([AC_C_BIGENDIAN],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
+[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
[ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/param.h>
],
[#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
#endif
])],
[# It does; now see whether it defined to BIG_ENDIAN or not.
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/param.h>
], [#if BYTE_ORDER != BIG_ENDIAN
not big endian
[AC_REQUIRE([AC_PROG_CC])dnl
AC_BEFORE([$0], [AC_C_INLINE])dnl
AC_BEFORE([$0], [AC_C_CONST])dnl
-AC_CHECK_HEADERS(sys/types.h sys/stat.h)
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
dnl a magic option to avoid problems with ANSI preprocessor commands
dnl like #elif.
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
[[#include <stdarg.h>
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
+#include <sys/types.h>
+#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
# AC_C_BIGENDIAN
# --------------
AC_DEFUN([AC_C_BIGENDIAN],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
+[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
[ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/param.h>
],
[#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
#endif
])],
[# It does; now see whether it defined to BIG_ENDIAN or not.
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/param.h>
], [#if BYTE_ORDER != BIG_ENDIAN
not big endian
[AC_REQUIRE([AC_TYPE_UID_T])dnl
AC_CHECK_HEADERS(unistd.h)
AC_CACHE_CHECK([for working chown], ac_cv_func_chown_works,
-[AC_RUN_IFELSE([AC_LANG_SOURCE([[#if SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/types.h>
+#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
AC_CACHE_CHECK([whether closedir returns void],
[ac_cv_func_closedir_void],
[AC_RUN_IFELSE([AC_LANG_SOURCE(
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[#include <sys/types.h>
#include <$ac_header_dirent>
int closedir ();
# AC_FUNC_GETPGRP
# ---------------
AC_DEFUN([AC_FUNC_GETPGRP],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK(whether getpgrp takes no argument, ac_cv_func_getpgrp_void,
+[AC_CACHE_CHECK(whether getpgrp takes no argument, ac_cv_func_getpgrp_void,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
/*
* If this system has a BSD-style getpgrp(),
* Snarfed from Chet Ramey's bash pgrp.c test program
*/
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
int pid;
int pg1, pg2, pg3, pg4;
# AC_FUNC_MMAP
# ------------
AC_DEFUN([AC_FUNC_MMAP],
-[AC_CHECK_HEADERS(sys/types.h sys/stat.h stdlib.h unistd.h)
+[AC_CHECK_HEADERS(stdlib.h unistd.h)
AC_CHECK_FUNCS(getpagesize)
AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap_fixed_mapped,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
The main things grep needs to know about mmap are:
* does it exist and is it safe to write into the mmap'd area
* how to use it (BSD variants) */
-
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
#include <fcntl.h>
#include <sys/mman.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+#include <sys/stat.h>
/* This mess was copied from the GNU getpagesize.h. */
#if !HAVE_GETPAGESIZE
# function's arguments, and define those types in `SELECT_TYPE_ARG1',
# `SELECT_TYPE_ARG234', and `SELECT_TYPE_ARG5'.
AC_DEFUN([AC_FUNC_SELECT_ARGTYPES],
-[AC_REQUIRE([AC_HEADER_TIME])dnl
-AC_CHECK_HEADERS(sys/types.h sys/select.h sys/socket.h)
+[AC_CHECK_HEADERS(sys/select.h sys/socket.h)
AC_CACHE_CHECK([types of arguments for select],
[ac_cv_func_select_args],
[for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[#include <sys/types.h>
#if HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
# HAVE_LSTAT_EMPTY_STRING_BUG) and arrange to compile the wrapper
# function.
m4_define([_AC_FUNC_STAT],
-[AC_CHECK_HEADERS(sys/types.h sys/stat.h)
-AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])dnl
+[AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])dnl
AC_CACHE_CHECK([whether $1 accepts an empty string],
[ac_cv_func_$1_empty_string_bug],
[AC_TRY_RUN(
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+[#include <sys/types.h>
+#include <sys/stat.h>
int
main ()
# AC_FUNC_UTIME_NULL
# ------------------
AC_DEFUN([AC_FUNC_UTIME_NULL],
-[AC_CHECK_HEADERS(sys/types.h sys/stat.h)
-AC_CACHE_CHECK(whether utime accepts a null argument, ac_cv_func_utime_null,
+[AC_CACHE_CHECK(whether utime accepts a null argument, ac_cv_func_utime_null,
[rm -f conftest.data; >conftest.data
# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong.
AC_TRY_RUN(
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
+[#include <sys/types.h>
+#include <sys/stat.h>
int
main ()
{
# -------------
AC_DEFUN([AC_FUNC_VFORK],
[AC_REQUIRE([AC_TYPE_PID_T])dnl
-AC_CHECK_HEADERS(sys/types.h sys/stat.h unistd.h vfork.h)
+AC_CHECK_HEADERS(unistd.h vfork.h)
AC_CACHE_CHECK(for working vfork, ac_cv_func_vfork_works,
[AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+#include <sys/types.h>
+#include <sys/stat.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
# AC_FUNC_WAIT3
# -------------
AC_DEFUN([AC_FUNC_WAIT3],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3_rusage,
+[AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3_rusage,
[AC_TRY_RUN(
-[#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
-
+#include <stdio.h>
/* HP-UX has wait3 but does not fill in rusage at all. */
int
main ()
dnl If ever you change this variable, please keep autoconf.texi in sync.
ac_includes_default="\
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+#include <sys/types.h>
+#include <sys/stat.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif"
])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_CHECK_HEADERS(sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h inttypes.h stdint.h unistd.h, [], [], $ac_includes_default)
+AC_CHECK_HEADERS(stdlib.h string.h memory.h strings.h inttypes.h stdint.h unistd.h)
])
## 1. Generic tests for headers. ##
## ------------------------------ ##
-# AC_CHECK_HEADER(HEADER-FILE,
-# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
-# [INCLUDES])
-# ---------------------------------------------------------
+# AC_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# ----------------------------------------------------------------------
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([m4_n([$4])dnl
-@%:@include <$1>])],
+ [AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@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
# AC_CHECK_HEADERS(HEADER-FILE...
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# [INCLUDES])
# ----------------------------------------------------------
AC_DEFUN([AC_CHECK_HEADERS],
[AH_CHECK_HEADERS([$1])dnl
do
AC_CHECK_HEADER($ac_header,
[AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$ac_header)) $2],
- [$3],
- [$4])dnl
+ [$3])dnl
done
])
m4_define([_AC_CHECK_HEADER_DIRENT],
[AS_VAR_PUSHDEF([ac_Header], [ac_cv_header_dirent_$1])dnl
AC_CACHE_CHECK([for $1 that defines DIR], ac_Header,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <$1>
],
[DIR *dirp = 0;])],
# ----------------
AC_DEFUN([AC_HEADER_DIRENT],
[AH_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h)
-AC_CHECK_HEADERS(sys/types.h)
ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
_AC_CHECK_HEADER_DIRENT($ac_hdr,
# ---------------
AC_DEFUN([AC_HEADER_MAJOR],
[AC_CACHE_CHECK(whether sys/types.h defines makedev,
- ac_cv_header_sys_types_h_makedev,
+ ac_cv_header_sys_types_h_makedev,
[AC_TRY_LINK([#include <sys/types.h>
], [return makedev(0, 0);],
ac_cv_header_sys_types_h_makedev=yes, ac_cv_header_sys_types_h_makedev=no)
# --------------
# FIXME: Shouldn't this be named AC_HEADER_SYS_STAT?
AC_DEFUN([AC_HEADER_STAT],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK(whether stat file-mode macros are broken,
+[AC_CACHE_CHECK(whether stat file-mode macros are broken,
ac_cv_header_stat_broken,
-[AC_EGREP_CPP([You lose], [#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_EGREP_CPP([You lose], [#include <sys/types.h>
#include <sys/stat.h>
#if defined(S_ISBLK) && defined(S_IFDIR)
# AC_HEADER_SYS_WAIT
# ------------------
AC_DEFUN([AC_HEADER_SYS_WAIT],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([for sys/wait.h that is POSIX.1 compatible],
- ac_cv_header_sys_wait_h,
+[AC_CACHE_CHECK([for sys/wait.h that is POSIX.1 compatible],
+ ac_cv_header_sys_wait_h,
[AC_COMPILE_IFELSE(
-[AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/wait.h>
#ifndef WEXITSTATUS
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
# AC_HEADER_TIME
# --------------
AC_DEFUN([AC_HEADER_TIME],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([whether time.h and sys/time.h may both be included],
- ac_cv_header_time,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_CACHE_CHECK([whether time.h and sys/time.h may both be included],
+ ac_cv_header_time,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
],
# _AC_HEADER_TIOCGWINSZ_IN_TERMIOS_H
# ----------------------------------
m4_define([_AC_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([whether termios.h defines TIOCGWINSZ],
+[AC_CACHE_CHECK([whether termios.h defines TIOCGWINSZ],
ac_cv_sys_tiocgwinsz_in_termios_h,
[AC_EGREP_CPP([yes],
- [#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+ [#include <sys/types.h>
#include <termios.h>
#ifdef TIOCGWINSZ
yes
# _AC_HEADER_TIOCGWINSZ_IN_SYS_IOCTL
# ----------------------------------
m4_define([_AC_HEADER_TIOCGWINSZ_IN_SYS_IOCTL],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([whether sys/ioctl.h defines TIOCGWINSZ],
+[AC_CACHE_CHECK([whether sys/ioctl.h defines TIOCGWINSZ],
ac_cv_sys_tiocgwinsz_in_sys_ioctl_h,
[AC_EGREP_CPP([yes],
- [#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+ [#include <sys/types.h>
#include <sys/ioctl.h>
#ifdef TIOCGWINSZ
yes
[AC_REQUIRE([AC_PROG_CC])dnl
AC_BEFORE([$0], [AC_C_INLINE])dnl
AC_BEFORE([$0], [AC_C_CONST])dnl
-AC_CHECK_HEADERS(sys/types.h sys/stat.h)
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
dnl a magic option to avoid problems with ANSI preprocessor commands
dnl like #elif.
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
[[#include <stdarg.h>
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
+#include <sys/types.h>
+#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
# AC_C_BIGENDIAN
# --------------
AC_DEFUN([AC_C_BIGENDIAN],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
+[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
[ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/param.h>
],
[#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
#endif
])],
[# It does; now see whether it defined to BIG_ENDIAN or not.
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <sys/param.h>
], [#if BYTE_ORDER != BIG_ENDIAN
not big endian
# AC_DECL_SYS_SIGLIST
# -------------------
AC_DEFUN([AC_DECL_SYS_SIGLIST],
-[AC_CHECK_HEADERS(sys/types.h unistd.h)
-AC_CACHE_CHECK([for sys_siglist declaration in signal.h or unistd.h],
- ac_cv_decl_sys_siglist,
+[AC_CACHE_CHECK([for sys_siglist declaration in signal.h or unistd.h],
+ ac_cv_decl_sys_siglist,
[AC_COMPILE_IFELSE(
-[AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_LANG_PROGRAM([#include <sys/types.h>
#include <signal.h>
/* NetBSD declares sys_siglist in unistd.h. */
#if HAVE_UNISTD_H
# interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'.
AC_DEFUN([AC_SYS_RESTARTABLE_SYSCALLS],
[AC_REQUIRE([AC_HEADER_SYS_WAIT])dnl
-AC_CHECK_HEADERS(sys/types.h unistd.h)
+AC_CHECK_HEADERS(unistd.h)
AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[/* Exit 0 (true) if wait returns something other than -1,
i.e. the pid of the child, which means that wait was restarted
after getting the signal. */
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
#include <signal.h>
#if HAVE_UNISTD_H
# include <unistd.h>
# AC_SYS_POSIX_TERMIOS
# --------------------
AC_DEFUN([AC_SYS_POSIX_TERMIOS],
-[AC_CHECK_HEADERS(sys/types.h unistd.h)
-AC_CACHE_CHECK([POSIX termios], ac_cv_sys_posix_termios,
-[AC_TRY_LINK([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+[AC_CACHE_CHECK([POSIX termios], ac_cv_sys_posix_termios,
+[AC_TRY_LINK([#include <sys/types.h>
+#include <unistd.h>
@%:@include <termios.h>],
[/* SunOS 4.0.3 has termios.h but not the library calls. */
tcgetattr(0, 0);],
# -----------------
AC_DEFUN([AC_TYPE_GETGROUPS],
[AC_REQUIRE([AC_TYPE_UID_T])dnl
-AC_CHECK_HEADERS(sys/types.h)
AC_CACHE_CHECK(type of array argument to getgroups, ac_cv_type_getgroups,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[/* Thanks to Mike Rendell for this test. */
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
#define NGID 256
#undef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y))
# --------------
# Note that identifiers starting with SIG are reserved by ANSI C.
AC_DEFUN([AC_TYPE_SIGNAL],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([return type of signal handlers], ac_cv_type_signal,
+[AC_CACHE_CHECK([return type of signal handlers], ac_cv_type_signal,
[AC_COMPILE_IFELSE(
-[AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_LANG_PROGRAM([#include <sys/types.h>
#include <signal.h>
#ifdef signal
# undef signal
# FIXME: This macro is badly named, it should be AC_CHECK_TYPE_STRUCT_TM.
# Or something else, but what? AC_CHECK_TYPE_STRUCT_TM_IN_SYS_TIME?
AC_DEFUN([AC_STRUCT_TM],
-[AC_CHECK_HEADERS(sys/types.h)
-AC_CACHE_CHECK([whether struct tm is in sys/time.h or time.h],
- ac_cv_struct_tm,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_CACHE_CHECK([whether struct tm is in sys/time.h or time.h],
+ ac_cv_struct_tm,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <time.h>
],
[struct tm *tp; tp->tm_sec;])],
# external array `tzname' is found, define `HAVE_TZNAME'.
AC_DEFUN([AC_STRUCT_TIMEZONE],
[AC_REQUIRE([AC_STRUCT_TM])dnl
-AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#include <sys/types.h>
#include <$ac_cv_struct_tm>
])
if test "$ac_cv_member_struct_tm_tm_zone" = yes; then