Use configure to find win32-specific tools
[moonshot-ui.git] / configure.ac
1 AC_PREREQ([2.66])
2 AC_INIT([Moonshot],
3         [0.0.1],
4         [BUG-REPORT-ADDRESS],
5         [moonshot])
6
7 AC_CONFIG_HEADERS([config.h])
8 AC_CONFIG_SRCDIR([configure.ac])
9 AC_CONFIG_MACRO_DIR([m4])
10 AC_CONFIG_AUX_DIR([build-aux])
11
12 AM_INIT_AUTOMAKE([1.11 -Wall foreign subdir-objects tar-pax no-dist-gzip dist-xz])
13 AM_SILENT_RULES([yes])
14 AM_MAINTAINER_MODE([enable])
15
16 # Platform checks
17 AC_CANONICAL_HOST
18
19 case "$host" in
20   *-*-mingw*)
21     win32=yes
22     IPC_MODULE="msrpc-glib2-1.0"
23     ;;
24   *)
25     win32=no
26     IPC_MODULE="dbus-glib-1"
27     ;;
28 esac
29
30 AM_CONDITIONAL([OS_WIN32], [test "$win32" = "yes"])
31 AM_CONDITIONAL([IPC_MSRPC], [test "$IPC_MODULE" = "msrpc-glib2-1.0"])
32 AM_CONDITIONAL([IPC_DBUS], [test "$IPC_MODULE" = "dbus-glib-1"])
33
34 # Checks for programs.
35 AC_PROG_CC
36 AM_PROG_CC_C_O
37 AM_PROG_VALAC([0.9])
38
39 if test "$IPC_MODULE" = "msrpc-glib2-1.0"; then
40   # MS RPC utilities
41   AC_PATH_MSRPC_MINGW([0.1.0], :,
42     AC_MSG_ERROR([
43 *** msrpc-mingw 0.1.0 or better is required.]))
44
45   AC_PATH_PROG([MIDL], [midl], no,
46                [/c/Program\ Files/Microsoft\ SDKs/Windows/v7.0/Bin$PATH_SEPARATOR$PATH])
47   if test "$MIDL" = "no"; then
48      AC_MSG_ERROR([
49 *** Could not find the Microsoft interface compiler MIDL.EXE.
50 *** This program is available as part of the MS Windows SDK, in
51 *** the Win32 Development Tools package. If it is not in the PATH
52 *** or its default location you may set the 'MIDL' environment
53 *** variable to point to its location and rerun configure.])
54   fi
55 fi
56
57 if test "$win32" = "yes"; then
58   # Other Windows-specific tools
59
60   # ImageMagick for the 'make icons' target. Watch that it doesn't pick up
61   # c:/windows/system32/convert.exe, which is nothing to do with ImageMagick
62   AC_PATH_PROG([IMAGEMAGICK_CONVERT], [convert], ,
63                [/c/Program\ Files/ImageMagick$PATH_SEPARATOR$PATH])
64
65   # Windows Installer XML tools
66   AC_PATH_PROG([WIX_CANDLE], [candle], ,
67                [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
68   AC_PATH_PROG([WIX_LIGHT], [light], ,
69                [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
70 fi
71
72 AC_SUBST(MIDL)
73 AC_SUBST(IMAGEMAGICK_CONVERT)
74 AC_SUBST(WIX_CANDLE)
75 AC_SUBST(WIX_LIGHT)
76
77 # Dependencies
78 PKG_CHECK_MODULES(moonshot,[
79         atk >= 1.20
80         glib-2.0 >= 2.24
81         gobject-2.0 >= 2.24
82         gtk+-2.0 >= 2.20
83         $IPC
84 ])
85
86 PKG_CHECK_MODULES(IPC, $IPC_MODULE)
87
88 moonshot_CFLAGS="$moonshot_CFLAGS $IPC_CFLAGS"
89 moonshot_LIBS="$moonshot_LIBS $IPC_LIBS"
90
91 # i18n stuff
92 AM_GNU_GETTEXT([external])
93 AM_GNU_GETTEXT_VERSION([0.17])
94
95 AC_SUBST([GETTEXT_PACKAGE],[PACKAGE_TARNAME])
96 AC_DEFINE([GETTEXT_PACKAGE],[PACKAGE_TARNAME],[Define to the gettext package name.])
97
98 AC_CONFIG_FILES([
99         Makefile
100         po/Makefile.in
101 ])
102
103 AC_OUTPUT