]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
configure.ac: automatically add include/mingw/ headers
authorEric Biggers <ebiggers@google.com>
Sat, 21 Jan 2023 20:31:55 +0000 (12:31 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 27 Jan 2023 17:06:30 +0000 (12:06 -0500)
Since the include/mingw/ directory needs to be on the include path when
building for Windows with MinGW, add it to INCLUDES automatically, and
AC_DEFINE the corresponding HAVE_*_H constants.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
configure.ac

index 5f5c342b96d0f5ab6af8c03fdce1d634b65741db..cc6f681e21a5b95a9d571ffb60119ab78b2a9bcf 100644 (file)
@@ -1036,6 +1036,17 @@ AC_CHECK_HEADERS(m4_flatten([
        sys/wait.h
        sys/xattr.h
 ]))
+case "$host_os" in
+mingw*)
+       # The above checks only detect system headers, not the headers in
+       # ./include/mingw/, so explicitly define them to be available.
+       AC_DEFINE(HAVE_LINUX_TYPES_H, 1)
+       AC_DEFINE(HAVE_SYS_STAT_H, 1)
+       AC_DEFINE(HAVE_SYS_SYSMACROS_H, 1)
+       AC_DEFINE(HAVE_SYS_TYPES_H, 1)
+       AC_DEFINE(HAVE_UNISTD_H, 1)
+       ;;
+esac
 dnl Check where to find a dd(1) that supports iflag=fullblock
 dnl and oflag=append
 AC_MSG_CHECKING([for a dd(1) program that supports iflag=fullblock])
@@ -1738,6 +1749,11 @@ fi
 if test -n "$WITH_DIET_LIBC" ; then
        INCLUDES="$INCLUDES -D_REENTRANT"
 fi
+case "$host_os" in
+mingw*)
+       INCLUDES=$INCLUDES' -I$(top_srcdir)/include/mingw'
+       ;;
+esac
 AC_SUBST(INCLUDES)
 dnl
 dnl Build CFLAGS