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/])
10 AC_DEFINE(PACKAGE_URL,["http://www.project-moonshot.org"],[package URL])
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])
22 AC_CHECK_FUNCS_ONCE(geteuid getpwuid)
24 # Checks for programs.
25 PKG_PROG_PKG_CONFIG([0.23])
38 SERVER_IPC_MODULE="msrpc-glib2-1.0"
39 CLIENT_IPC_MODULE="msrpc-mingw-1.0"
47 # We require dbus-glib for the client library even if we are using GDBus
48 # in the server. The reason we can't always use dbus-glib in the server is
49 # because Vala drops support for it, but as it ships with DBus there is very
50 # little danger of it being dropped by distros any time soon.
51 CLIENT_IPC_MODULE="dbus-glib-1"
52 SERVER_IPC_MODULE="dbus-glib-1"
54 PKG_CHECK_MODULES([MAC],
55 [gtk-mac-integration >= 1.0.1]
64 # We require dbus-glib for the client library even if we are using GDBus
65 # in the server. The reason we can't always use dbus-glib in the server is
66 # because Vala drops support for it, but as it ships with DBus there is very
67 # little danger of it being dropped by distros any time soon.
68 CLIENT_IPC_MODULE="dbus-glib-1"
69 PKG_CHECK_MODULES([GDBUS],
71 [SERVER_IPC_MODULE="gio-2.0"],
72 [SERVER_IPC_MODULE="dbus-glib-1"]
79 # For all platforms: Use Gtk+3.0 if available; else revert to Gtk+2.0
80 PKG_CHECK_MODULES([GTK],
82 [GTK_VERSION="gtk+-3.0"],
83 [PKG_CHECK_MODULES([GTK],
85 [GTK_VERSION="gtk+-2.0"]
91 # For all platforms: If Log4Vala is enabled, then Use Log4Vala 0.2 if available; else revert to 0.1
92 if [test x$log4vala = xtrue]; then
93 PKG_CHECK_MODULES([LOG4VALA],
95 [LOG4VALA_VERSION="log4vala-0.2"],
96 [PKG_CHECK_MODULES([LOG4VALA],
98 [LOG4VALA_VERSION="log4vala-0.1"]
101 AC_SUBST(LOG4VALA_VERSION)
105 # For all platforms: Use gee-0.8 if available; else revert to gee-1.0
106 # (yes, gee-0.8 is an upgrade from gee-1.0!)
107 PKG_CHECK_MODULES([LIB_GEE],
109 [GEE_VERSION="gee-0.8"],
110 [PKG_CHECK_MODULES([LIB_GEE],
112 [GEE_VERSION="gee-1.0"]
115 AC_SUBST(GEE_VERSION)
117 #enable the optional use of Log4Vala (Must have the package installed!)
118 AC_ARG_ENABLE([log4vala],
119 [ --enable-log4vala Enable use of log4vala for logging],
120 [case "${enableval}" in
121 yes) log4vala=true ;;
122 no) log4vala=false ;;
123 *) AC_MSG_ERROR([bad value ${enableval} for --enable-log4vala]) ;;
124 esac],[log4vala=false])
125 AM_CONDITIONAL([LOG4VALA], [test x$log4vala = xtrue])
128 AM_CONDITIONAL([OS_LINUX], [test "$linux" = "yes"])
129 AM_CONDITIONAL([OS_WIN32], [test "$win32" = "yes"])
130 AM_CONDITIONAL([OS_MACOS], [test "$macos" = "yes"])
132 AM_CONDITIONAL([IPC_MSRPC], [test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"])
133 AM_CONDITIONAL([IPC_DBUS], [test "$SERVER_IPC_MODULE" != "msrpc-glib2-1.0"])
134 AM_CONDITIONAL([IPC_DBUS_GLIB], [test "$SERVER_IPC_MODULE" = "dbus-glib-1"])
135 AM_CONDITIONAL([IPC_GDBUS], [test "$SERVER_IPC_MODULE" = "gio-2.0"])
137 vala_version=`$VALAC --version | sed 's/Vala *//'`
138 AS_VERSION_COMPARE(["$vala_version"], [0.11.1],
139 [gio_vapi_uses_arrays="no"],
140 [gio_vapi_uses_arrays="yes"],
141 [gio_vapi_uses_arrays="yes"])
142 AM_CONDITIONAL([GIO_VAPI_USES_ARRAYS], [test "$gio_vapi_uses_arrays" = "yes"])
143 if test "$SERVER_IPC_MODULE" = "dbus-glib-1"; then
144 AC_MSG_CHECKING([$VALAC is no greater than 0.12.1])
145 AS_VERSION_COMPARE([0.12.2], ["$vala_version"],
146 [vala_supports_dbus_glib="no"],
147 [vala_supports_dbus_glib="no"],
148 [vala_supports_dbus_glib="yes"])
150 AC_MSG_RESULT([$vala_supports_dbus_glib])
151 if test "$vala_supports_dbus_glib" = "no"; then
153 *** Vala 0.12.1 or earlier is required for dbus-glib support. Newer versions
154 *** require that you have GLib 2.26 or newer (for GDBus support).])
158 if test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"; then
160 AC_PATH_MSRPC_MINGW([0.1.0], :,
162 *** msrpc-mingw 0.1.0 or better is required.]))
164 AC_PATH_PROG([MIDL], [midl], no,
165 [/c/Program\ Files/Microsoft\ SDKs/Windows/v7.0/Bin$PATH_SEPARATOR$PATH])
166 if test "$MIDL" = "no"; then
168 *** Could not find the Microsoft interface compiler MIDL.EXE.
169 *** This program is available as part of the MS Windows SDK, in
170 *** the Win32 Development Tools package. If it is not in the PATH
171 *** or its default location you may set the 'MIDL' environment
172 *** variable to point to its location and rerun configure.])
176 if test "$win32" = "yes"; then
177 # Other Windows-specific tools
179 # LIB.EXE from MSVC to build an MSVC-compatible import library.
180 AC_PATH_PROG([MSVC_LIB], [lib], no,
181 [/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])
183 if test "$MSVC_LIB" = "no"; then
185 *** Could not find the Microsoft 'LIB.EXE' program. This is required
186 *** to build the Visual C import library for libmoonshot. Use the
187 *** MSVC_LIB environment variable to pass its location if this is
188 *** outside the PATH.])
192 # ImageMagick for the 'make icons' target. Note that
193 # c:/windows/system32/convert.exe is nothing to do with ImageMagick.
194 AC_PATH_PROG([IMAGEMAGICK_CONVERT], [convert], no,
195 [/c/Program\ Files/ImageMagick$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/ImageMagick$PATH_SEPARATOR$PATH])
197 if test "$IMAGEMAGICK_CONVERT" = "no" || test "$IMAGEMAGICK_CONVERT" = "/c/windows/system32/convert"; then
199 *** Could not find ImageMagick convert.exe. This is required for the
200 *** 'make icons' target. Use the IMAGEMAGICK_CONVERT environment
201 *** variable to pass its location if this is outside the PATH.])
205 # Windows Installer XML tools
206 AC_PATH_PROG([WIX_CANDLE], [candle], no,
207 [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
208 AC_PATH_PROG([WIX_LIGHT], [light], no,
209 [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
211 if test "$WIX_CANDLE" = "no" || test "$WIX_LIGHT" = "no"; then
213 *** Could not find the Windows Installer XML tools. These are required
214 *** for the 'make installer' target. Use the WIX_CANDLE and WIX_LIGHT
215 *** environment variables to pass their locations if they are outside
220 if test "$linux" = "yes"; then
221 AC_PATH_PROG([UPDATE_MIME_DATABASE], [update-mime-database], [no])
222 if test "$UPDATE_MIME_DATABASE" = "no"; then
224 *** Could not find the Freedesktop.org mime database update tool.
225 *** Web provisioning files could not be automatically installed.])
227 AC_PATH_PROG([UPDATE_DESKTOP_DATABASE], [update-desktop-database], [no])
228 if test "$UPDATE_DESKTOP_DATABASE" = "no"; then
230 *** Could not find the Freedesktop.org desktop entry database update
231 *** tool. Web provisioning files could not be automatically installed.])
235 MOONSHOT_APP="$bindir/moonshot"
236 MOONSHOT_WEBP="$bindir/moonshot-webp"
240 AC_SUBST(IMAGEMAGICK_CONVERT)
243 AC_SUBST(UPDATE_MIME_DATABASE)
244 AC_SUBST(UPDATE_DESKTOP_DATABASE)
245 AC_SUBST(MOONSHOT_APP)
246 AC_SUBST(MOONSHOT_WEBP)
249 PKG_CHECK_MODULES(moonshot,[
260 PKG_CHECK_MODULES(libmoonshot,[
265 AM_GNU_GETTEXT([external])
266 AM_GNU_GETTEXT_VERSION([0.18.1])
268 AC_SUBST([GETTEXT_PACKAGE],[PACKAGE_TARNAME])
269 AC_DEFINE([GETTEXT_PACKAGE],[PACKAGE_TARNAME],[Define to the gettext package name.])
275 moonshot-webp.desktop