Skip to content

Commit cf32403

Browse files
committed
configure: check for win32 platform
1 parent 9c33348 commit cf32403

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

configure.ac

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,22 @@ AC_TYPE_UINT8_T
5252
AC_FUNC_MALLOC
5353
AC_FUNC_REALLOC
5454

55+
# Check for operating system
56+
AC_MSG_CHECKING([whether to enable WIN32 build settings])
57+
case ${host_os} in
58+
*mingw*|*msys*|*cygwin*)
59+
win32=true
60+
AC_MSG_RESULT([yes])
61+
AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, [Define to limit the scope of windows.h])
62+
AC_DEFINE(__USE_MINGW_ANSI_STDIO, 1, [Define to use C99 printf/snprintf in MinGW])
63+
;;
64+
*)
65+
win32=false
66+
AC_MSG_RESULT([no])
67+
;;
68+
esac
69+
AM_CONDITIONAL(WIN32, test "x$win32" = "xtrue")
70+
5571
# Check for pcre presence if regex.h is absent
5672
AC_CHECK_HEADER(regex.h, [ac_have_regex_h="yes"], [ac_have_regex_h="no"])
5773
if test "x$ac_have_regex_h" = "xno"; then

0 commit comments

Comments
 (0)