]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
build: Detect Windows/MinGW at configure time
authorAaron Dierking <aarond@fb.com>
Thu, 14 Jun 2018 18:38:32 +0000 (11:38 -0700)
committerGuillem Jover <guillem@hadrons.org>
Thu, 8 Aug 2019 01:22:09 +0000 (03:22 +0200)
Extend the host OS checks to define an OS_WINDOWS automake conditional if
the host is MinGW-like. This will be useful for future Windows-specific
build tweaks.

[guillem@hadrons.org:
 - Rename WINDOWS conditional to OS_WINDOWS. ]

Signed-off-by: Guillem Jover <guillem@hadrons.org>
configure.ac

index 3beb08e7aea556c27957386bb95b0b863d6a5216..aa43ce6019dfa7abfbf870815c929d05c4f631a7 100644 (file)
@@ -44,6 +44,7 @@ AC_SUBST([TESTU01_LIBS])
 AM_CONDITIONAL([HAVE_LIBTESTU01],
                [test "x$ac_cv_lib_testu01_unif01_CreateExternGenBits" = "xyes"])
 
+is_windows=no
 AS_CASE([$host_os],
   [*-gnu*], [
     # In old glibc versions (< 2.17) clock_gettime() is in librt.
@@ -60,7 +61,11 @@ AS_CASE([$host_os],
     # Upstream refuses to define this, we will do it ourselves then.
     AC_DEFINE([__MUSL__], [1], [Define to 1 if we are building for musl])
   ],
+  [mingw*], [
+    is_windows=yes
+  ],
 )
+AM_CONDITIONAL([OS_WINDOWS], [test "x$is_windows" = "xyes"])
 
 # Checks for header files.
 AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h grp.h])