]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
If we haven't found it yet, recheck for sys/stat.h.
authorDarren Tucker <dtucker@dtucker.net>
Wed, 23 Nov 2022 02:09:11 +0000 (13:09 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Wed, 23 Nov 2022 02:24:50 +0000 (13:24 +1100)
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.

configure.ac

index e172540a1298b3204df563ee49c52e043f27c25f..d1998c94d1ad725d5485de869381fc302b3daccd 100644 (file)
@@ -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 \