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])
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"
41 PKG_CHECK_MODULES([GTK],
43 [GTK_VERSION="gtk+-2.0"]
52 # We require dbus-glib for the client library even if we are using GDBus
53 # in the server. The reason we can't always use dbus-glib in the server is
54 # because Vala drops support for it, but as it ships with DBus there is very
55 # little danger of it being dropped by distros any time soon.
56 CLIENT_IPC_MODULE="dbus-glib-1"
57 SERVER_IPC_MODULE="dbus-glib-1"
59 PKG_CHECK_MODULES([MAC],
60 [gtk-mac-integration >= 1.0.1]
63 # TODO: Move to GTK+-3
65 # [GTK_VERSION="gtk+-3.0"]
66 PKG_CHECK_MODULES([GTK],
68 [GTK_VERSION="gtk+-2.0"]
77 # We require dbus-glib for the client library even if we are using GDBus
78 # in the server. The reason we can't always use dbus-glib in the server is
79 # because Vala drops support for it, but as it ships with DBus there is very
80 # little danger of it being dropped by distros any time soon.
81 CLIENT_IPC_MODULE="dbus-glib-1"
82 PKG_CHECK_MODULES([GDBUS],
84 [SERVER_IPC_MODULE="gio-2.0"],
85 [SERVER_IPC_MODULE="dbus-glib-1"]
87 # TODO: Move to GTK+-3
89 # [GTK_VERSION="gtk+-3.0"]
90 PKG_CHECK_MODULES([GTK],
92 [GTK_VERSION="gtk+-2.0"]
98 AM_CONDITIONAL([OS_LINUX], [test "$linux" = "yes"])
99 AM_CONDITIONAL([OS_WIN32], [test "$win32" = "yes"])
100 AM_CONDITIONAL([OS_MACOS], [test "$macos" = "yes"])
102 AM_CONDITIONAL([IPC_MSRPC], [test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"])
103 AM_CONDITIONAL([IPC_DBUS], [test "$SERVER_IPC_MODULE" != "msrpc-glib2-1.0"])
104 AM_CONDITIONAL([IPC_DBUS_GLIB], [test "$SERVER_IPC_MODULE" = "dbus-glib-1"])
105 AM_CONDITIONAL([IPC_GDBUS], [test "$SERVER_IPC_MODULE" = "gio-2.0"])
107 if test "$SERVER_IPC_MODULE" = "dbus-glib-1"; then
108 AC_MSG_CHECKING([$VALAC is no greater than 0.12.1])
109 vala_version=`$VALAC --version | sed 's/Vala *//'`
110 AS_VERSION_COMPARE([0.12.2], ["$vala_version"],
111 [vala_supports_dbus_glib="no"],
112 [vala_supports_dbus_glib="no"],
113 [vala_supports_dbus_glib="yes"])
115 AC_MSG_RESULT([$vala_supports_dbus_glib])
116 if test "$vala_supports_dbus_glib" = "no"; then
118 *** Vala 0.12.1 or earlier is required for dbus-glib support. Newer versions
119 *** require that you have GLib 2.26 or newer (for GDBus support).])
123 if test "$SERVER_IPC_MODULE" = "msrpc-glib2-1.0"; then
125 AC_PATH_MSRPC_MINGW([0.1.0], :,
127 *** msrpc-mingw 0.1.0 or better is required.]))
129 AC_PATH_PROG([MIDL], [midl], no,
130 [/c/Program\ Files/Microsoft\ SDKs/Windows/v7.0/Bin$PATH_SEPARATOR$PATH])
131 if test "$MIDL" = "no"; then
133 *** Could not find the Microsoft interface compiler MIDL.EXE.
134 *** This program is available as part of the MS Windows SDK, in
135 *** the Win32 Development Tools package. If it is not in the PATH
136 *** or its default location you may set the 'MIDL' environment
137 *** variable to point to its location and rerun configure.])
141 if test "$win32" = "yes"; then
142 # Other Windows-specific tools
144 # LIB.EXE from MSVC to build an MSVC-compatible import library.
145 AC_PATH_PROG([MSVC_LIB], [lib], no,
146 [/c/Program\ Files/Microsoft\ Visual\ Studio\ 10.0/VC/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 10.0/VC/bin$PATH_SEPARATOR$PATH])
148 if test "$MSVC_LIB" = "no"; then
150 *** Could not find the Microsoft 'LIB.EXE' program. This is required
151 *** to build the Visual C import library for libmoonshot. Use the
152 *** MSVC_LIB environment variable to pass its location if this is
153 *** outside the PATH.])
157 # ImageMagick for the 'make icons' target. Note that
158 # c:/windows/system32/convert.exe is nothing to do with ImageMagick.
159 AC_PATH_PROG([IMAGEMAGICK_CONVERT], [convert], no,
160 [/c/Program\ Files/ImageMagick$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/ImageMagick$PATH_SEPARATOR$PATH])
162 if test "$IMAGEMAGICK_CONVERT" = "no" || test "$IMAGEMAGICK_CONVERT" = "/c/windows/system32/convert"; then
164 *** Could not find ImageMagick convert.exe. This is required for the
165 *** 'make icons' target. Use the IMAGEMAGICK_CONVERT environment
166 *** variable to pass its location if this is outside the PATH.])
170 # Windows Installer XML tools
171 AC_PATH_PROG([WIX_CANDLE], [candle], 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])
173 AC_PATH_PROG([WIX_LIGHT], [light], no,
174 [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
175 AC_PATH_PROG([WIX_LIT], [lit], no,
176 [/c/Program\ Files/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR/c/Program\ Files\ \(x86\)/Windows\ Installer\ XML\ v3.5/bin$PATH_SEPARATOR$PATH])
178 if test "$WIX_CANDLE" = "no" || test "$WIX_LIGHT" = "no" || test "$WIX_LIT" = "no"; then
180 *** Could not find the Windows Installer XML tools. These are required
181 *** for the 'make installer' target. Use the WIX_CANDLE, WIX_LIGHT,and
182 *** WIX_LIT environment variables to pass their locations if they are
183 *** outside the PATH.])
187 if test "$linux" = "yes"; then
188 AC_PATH_PROG([UPDATE_MIME_DATABASE], [update-mime-database], [no])
189 if test "$UPDATE_MIME_DATABASE" = "no"; then
191 *** Could not find the Freedesktop.org mime database update tool.
192 *** Web provisioning files could not be automatically installed.])
194 AC_PATH_PROG([UPDATE_DESKTOP_DATABASE], [update-desktop-database], [no])
195 if test "$UPDATE_DESKTOP_DATABASE" = "no"; then
197 *** Could not find the Freedesktop.org desktop entry database update
198 *** tool. Web provisioning files could not be automatically installed.])
202 MOONSHOT_APP="$bindir/moonshot"
203 MOONSHOT_WEBP="$bindir/moonshot-webp"
207 AC_SUBST(IMAGEMAGICK_CONVERT)
210 AC_SUBST(UPDATE_MIME_DATABASE)
211 AC_SUBST(UPDATE_DESKTOP_DATABASE)
212 AC_SUBST(MOONSHOT_APP)
213 AC_SUBST(MOONSHOT_WEBP)
216 PKG_CHECK_MODULES(moonshot,[
226 PKG_CHECK_MODULES(libmoonshot,[
231 AM_GNU_GETTEXT([external])
232 AM_GNU_GETTEXT_VERSION([0.17])
234 AC_SUBST([GETTEXT_PACKAGE],[PACKAGE_TARNAME])
235 AC_DEFINE([GETTEXT_PACKAGE],[PACKAGE_TARNAME],[Define to the gettext package name.])
241 moonshot-webp.desktop