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 fi
22
23 if test "x$target_mingw32" = "xyes"; then
24 AC_CHECK_PROG([MAKENSIS], [makensis], [makensis])
25 fi
26
27 AC_SUBST([WINDRES])
28 AM_CONDITIONAL([HAVE_WINDRES], [test "x$WINDRES" != "x"])
29 AC_SUBST([MAKENSIS])
30 AM_CONDITIONAL([HAVE_NSIS], [test "x$MAKENSIS" != "x"])
31 AM_CONDITIONAL([WIN32], [test "x$target_win32" = "xyes"])
32 AM_CONDITIONAL([MINGW32], [test "x$target_mingw32" = "xyes"])
33
34
35 AC_ARG_VAR([PTW32_CFLAGS], [C compiler flags for pthreads-w32])
36 AC_ARG_VAR([PTW32_LIBS], [linker flags for pthreads-w32])
37
38 AC_ARG_WITH([ptw32],
39 AC_HELP_STRING([--with-ptw32@<:@=DIR@:>@],
40 [search for pthreads-w32 in DIR/include and DIR/lib @<:@mingw32 only@:>@]),
41 [ac_cv_want_ptw32="$withval"],
42 [ac_cv_want_ptw32=no])
43
44 if test "x$ac_cv_want_ptw32" != "xno"; then
45 if test "x$ac_cv_want_ptw32" != "xyes"; then # set -I and -L switches
46 ptw32_default_cflags="-I${ac_cv_want_ptw32}/include"
47 ptw32_default_libs="-L${ac_cv_want_ptw32}/lib"
48 fi
49 ptw32_default_libs="$ptw32_default_libs -lpthreadGC2 -lws2_32"
50
51 # don't override the user-specified vars
52 PTW32_CFLAGS="${PTW32_CFLAGS:-$ptw32_default_cflags}"
53 PTW32_LIBS="${PTW32_LIBS:-$ptw32_default_libs}"
54 ac_cv_want_ptw32="yes"
55 fi
56
57 AC_SUBST([PTW32_CFLAGS])
58 AC_SUBST([PTW32_LIBS])
59 ])