Debian Codegraph @

m4/win32.m4

raw
1 AC_DEFUN([AC_FL_WIN32], [
2 case "$target_os" in
3 *mingw*)
4 target_win32="yes"
5 target_mingw32="yes"
6 ;;
7 *cygwin*|*win32*|*w32*)
8 target_win32="yes"
9 ;;
10 *)
11 target_win32="no"
12 ;;
13 esac
14
15 if test "x$target_win32" = "xyes"; then
16 AC_CHECK_PROG([WINDRES], [${ac_tool_prefix}windres], [${ac_tool_prefix}windres])
17 if [ test "x$WINDRES" = "x" ]; then
18 AC_MSG_WARN([The windres utility could not be found])
19 fi
20 AC_DEFINE([__WOE32__], 1, [Define to 1 if we are building on mingw])
21 AC_DEFINE([__MINGW32__], 1, [Define to 1 if we are building on cygwin or mingw])
22 AC_DEFINE([_WINDOWS], 1, [Define to 1 if we are building on cygwin or mingw])
23 fi
24
25 if test "x$target_mingw32" = "xyes"; then
26 AC_CHECK_PROG([MAKENSIS], [makensis], [makensis])
27 fi
28
29 AC_SUBST([WINDRES])
30 AM_CONDITIONAL([HAVE_WINDRES], [test "x$WINDRES" != "x"])
31 AC_SUBST([MAKENSIS])
32 AM_CONDITIONAL([HAVE_NSIS], [test "x$MAKENSIS" != "x"])
33 AM_CONDITIONAL([WIN32], [test "x$target_win32" = "xyes"])
34 AM_CONDITIONAL([MINGW32], [test "x$target_mingw32" = "xyes"])
35
36 AC_ARG_VAR([PTW32_CFLAGS], [C compiler flags for pthreads-w32])
37 AC_ARG_VAR([PTW32_LIBS], [linker flags for pthreads-w32])
38
39 AC_ARG_WITH([ptw32],
40 AC_HELP_STRING([--with-ptw32@<:@=DIR@:>@],
41 [search for pthreads-w32 in DIR/include and DIR/lib @<:@mingw32 only@:>@]),
42 [ac_cv_want_ptw32="$withval"],
43 [ac_cv_want_ptw32=no])
44
45 if test "x$ac_cv_want_ptw32" != "xno"; then
46 if test "x$ac_cv_want_ptw32" != "xyes"; then # set -I and -L switches
47 ptw32_default_cflags="-I${ac_cv_want_ptw32}/include"
48 ptw32_default_libs="-L${ac_cv_want_ptw32}/lib"
49 fi
50 ptw32_default_cflags="-DPTW32_STATIC_LIB $ptw32_default_cflags"
51 ptw32_default_libs="$ptw32_default_libs -lpthreadGC2 -lws2_32"
52
53 # don't override the user-specified vars
54 PTW32_CFLAGS="${PTW32_CFLAGS:-$ptw32_default_cflags}"
55 PTW32_LIBS="${PTW32_LIBS:-$ptw32_default_libs}"
56 ac_cv_want_ptw32="yes"
57 else
58 if test "x$target_mingw32" = "xyes"; then
59 PTW32_LIBS="-lpthread -lwsock32 -lws2_32"
60 fi
61 fi
62
63 AC_SUBST([PTW32_CFLAGS])
64 AC_SUBST([PTW32_LIBS])
65
66 ])