From bd94eccbdf17c17faf8c0bc96177a497fd9d2655 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 10 Oct 2019 15:43:34 +0200 Subject: Add configure check for Windows Set an automake variable and force --without-tools by default. Also, don't even try to check for pthread if we are compiling for Windows. Signed-off-by: David Oberhollenzer --- configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/configure.ac b/configure.ac index 018b3f6..96aafab 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,7 @@ AC_PROG_CC AC_PROG_CC_C99 AC_PROG_INSTALL AC_SYS_LARGEFILE +AC_CANONICAL_HOST m4_ifndef([PKG_PROG_PKG_CONFIG], [m4_fatal([Could not locate the pkg-config autoconf @@ -41,6 +42,18 @@ UL_WARN_ADD([-pedantic]) AC_SUBST([WARN_CFLAGS]) +##### target detection & target specific stuff ##### + +build_windows="no" + +case "${host_os}" in +cygwin*|mingw*) + build_windows=yes + ;; +esac + +AM_CONDITIONAL([WINDOWS], [test "x$build_windows" = "xyes"]) + ##### config options ##### AC_ARG_WITH([xz], @@ -74,6 +87,14 @@ AC_ARG_WITH([tools], [Only build libsquashfs, do not build the tools.])], [build_tools="${withval}"], [build_tools="yes"]) +if test "x$build_windows" = "xyes"; then + want_pthread="no" +fi + +if test "x$build_windows" = "xyes"; then + build_tools="no" +fi + AM_CONDITIONAL([BUILD_TOOLS], [test "x$build_tools" = "xyes"]) ##### Doxygen reference manual ##### -- cgit v1.2.3