1 # Copyright (c) 2006,2007 Nokia Corporation
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 # * Neither the name of the Nokia Corporation nor the names of its
14 # contributors may be used to endorse or promote products derived from
15 # this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18 # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20 # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 # OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 AC_INIT([modest],[1.0],[http://maemo.org])
30 AC_CONFIG_HEADERS([config.h])
32 AC_CONFIG_SRCDIR(src/modest-main.c)
33 AM_INIT_AUTOMAKE([dist-bzip2])
35 # Check for gettext support
36 GETTEXT_PACKAGE=modest
37 AC_SUBST(GETTEXT_PACKAGE)
38 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", ["Description"])
42 MODEST_LOCALE_DIR='$prefix/${DATADIRNAME}/locale'
43 AM_GLIB_DEFINE_LOCALEDIR([MODEST_LOCALE_DIR])
48 if test x$prefix = xNONE; then
59 # Option to enable debugging
61 [AC_HELP_STRING([ --enable-debug],[Debugging (default=no)])],
62 [with_debug=yes], [with_debug=no])
64 if test "x$with_debug" == "xyes" ; then
65 CFLAGS="$CFLAGS -ggdb -O0 -DDEBUG -Wall"
67 CFLAGS="$CFLAGS -O2 -Wall"
71 dnl # GLib/Gobject/Gtk/Gconf => mandatory
72 PKG_CHECK_MODULES(MODEST_GSTUFF,glib-2.0 >= 2.6 gobject-2.0 gtk+-2.0 >= 2.6 gconf-2.0 gnome-vfs-2.0 libgtkhtml-3.8 libtinymail-1.0 libtinymail-camel-1.0 libtinymail-gnomevfs-1.0 libtinymailui-1.0 libtinymailui-gtk-1.0)
73 AC_SUBST(MODEST_GSTUFF_CFLAGS)
74 AC_SUBST(MODEST_GSTUFF_LIBS)
76 dnl dnl now, determine what to build
77 AC_MSG_NOTICE([Determining what platform to build])
78 PKG_CHECK_MODULES(LIBOSSO,libosso,[with_platform=maemo],true)
81 [--with-platform=gnome platform to build for [gnome]],
82 [case "${with_platform}" in
83 gnome) MODEST_PLATFORM=gnome;;
84 maemo) MODEST_PLATFORM=maemo;;
85 *) MODEST_PLATFORM=${with_platform}
86 esac], [MODEST_PLATFORM=gnome
88 AC_SUBST(MODEST_PLATFORM)
91 if test "x$with_platform" = "xmaemo"; then
93 PKG_CHECK_MODULES(HILDON, hildon-1 >= 0.9.9, hildon1=yes, hildon1=no)
94 if test "$hildon1" == "yes"; then # the 'new' hildon
95 PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO, conic libtinymail-maemo-1.0 hildon-1 libosso libhildonmime osso-addressbook-1.0 wpeditor libossohelp libebook-1.2 libalarm)
98 PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO, conic libtinymail-maemo-1.0 hildon-libs >= 0.12.0 libosso libossomime libossohelp osso-addressbook-1.0 wpeditor libebook-1.2 libalarm gnome-vfs-module-2.0)
99 AC_DEFINE_UNQUOTED(MODEST_HILDON_VERSION_0, 1, ["The Hildon version we support."])
102 AC_SUBST(MODEST_LIBTINYMAIL_MAEMO_CFLAGS)
103 AC_SUBST(MODEST_LIBTINYMAIL_MAEMO_LIBS)
105 AC_DEFINE_UNQUOTED(MODEST_PLATFORM_MAEMO, 1, ["Whether modest is being built for the Maemo platform."])
107 desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
108 serviceentrydir=`$PKG_CONFIG dbus-glib-1 --variable=prefix`/share/dbus-1/services
109 localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
110 pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
111 icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
112 icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
113 icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
114 icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
115 icon_scalabledir=$datadir/icons/hicolor/scalable/hildon
116 pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
117 plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`
122 # Define as variables in Makefiles
123 AC_SUBST(desktopentrydir)
124 AC_SUBST(serviceentrydir)
127 AC_SUBST(icon_26x26dir)
128 AC_SUBST(icon_34x34dir)
129 AC_SUBST(icon_40x40dir)
130 AC_SUBST(icon_50x50dir)
131 AC_SUBST(icon_scalabledir)
132 AC_SUBST(pluginlibdir)
133 AC_SUBST(plugindesktopentrydir)
135 # warnings are errors, but don't check format errors, because
136 # it breaks with logical id's
137 CFLAGS="$CFLAGS -Wno-format-extra-args -Werror"
140 PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_GNOME_DESKTOP,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8 gtk+-2.0 >= 2.10)
141 AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_CFLAGS)
142 AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS)
143 AC_DEFINE_UNQUOTED(MODEST_PLATFORM_GNOME, 1, ["Whether modest is being built for the GNOME platform."])
145 # no dbus api for gnome
151 dnl do we have the easy setup stuff?
153 if test -d src/${with_platform}/easysetup; then
155 AC_DEFINE_UNQUOTED(MODEST_HAVE_EASYSETUP, 1, ["Whether the easysetup feature is available."])
157 # Just check that the dependency exists:
158 PKG_CHECK_MODULES(MODEST_PROVIDERS_DATA, modest-providers-data)
160 # Get the location of the ISO-Codes (currencies, languages) files:
161 AC_DEFINE_UNQUOTED([MODEST_PROVIDERS_DATA_PATH],["`$PKG_CONFIG --variable=path modest-providers-data`"],[modest-providers-data file path])
163 AM_CONDITIONAL(MODEST_HAVE_EASYSETUP,test x$have_easysetup = xtrue)
166 dnl ## setup the testing framework (ie., make check)
169 AC_HELP_STRING([--enable-tests],
170 [Build tests (no, yes)]),
171 [case "${enableval}" in
174 *) build_tests=false ;;
175 esac],[build_tests=false])
176 AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xtrue)
180 dnl ## is the check package installed?
181 if test x$build_tests = xtrue; then
182 PKG_CHECK_MODULES(CHECK, check >= 0.9.4 glib-2.0)
187 dnl ## do we want documentation (gtk-doc)
190 AC_HELP_STRING([--enable-docs],
191 [Build documentation (yes, no)]),
192 [case "${enableval}" in
195 *) build_docs=false ;;
196 esac],[build_docs=false])
197 AM_CONDITIONAL(BUILD_DOCS, test x$build_docs = xtrue)
202 dnl Intltool utility programs
203 #AC_PROG_INTLTOOL([0.33.0],[no-xml])
212 src/dbus_api/Makefile
215 src/maemo/easysetup/Makefile
218 docs/reference/Makefile
220 tests/dbus_api/Makefile
221 src/maemo/modest.desktop
222 src/maemo/com.nokia.modest.service
223 libmodest-dbus-client/Makefile
224 libmodest-dbus-client/libmodest-dbus-client-1.0.pc
229 echo "modest configure results"
230 echo "-----------------------------------"
231 echo "Platform : $with_platform"
232 echo "Build easy setup : $have_easysetup"
233 echo "Build tests : $build_tests"
234 echo "Build docs : $build_docs"
235 echo "Debug version : $with_debug"
237 echo "NOTE: you should do a 'make clean' after changing architecture or platform (--with-platform=)"