4 [moonshot-community@jiscmail.ac.uk],
6 [http://www.project-moonshot.org/])
8 # Remove this when we can depend on autoconf >= 2.64
9 AC_SUBST(PACKAGE_URL, [http://www.project-moonshot.org/])
11 AC_CONFIG_HEADERS([config.h])
12 AC_CONFIG_SRCDIR([configure.ac])
13 AC_CONFIG_MACRO_DIR([m4])
14 AC_CONFIG_AUX_DIR([build-aux])
16 AM_INIT_AUTOMAKE([1.11 -Wall foreign subdir-objects tar-pax no-dist-gzip dist-xz])
17 AM_SILENT_RULES([yes])
18 AM_MAINTAINER_MODE([enable])
23 # Checks for programs.
24 PKG_PROG_PKG_CONFIG([0.23])
37 SERVER_IPC_MODULE="msrpc-glib2-1.0"
38 CLIENT_IPC_MODULE="msrpc-mingw-1.0"
39 PKG_CHECK_MODULES([GTK],
41 [GTK_VERSION="gtk+-2.0"]
50 # We require dbus-glib for the client library even if we are using GDBus
51 # in the server. The reason we can't always use dbus-glib in the server is
52 # because Vala drops support for it, but as it ships with DBus there is very
53 # little danger of it being dropped by distros any time soon.
54 CLIENT_IPC_MODULE="dbus-glib-1"
55 SERVER_IPC_MODULE="dbus-glib-1"
57 PKG_CHECK_MODULES([MAC],
58 [gtk-mac-integration >= 1.0.1]
61 # TODO: Move to GTK+-3
63 # [GTK_VERSION="gtk+-3.0"]
64 PKG_CHECK_MODULES([GTK],
66 [GTK_VERSION="gtk+-2.0"]
75 # We require dbus-glib for the client library even if we are using GDBus
76 # in the server. The reason we can't always use dbus-glib in the server is
77 # because Vala drops support for it, but as it ships with DBus there is very
78 # little danger of it being dropped by distros any time soon.
79 CLIENT_IPC_MODULE="dbus-glib-1"
80 PKG_CHECK_MODULES([GDBUS],
82 [SERVER_IPC_MODULE="gio-2.0"],
83 [SERVER_IPC_MODULE="dbus-glib-1"]
85 # TODO: Move to GTK+-3
87 # [GTK_VERSION="gtk+-3.0"]
88 PKG_CHECK_MODULES([GTK],
90 [GTK_VERSION="gtk+-2.0"]
96 AM_CONDITIONAL([OS_LINUX], [test "$linux" = "yes"])
97 AM_CONDITIONAL([OS_WIN32], [test "$win32" = "yes"])
98 AM_CONDITIONAL([OS_MACOS], [test "$macos" = "yes"])
100 AM_CONDITIONAL([IPC_MSRPC], [test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"])
101 AM_CONDITIONAL([IPC_DBUS], [test "$SERVER_IPC_MODULE" != "msrpc-glib2-1.0"])
102 AM_CONDITIONAL([IPC_DBUS_GLIB], [test "$SERVER_IPC_MODULE" = "dbus-glib-1"])
103 AM_CONDITIONAL([IPC_GDBUS], [test "$SERVER_IPC_MODULE" = "gio-2.0"])
105 if test "$SERVER_IPC_MODULE" = "dbus-glib-1"; then
106 AC_MSG_CHECKING([$VALAC is no greater than 0.12.1])
107 vala_version=`$VALAC --version | sed 's/Vala *//'`
108 AS_VERSION_COMPARE([0.12.2], ["$vala_version"],
109 [vala_supports_dbus_glib="no"],
110 [vala_supports_dbus_glib="no"],
111 [vala_supports_dbus_glib="yes"])
113 AC_MSG_RESULT([$vala_supports_dbus_glib])
114 if test "$vala_supports_dbus_glib" = "no"; then
116 *** Vala 0.12.1 or earlier is required for dbus-glib support. Newer versions
117 *** require that you have GLib 2.26 or newer (for GDBus support).])
121 if test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"; then
123 AC_PATH_MSRPC_MINGW([0.1.0], :,
125 *** msrpc-mingw 0.1.0 or better is required.]))
127 AC_PATH_PROG([MIDL], [midl], no,
128 [/c/Program\ Files/Microsoft\ SDKs/Windows/v7.0/Bin$PATH_SEPARATOR$PATH])
129 if test "$MIDL" = "no"; then
131 *** Could not find the Microsoft interface compiler MIDL.EXE.
132 *** This program is available as part of the MS Windows SDK, in
133 *** the Win32 Development Tools package. If it is not in the PATH
134 *** or its default location you may set the 'MIDL' environment
135 *** variable to point to its location and rerun configure.])
139 if test "$win32" = "yes"; then
140 # Other Windows-specific tools
142 # LIB.EXE from MSVC to build an MSVC-compatible import library.
143 AC_PATH_PROG([MSVC_LIB], [lib], no,
144 [/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])
146 if test "$MSVC_LIB" = "no"; then
148 *** Could not find the Microsoft 'LIB.EXE' program. This is required
149 *** to build the Visual C import library for libmoonshot. Use the
150 *** MSVC_LIB environment variable to pass its location if this is
151 *** outside the PATH.])
155 # ImageMagick for the 'make icons' target. Note that
156 # c:/windows/system32/convert.exe is nothing to do with ImageMagick.
157 AC_PATH_PROG([IMAGEMAGICK_CONVERT], [convert], no,
158 [/c/Program\ Files/ImageMagick$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/ImageMagick$PATH_SEPARATOR$PATH])
160 if test "$IMAGEMAGICK_CONVERT" = "no" || test "$IMAGEMAGICK_CONVERT" = "/c/windows/system32/convert"; then
162 *** Could not find ImageMagick convert.exe. This is required for the
163 *** 'make icons' target. Use the IMAGEMAGICK_CONVERT environment
164 *** variable to pass its location if this is outside the PATH.])
168 # Windows Installer XML tools
169 AC_PATH_PROG([WIX_CANDLE], [candle], no,
170 [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
171 AC_PATH_PROG([WIX_LIGHT], [light], no,
172 [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
174 if test "$WIX_CANDLE" = "no" || test "$WIX_LIGHT" = "no"; then
176 *** Could not find the Windows Installer XML tools. These are required
177 *** for the 'make installer' target. Use the WIX_CANDLE and WIX_LIGHT
178 *** environment variables to pass their locations if they are outside
183 if test "$linux" = "yes"; then
184 AC_PATH_PROG([UPDATE_MIME_DATABASE], [update-mime-database], [no])
185 if test "$UPDATE_MIME_DATABASE" = "no"; then
187 *** Could not find the Freedesktop.org mime database update tool.
188 *** Web provisioning files could not be automatically installed.])
190 AC_PATH_PROG([UPDATE_DESKTOP_DATABASE], [update-desktop-database], [no])
191 if test "$UPDATE_DESKTOP_DATABASE" = "no"; then
193 *** Could not find the Freedesktop.org desktop entry database update
194 *** tool. Web provisioning files could not be automatically installed.])
198 MOONSHOT_APP="$bindir/moonshot"
199 MOONSHOT_WEBP="$bindir/moonshot-webp"
203 AC_SUBST(IMAGEMAGICK_CONVERT)
206 AC_SUBST(UPDATE_MIME_DATABASE)
207 AC_SUBST(UPDATE_DESKTOP_DATABASE)
208 AC_SUBST(MOONSHOT_APP)
209 AC_SUBST(MOONSHOT_WEBP)
212 PKG_CHECK_MODULES(moonshot,[
222 PKG_CHECK_MODULES(libmoonshot,[
227 AM_GNU_GETTEXT([external])
228 AM_GNU_GETTEXT_VERSION([0.17])
230 AC_SUBST([GETTEXT_PACKAGE],[PACKAGE_TARNAME])
231 AC_DEFINE([GETTEXT_PACKAGE],[PACKAGE_TARNAME],[Define to the gettext package name.])
237 moonshot-webp.desktop