- gnome) MODEST_PLATFORM=gnome;;
- maemo) MODEST_PLATFORM=maemo;;
- *) MODEST_PLATFORM=${with_platform}
-esac], [MODEST_PLATFORM=gnome
- with_platform=gnome])
+ gnome|maemo|detect) MODEST_PLATFORM=${with_platform};;
+ *) AC_MSG_ERROR([Unknown platform selected]);;
+esac], [MODEST_PLATFORM=detect])
+
+if test "$MODEST_PLATFORM" = "detect"; then
+ MODEST_PLATFORM="$detected_platform"
+ with_platform=$detected_platform
+fi
+
+if test "$with_platform" = "maemo"; then
+ MODEST_PLUGIN_DEFINES=" -DMODEST_PLATFORM_MAEMO"
+elif test "$with_platform" = "gnome"; then
+ MODEST_PLUGIN_DEFINES=" -DMODEST_PLATFORM_GNOME"
+fi
+
+dnl Whether to use maemo-launcher or not
+AC_ARG_ENABLE([maemo-launcher],
+ [AS_HELP_STRING([--enable-maemo-launcher],
+ [build with maemo-launcher support])],
+ [case "${enableval}" in
+ yes) maemo_launcher=true ;;
+ no) maemo_launcher=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-maemo-launcher]) ;;
+ esac], [maemo_launcher=false])
+if test x$maemo_launcher = xtrue
+then
+ PKG_CHECK_MODULES(MAEMO_LAUNCHER, [maemo-launcher-app])
+ AC_SUBST(MAEMO_LAUNCHER_CFLAGS)
+ AC_SUBST(MAEMO_LAUNCHER_LIBS)
+fi