configure.ac: Define USE_WINDOWS for Automake when building for Windows

This commit is contained in:
Martin Willi 2013-10-11 15:26:01 +02:00
parent 922ee2c529
commit ce24e0d3e5
1 changed files with 13 additions and 0 deletions

View 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])