4 [moonshot-community@jiscmail.ac.uk],
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])
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])
19 # Checks for programs.
20 PKG_PROG_PKG_CONFIG([0.23])
33 SERVER_IPC_MODULE="msrpc-glib2-1.0"
34 CLIENT_IPC_MODULE="msrpc-mingw-1.0"
35 PKG_CHECK_MODULES([GTK],
37 [GTK_VERSION="gtk+-2.0"]
46 # We require dbus-glib for the client library even if we are using GDBus
47 # in the server. The reason we can't always use dbus-glib in the server is
48 # because Vala drops support for it, but as it ships with DBus there is very
49 # little danger of it being dropped by distros any time soon.
50 CLIENT_IPC_MODULE="dbus-glib-1"
51 SERVER_IPC_MODULE="dbus-glib-1"
53 PKG_CHECK_MODULES([MAC],
54 [gtk-mac-integration >= 1.0.1]
57 # TODO: Move to GTK+-3
59 # [GTK_VERSION="gtk+-3.0"]
60 PKG_CHECK_MODULES([GTK],
62 [GTK_VERSION="gtk+-2.0"]
71 # We require dbus-glib for the client library even if we are using GDBus
72 # in the server. The reason we can't always use dbus-glib in the server is
73 # because Vala drops support for it, but as it ships with DBus there is very
74 # little danger of it being dropped by distros any time soon.
75 CLIENT_IPC_MODULE="dbus-glib-1"
76 PKG_CHECK_MODULES([GDBUS],
78 [SERVER_IPC_MODULE="gio-2.0"],
79 [SERVER_IPC_MODULE="dbus-glib-1"]
81 # TODO: Move to GTK+-3
83 # [GTK_VERSION="gtk+-3.0"]
84 PKG_CHECK_MODULES([GTK],
86 [GTK_VERSION="gtk+-2.0"]
92 AM_CONDITIONAL([OS_LINUX], [test "$linux" = "yes"])
93 AM_CONDITIONAL([OS_WIN32], [test "$win32" = "yes"])
94 AM_CONDITIONAL([OS_MACOS], [test "$macos" = "yes"])
96 AM_CONDITIONAL([IPC_MSRPC], [test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"])
97 AM_CONDITIONAL([IPC_DBUS], [test "$SERVER_IPC_MODULE" != "msrpc-glib2-1.0"])
98 AM_CONDITIONAL([IPC_DBUS_GLIB], [test "$SERVER_IPC_MODULE" = "dbus-glib-1"])
99 AM_CONDITIONAL([IPC_GDBUS], [test "$SERVER_IPC_MODULE" = "gio-2.0"])
101 if test "$SERVER_IPC_MODULE" = "dbus-glib-1"; then
102 AC_MSG_CHECKING([$VALAC is no greater than 0.12.1])
103 vala_version=`$VALAC --version | sed 's/Vala *//'`
104 AS_VERSION_COMPARE([0.12.2], ["$vala_version"],
105 [vala_supports_dbus_glib="no"],
106 [vala_supports_dbus_glib="no"],
107 [vala_supports_dbus_glib="yes"])
109 AC_MSG_RESULT([$vala_supports_dbus_glib])
110 if test "$vala_supports_dbus_glib" = "no"; then
112 *** Vala 0.12.1 or earlier is required for dbus-glib support. Newer versions
113 *** require that you have GLib 2.26 or newer (for GDBus support).])
117 if test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"; then
119 AC_PATH_MSRPC_MINGW([0.1.0], :,
121 *** msrpc-mingw 0.1.0 or better is required.]))
123 AC_PATH_PROG([MIDL], [midl], no,
124 [/c/Program\ Files/Microsoft\ SDKs/Windows/v7.0/Bin$PATH_SEPARATOR$PATH])
125 if test "$MIDL" = "no"; then
127 *** Could not find the Microsoft interface compiler MIDL.EXE.
128 *** This program is available as part of the MS Windows SDK, in
129 *** the Win32 Development Tools package. If it is not in the PATH
130 *** or its default location you may set the 'MIDL' environment
131 *** variable to point to its location and rerun configure.])
135 if test "$win32" = "yes"; then
136 # Other Windows-specific tools
138 # LIB.EXE from MSVC to build an MSVC-compatible import library.
139 AC_PATH_PROG([MSVC_LIB], [lib], no,
140 [/c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/VC/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 9.0/VC/bin$PATH_SEPARATOR$PATH])
142 if test "$MSVC_LIB" = "no"; then
144 *** Could not find the Microsoft 'LIB.EXE' program. This is required
145 *** to build the Visual C import library for libmoonshot. Use the
146 *** MSVC_LIB environment variable to pass its location if this is
147 *** outside the PATH.])
151 # ImageMagick for the 'make icons' target. Note that
152 # c:/windows/system32/convert.exe is nothing to do with ImageMagick.
153 AC_PATH_PROG([IMAGEMAGICK_CONVERT], [convert], no,
154 [/c/Program\ Files/ImageMagick$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/ImageMagick$PATH_SEPARATOR$PATH])
156 if test "$IMAGEMAGICK_CONVERT" = "no" || test "$IMAGEMAGICK_CONVERT" = "/c/windows/system32/convert"; then
158 *** Could not find ImageMagick convert.exe. This is required for the
159 *** 'make icons' target. Use the IMAGEMAGICK_CONVERT environment
160 *** variable to pass its location if this is outside the PATH.])
164 # Windows Installer XML tools
165 AC_PATH_PROG([WIX_CANDLE], [candle], no,
166 [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
167 AC_PATH_PROG([WIX_LIGHT], [light], no,
168 [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
170 if test "$WIX_CANDLE" = "no" || test "$WIX_LIGHT" = "no"; then
172 *** Could not find the Windows Installer XML tools. These are required
173 *** for the 'make installer' target. Use the WIX_CANDLE and WIX_LIGHT
174 *** environment variables to pass their locations if they are outside
179 if test "$linux" = "yes"; then
180 AC_PATH_PROG([UPDATE_MIME_DATABASE], [update-mime-database], [no])
181 if test "$UPDATE_MIME_DATABASE" = "no"; then
183 *** Could not find the Freedesktop.org mime database update tool.
184 *** Web provisioning files could not be automatically installed.])
186 AC_PATH_PROG([UPDATE_DESKTOP_DATABASE], [update-desktop-database], [no])
187 if test "$UPDATE_DESKTOP_DATABASE" = "no"; then
189 *** Could not find the Freedesktop.org desktop entry database update
190 *** tool. Web provisioning files could not be automatically installed.])
194 MOONSHOT_APP="$bindir/moonshot"
195 MOONSHOT_WEBP="$bindir/moonshot-webp"
199 AC_SUBST(IMAGEMAGICK_CONVERT)
202 AC_SUBST(UPDATE_MIME_DATABASE)
203 AC_SUBST(UPDATE_DESKTOP_DATABASE)
204 AC_SUBST(MOONSHOT_APP)
205 AC_SUBST(MOONSHOT_WEBP)
208 PKG_CHECK_MODULES(moonshot,[
218 PKG_CHECK_MODULES(libmoonshot,[
223 AM_GNU_GETTEXT([external])
224 AM_GNU_GETTEXT_VERSION([0.17])
226 AC_SUBST([GETTEXT_PACKAGE],[PACKAGE_TARNAME])
227 AC_DEFINE([GETTEXT_PACKAGE],[PACKAGE_TARNAME],[Define to the gettext package name.])
233 moonshot-webp.desktop