]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
configure.ac: Define USE_WINDOWS for Automake when building for Windows
authorMartin Willi <martin@revosec.ch>
Fri, 11 Oct 2013 13:26:01 +0000 (15:26 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 3 Jun 2014 10:24:34 +0000 (12:24 +0200)
configure.ac

index 309789ca153defaf84ffdbde6021c13797963577..8b0b8d087a5ca2e79f6d5b3a3bff6b1f986795dd 100644 (file)
@@ -724,6 +724,19 @@ if test x$printf_hooks = xauto -o x$printf_hooks = xglibc; then
        )
 fi
 
+AC_MSG_CHECKING([for Windows target])
+AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+               [[#include <windows.h>]],
+               [[#ifndef WIN32
+                 # error WIN32 undefined
+                 #endif
+               ]])],
+       [AC_MSG_RESULT([yes]); windows=true ],
+       [AC_MSG_RESULT([no])]
+)
+AM_CONDITIONAL(USE_WINDOWS, [test "x$windows" = xtrue])
+
 if test x$printf_hooks = xvstr; then
        AC_CHECK_LIB([vstr],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])],[])
        AC_DEFINE([USE_VSTR], [], [use Vstr string library for printf hooks])