+dnl --------------- URI/MIME STUFF -----------
+if test "x$with_toolkit" != "xgtk"; then
+ PKG_CHECK_MODULES(MODEST_HILDON_MIME,libhildonmime,have_hildonmime=true,have_hildonmime=false)
+ if test "x$have_hildonmime" == "xtrue"; then
+ mimelib="hildon-mime"
+ AC_DEFINE_UNQUOTED(MODEST_HAVE_HILDON_MIME, 1, ["Whether hildon-mime is used."])
+ fi
+fi
+
+dnl --------------- ADDRESSBOOK --------------
+if test "x$with_platform" == "xmaemo"; then
+ PKG_CHECK_MODULES(MODEST_ABOOK, libosso-abook-1.0,have_abook=true,have_abook=false)
+
+ if test "x$have_abook" == "xtrue"; then
+
+ abook_api=`$PKG_CONFIG --modversion libosso-abook-1.0 | cut -d. -f1`
+ AC_SUBST(MODEST_ABOOK_CFLAGS)
+ AC_SUBST(MODEST_ABOOK_LIBS)
+
+ modest_save_cflags="$CFLAGS"
+ modest_save_libs="$LIBS"
+ CFLAGS="$MODEST_ABOOK_CFLAGS"
+ LIBS="$MODEST_ABOOK_LIBS"
+ AC_CHECK_FUNCS(osso_abook_contact_chooser_set_visible_func)
+ AC_SUBST(HAVE_OSSO_ABOOK_CONTACT_CHOOSER_SET_VISIBLE_FUNC)
+ CFLAGS="$modest_save_cflags"
+ LIBS="$modest_save_libs"
+
+ AC_DEFINE_UNQUOTED(OSSO_ABOOK_ENABLE_DEPRECATED, 1, ["use deprecated addressbook API"])
+ AC_DEFINE_UNQUOTED(MODEST_ABOOK_API, $abook_api, ["the API version of osso-addressbook"])
+ AC_DEFINE_UNQUOTED(MODEST_HAVE_ABOOK, 1, ["whether we have osso-addressbook"])
+ fi
+
+ # Check the presence of the calendar widgets
+ PKG_CHECK_MODULES(MODEST_CALENDAR_WIDGETS,calendar-ui-widgets,have_calendar_widgets=true,have_calendar_widgets=false)
+ AC_SUBST(MODEST_CALENDAR_WIDGETS_CFLAGS)
+ AC_SUBST(MODEST_CALENDAR_WIDGETS_LIBS)
+ if test "x$have_calendar_widgets" == "xtrue"; then
+ AC_DEFINE_UNQUOTED(MODEST_USE_CALENDAR_WIDGETS, 1, ["Use the Calendar color widgets"])
+ fi
+fi
+
+AM_CONDITIONAL(MODEST_USE_DUMMY_ADDRESS_BOOK,test "x$have_abook" != "xtrue")
+
+dnl --------------- LIBTIME --------------
+AC_CHECK_HEADERS([clockd/libtime.h], have_libtime=true, have_libtime=false)
+
+if test "x$have_libtime" == "xtrue"; then
+ AC_DEFINE_UNQUOTED(MODEST_USE_LIBTIME, 1, ["use libtime API"])
+ MODEST_LIBTIME_LIBS=-ltime
+else
+ MODEST_LIBTIME_LIBS=
+fi
+AC_SUBST(MODEST_LIBTIME_LIBS)
+
+dnl --------------- IPHB --------------
+AC_CHECK_HEADERS([iphbd/libiphb.h], have_libiphb=true, have_libiphb=false)
+
+if test "x$have_libiphb" == "xtrue"; then
+ AC_DEFINE_UNQUOTED(MODEST_USE_IPHB, 1, ["use IP Heartbeat API"])
+ MODEST_LIBIPHB_LIBS=-liphb
+else
+ MODEST_LIBIPHB_LIBS=
+fi
+AC_SUBST(MODEST_LIBIPHB_LIBS)
+
+
+dnl --------------- GETTEXT --------------
+AM_GLIB_GNU_GETTEXT
+IT_PROG_INTLTOOL([0.35.0])
+
+GETTEXT_PACKAGE=modest
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", ["gettext package"])
+
+
+dnl --------------- SETTINGS FOR MAEMO --------------
+if test "x$with_platform" == "xmaemo"; then
+
+ # warnings are errors, but don't check format errors, because
+ # it breaks with logical ids
+ CFLAGS="$CFLAGS -Wno-format-extra-args -Werror"
+
+ desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
+ serviceentrydir=`$PKG_CONFIG dbus-glib-1 --variable=prefix`/share/dbus-1/services
+ localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
+ backupsettingsdir=/etc/osso-backup/applications
+ prebackupdir=/etc/osso-backup/pre-backup.d/
+ restoredir=/etc/osso-backup/restore.d/always/
+ ossocudscriptsdir=/etc/osso-cud-scripts
+ pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
+ icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
+ icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
+ icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
+ icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
+ icon_scalabledir=$datadir/icons/hicolor/scalable/hildon
+ pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
+ plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`
+
+ dbus_api="dbus_api"
+ AC_SUBST(dbus_api)
+
+ # Define as variables in Makefiles
+ AC_SUBST(desktopentrydir)
+ AC_SUBST(serviceentrydir)
+ AC_SUBST(backupsettingsdir)
+ AC_SUBST(prebackupdir)
+ AC_SUBST(restoredir)
+ AC_SUBST(ossocudscriptsdir)
+ AC_SUBST(localedir)
+ AC_SUBST(pixmapdir)
+ AC_SUBST(icon_26x26dir)
+ AC_SUBST(icon_34x34dir)
+ AC_SUBST(icon_40x40dir)
+ AC_SUBST(icon_50x50dir)
+ AC_SUBST(icon_scalabledir)
+ AC_SUBST(pluginlibdir)
+ AC_SUBST(plugindesktopentrydir)
+else
+ desktopentrydir=$datadir/applications
+ AC_SUBST(desktopentrydir)
+fi