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])
15 AC_SUBST([KEYRING_VALAFLAGS],[])
17 AM_INIT_AUTOMAKE([1.11 -Wall foreign subdir-objects tar-pax no-dist-gzip dist-xz])
18 AM_SILENT_RULES([yes])
19 AM_MAINTAINER_MODE([enable])
23 AC_CHECK_FUNCS_ONCE(geteuid getpwuid)
25 # Checks for programs.
26 PKG_PROG_PKG_CONFIG([0.23])
39 SERVER_IPC_MODULE="msrpc-glib2-1.0"
40 CLIENT_IPC_MODULE="msrpc-mingw-1.0"
48 # We require dbus-glib for the client library even if we are using GDBus
49 # in the server. The reason we can't always use dbus-glib in the server is
50 # because Vala drops support for it, but as it ships with DBus there is very
51 # little danger of it being dropped by distros any time soon.
52 CLIENT_IPC_MODULE="dbus-glib-1"
53 SERVER_IPC_MODULE="dbus-glib-1"
55 PKG_CHECK_MODULES([MAC],
56 [gtk-mac-integration >= 1.0.1]
65 PKG_CHECK_MODULES([KEYRING],
67 [KEYRING_VALAFLAGS=" --pkg libsecret-1 --define LIBSECRET_KEYRING"],
69 PKG_CHECK_MODULES([KEYRING], [gnome-keyring-1],
70 [KEYRING_VALAFLAGS="--pkg moonshot-gnome-keyring --define GNOME_KEYRING"],
71 [AC_ERROR(["Neither gnome-keyring not libsecret is found])
76 # We require dbus-glib for the client library even if we are using GDBus
77 # in the server. The reason we can't always use dbus-glib in the server is
78 # because Vala drops support for it, but as it ships with DBus there is very
79 # little danger of it being dropped by distros any time soon.
80 CLIENT_IPC_MODULE="dbus-glib-1"
81 PKG_CHECK_MODULES([GDBUS],
83 [SERVER_IPC_MODULE="gio-2.0"],
84 [SERVER_IPC_MODULE="dbus-glib-1"]
91 # For all platforms: Use Gtk+3.0 if available; else revert to Gtk+2.0
92 PKG_CHECK_MODULES([GTK],
94 [GTK_VERSION="gtk+-3.0"],
95 [PKG_CHECK_MODULES([GTK],
97 [GTK_VERSION="gtk+-2.0"]
100 AC_SUBST(GTK_VERSION)
103 # For all platforms: If Log4Vala is enabled, then Use Log4Vala 0.2 if available; else revert to 0.1
104 if [test x$log4vala = xtrue]; then
105 PKG_CHECK_MODULES([LOG4VALA],
107 [LOG4VALA_VERSION="log4vala-0.2"],
108 [PKG_CHECK_MODULES([LOG4VALA],
110 [LOG4VALA_VERSION="log4vala-0.1"]
113 AC_SUBST(LOG4VALA_VERSION)
117 # For all platforms: Use gee-0.8 if available; else revert to gee-1.0
118 # (yes, gee-0.8 is an upgrade from gee-1.0!)
119 PKG_CHECK_MODULES([LIB_GEE],
121 [GEE_VERSION="gee-0.8"],
122 [PKG_CHECK_MODULES([LIB_GEE],
124 [GEE_VERSION="gee-1.0"]
127 AC_SUBST(GEE_VERSION)
129 #enable the optional use of Log4Vala (Must have the package installed!)
130 AC_ARG_ENABLE([log4vala],
131 [ --enable-log4vala Enable use of log4vala for logging],
132 [case "${enableval}" in
133 yes) log4vala=true ;;
134 no) log4vala=false ;;
135 *) AC_MSG_ERROR([bad value ${enableval} for --enable-log4vala]) ;;
136 esac],[log4vala=false])
137 AM_CONDITIONAL([LOG4VALA], [test x$log4vala = xtrue])
140 AM_CONDITIONAL([OS_LINUX], [test "$linux" = "yes"])
141 AM_CONDITIONAL([OS_WIN32], [test "$win32" = "yes"])
142 AM_CONDITIONAL([OS_MACOS], [test "$macos" = "yes"])
144 AM_CONDITIONAL([IPC_MSRPC], [test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"])
145 AM_CONDITIONAL([IPC_DBUS], [test "$SERVER_IPC_MODULE" != "msrpc-glib2-1.0"])
146 AM_CONDITIONAL([IPC_DBUS_GLIB], [test "$SERVER_IPC_MODULE" = "dbus-glib-1"])
147 AM_CONDITIONAL([IPC_GDBUS], [test "$SERVER_IPC_MODULE" = "gio-2.0"])
149 vala_version=`$VALAC --version | sed 's/Vala *//'`
150 AS_VERSION_COMPARE(["$vala_version"], [0.11.1],
151 [gio_vapi_uses_arrays="no"],
152 [gio_vapi_uses_arrays="yes"],
153 [gio_vapi_uses_arrays="yes"])
154 AM_CONDITIONAL([GIO_VAPI_USES_ARRAYS], [test "$gio_vapi_uses_arrays" = "yes"])
155 if test "$SERVER_IPC_MODULE" = "dbus-glib-1"; then
156 AC_MSG_CHECKING([$VALAC is no greater than 0.12.1])
157 AS_VERSION_COMPARE([0.12.2], ["$vala_version"],
158 [vala_supports_dbus_glib="no"],
159 [vala_supports_dbus_glib="no"],
160 [vala_supports_dbus_glib="yes"])
162 AC_MSG_RESULT([$vala_supports_dbus_glib])
163 if test "$vala_supports_dbus_glib" = "no"; then
165 *** Vala 0.12.1 or earlier is required for dbus-glib support. Newer versions
166 *** require that you have GLib 2.26 or newer (for GDBus support).])
170 if test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"; then
172 AC_PATH_MSRPC_MINGW([0.1.0], :,
174 *** msrpc-mingw 0.1.0 or better is required.]))
176 AC_PATH_PROG([MIDL], [midl], no,
177 [/c/Program\ Files/Microsoft\ SDKs/Windows/v7.0/Bin$PATH_SEPARATOR$PATH])
178 if test "$MIDL" = "no"; then
180 *** Could not find the Microsoft interface compiler MIDL.EXE.
181 *** This program is available as part of the MS Windows SDK, in
182 *** the Win32 Development Tools package. If it is not in the PATH
183 *** or its default location you may set the 'MIDL' environment
184 *** variable to point to its location and rerun configure.])
188 if test "$win32" = "yes"; then
189 # Other Windows-specific tools
191 # LIB.EXE from MSVC to build an MSVC-compatible import library.
192 AC_PATH_PROG([MSVC_LIB], [lib], no,
193 [/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])
195 if test "$MSVC_LIB" = "no"; then
197 *** Could not find the Microsoft 'LIB.EXE' program. This is required
198 *** to build the Visual C import library for libmoonshot. Use the
199 *** MSVC_LIB environment variable to pass its location if this is
200 *** outside the PATH.])
204 # ImageMagick for the 'make icons' target. Note that
205 # c:/windows/system32/convert.exe is nothing to do with ImageMagick.
206 AC_PATH_PROG([IMAGEMAGICK_CONVERT], [convert], no,
207 [/c/Program\ Files/ImageMagick$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/ImageMagick$PATH_SEPARATOR$PATH])
209 if test "$IMAGEMAGICK_CONVERT" = "no" || test "$IMAGEMAGICK_CONVERT" = "/c/windows/system32/convert"; then
211 *** Could not find ImageMagick convert.exe. This is required for the
212 *** 'make icons' target. Use the IMAGEMAGICK_CONVERT environment
213 *** variable to pass its location if this is outside the PATH.])
217 # Windows Installer XML tools
218 AC_PATH_PROG([WIX_CANDLE], [candle], no,
219 [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
220 AC_PATH_PROG([WIX_LIGHT], [light], no,
221 [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
223 if test "$WIX_CANDLE" = "no" || test "$WIX_LIGHT" = "no"; then
225 *** Could not find the Windows Installer XML tools. These are required
226 *** for the 'make installer' target. Use the WIX_CANDLE and WIX_LIGHT
227 *** environment variables to pass their locations if they are outside
232 if test "$linux" = "yes"; then
233 AC_PATH_PROG([UPDATE_MIME_DATABASE], [update-mime-database], [no])
234 if test "$UPDATE_MIME_DATABASE" = "no"; then
236 *** Could not find the Freedesktop.org mime database update tool.
237 *** Web provisioning files could not be automatically installed.])
239 AC_PATH_PROG([UPDATE_DESKTOP_DATABASE], [update-desktop-database], [no])
240 if test "$UPDATE_DESKTOP_DATABASE" = "no"; then
242 *** Could not find the Freedesktop.org desktop entry database update
243 *** tool. Web provisioning files could not be automatically installed.])
247 MOONSHOT_APP="$bindir/moonshot"
248 MOONSHOT_WEBP="$bindir/moonshot-webp"
252 AC_SUBST(IMAGEMAGICK_CONVERT)
255 AC_SUBST(UPDATE_MIME_DATABASE)
256 AC_SUBST(UPDATE_DESKTOP_DATABASE)
257 AC_SUBST(MOONSHOT_APP)
258 AC_SUBST(MOONSHOT_WEBP)
261 PKG_CHECK_MODULES(moonshot,[
272 PKG_CHECK_MODULES(libmoonshot,[
277 AM_GNU_GETTEXT([external])
278 AM_GNU_GETTEXT_VERSION([0.17])
280 AC_SUBST([GETTEXT_PACKAGE],[PACKAGE_TARNAME])
281 AC_DEFINE([GETTEXT_PACKAGE],[PACKAGE_TARNAME],[Define to the gettext package name.])
287 moonshot-webp.desktop