sys/types.h and sys/stat.h, and check for them.
+2001-06-13 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (_AC_INCLUDES_DEFAULT_REQUIREMENTS): Guard
+ sys/types.h and sys/stat.h, and check for them.
+
2001-06-13 Akim Demaille <akim@epita.fr>
* acheaders.m4 (AC_CHECK_HEADER, AC_CHECK_HEADERS): Support $4 =
* Major changes in Autoconf 2.50a -*- outline -*-
** Default includes
-Now include stdint.h.
+- Now include stdint.h.
+- sys/types.h and sys/stat.h are guarded.
** 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
dnl If ever you change this variable, please keep autoconf.texi in sync.
ac_includes_default="\
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif"
])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_CHECK_HEADERS(stdlib.h string.h memory.h strings.h inttypes.h stdint.h unistd.h)
+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)
])
@example
@group
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
dnl If ever you change this variable, please keep autoconf.texi in sync.
ac_includes_default="\
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif"
])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_CHECK_HEADERS(stdlib.h string.h memory.h strings.h inttypes.h stdint.h unistd.h)
+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)
])
# AT_CHECK_HEADER is a better name, but too close from AC_CHECK_HEADER.
m4_define([AT_CHECK_DEFINES],
[AT_CHECK([[fgrep '#' config.h |
- egrep -v 'STDC_HEADERS|STDINT|STDLIB|INTTYPES|MEMORY|STRING|UNISTD']],, [$1])])
+ egrep -v 'STDC_HEADERS|STD(INT|LIB)|INTTYPES|MEMORY|STRING|UNISTD|SYS_(TYPES|STAT)']],,
+ [$1])])
# AT_CHECK_AUTOUPDATE