* add support for GtkWidget settings
[modest] / configure.ac
1 dnl configure.ac for modest 
2 dnl Time-stamp: <2006-07-21 09:30:11 (djcb)>
3 dnl written by Dirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
4
5 AC_INIT([modest],[0.0.1],[http://maemo.org])
6 AC_CONFIG_HEADERS([config.h])
7
8 AC_CONFIG_SRCDIR(src/modest-main.c)
9 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION)
10
11 if test x$prefix = xNONE; then
12    prefix=/usr/local
13 fi
14 AC_SUBST(prefix)
15
16 AC_PROG_CC
17 AM_PROG_CC_C_O
18 AM_PROG_CC_STDC
19 AC_HEADER_STDC
20 AC_PROG_LIBTOOL
21
22 # check for perl
23 AC_CHECK_PROG([perl])
24 GTK_DOC_CHECK([1.0])
25
26 dnl # GLib/Gobject/Gtk/Gconf => mandatory
27 PKG_CHECK_MODULES(MODEST_GSTUFF,glib-2.0 >= 2.6 gobject-2.0 gtk+-2.0 >= 2.6 gconf-2.0 libgtkhtml-3.8 libglade-2.0 libtinymail-1.0 libtinymail-camel-1.0 libtinymailui-1.0 libtinymailui-gtk-1.0 camel-1.2) 
28 AC_SUBST(MODEST_GSTUFF_CFLAGS)
29 AC_SUBST(MODEST_GSTUFF_LIBS)
30
31 dnl now, determine what to build
32 AC_MSG_NOTICE([Determining what platform to build])
33 PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO,libosso,[with_platform=hildon],true)
34
35 AC_ARG_WITH(platform,
36 [--with-platform=gtk            platform to build for [gtk]],
37 [case "${with_platform}" in
38       gtk)    MODEST_PLATFORM_DIR=gtk;;
39       gtk2)   MODEST_PLATFORM_DIR=gtk2;;
40       hildon) MODEST_PLATFORM_DIR=hildon;;
41       *)      MODEST_PLATFORM_DIR=${with_platform}
42 esac], [MODEST_PLATFORM_DIR=gtk
43        with_platform=gtk])
44 AC_SUBST(MODEST_PLATFORM_DIR)
45         
46 if test "x$with_platform" = "xhildon"; then
47    PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO,libtinymail-maemo-1.0 hildon-libs hildon-lgpl libosso)
48    AC_SUBST(MODEST_LIBTINYMAIL_MAEMO_CFLAGS)
49    AC_SUBST(MODEST_LIBTINYMAIL_MAEMO_LIBS) 
50 else
51    PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_GNOME_DESKTOP,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8)
52    AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_CFLAGS)
53    AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS)
54 fi
55
56 AM_CONDITIONAL(OLD_UI_STUFF, test x$with_platform != xgtk2)
57
58 AC_OUTPUT([
59 Makefile
60 src/Makefile
61 src/gtk/Makefile
62 src/gtk2/Makefile
63 src/hildon/Makefile
64 src/hildon/com.nokia.modest.service
65 src/hildon/modest.desktop.in
66 src/widgets/Makefile
67 docs/Makefile
68 docs/reference/Makefile
69 ])
70
71 echo
72 echo "modest configure results"
73 echo "-----------------------------------"
74 echo "Platform       : $with_platform"
75 echo ""
76 echo "NOTE: you should do a 'make clean' after changing platform (--with-platform=)"
77 echo ""