summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2022-11-23 13:09:11 +1100
committerDarren Tucker <dtucker@dtucker.net>2022-11-23 13:24:50 +1100
commit6b9bbbfe8b26db6e9a30a7e08c223e85421aed98 (patch)
tree37955836de7310aad74602facce8167b7fec79f3 /configure.ac
parent8926956f22639132a9f2433fcd25224e01b900f5 (diff)
If we haven't found it yet, recheck for sys/stat.h.
On some very old platforms, sys/stat.h needs sys/types.h, however autoconf 2.71's AC_CHECK_INCLUDES_DEFAULT checks for them in the opposite order, which in combination with modern autoconf's "present but cannot be compiled" behaviour causes it to not be detected.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 8 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index e172540a..d1998c94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -417,6 +417,14 @@ AC_ARG_WITH([Werror],
]
)
+dnl On some old platforms, sys/stat.h requires sys/types.h, but autoconf-2.71's
+dnl AC_CHECK_INCLUDES_DEFAULT checks for them in the opposite order. If we
+dnl haven't detected it, recheck.
+if test "x$ac_cv_header_sys_stat_h" != "xyes"; then
+ unset ac_cv_header_sys_stat_h
+ AC_CHECK_HEADERS([sys/stat.h])
+fi
+
AC_CHECK_HEADERS([ \
blf.h \
bstring.h \
@@ -475,7 +483,6 @@ AC_CHECK_HEADERS([ \
sys/ptrace.h \
sys/random.h \
sys/select.h \
- sys/stat.h \
sys/stream.h \
sys/stropts.h \
sys/strtio.h \