-dnl check for win32 platform
-AC_MSG_CHECKING([for Win32 platform])
-case "$host" in
- *-*-mingw*|*-*-cygwin*)
- platform_win32=yes
- AC_CHECK_TOOL(WINDRES, windres)
- ;;
- *)
- platform_win32=no
- ;;
-esac
-AC_MSG_RESULT([$platform_win32])
-AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
-
-AC_MSG_CHECKING([for native Win32])
-case "$host" in
- *-*-mingw*)
- os_win32=yes
- ;;
- *)
- os_win32=no
- ;;
+m4_pattern_allow([AM_V_GEN])dnl Make autoconf not complain about the rule below
+EV_INTLTOOL_EVINCE_BACKEND_RULE='%.evince-backend: %.evince-backend.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(AM_V_GEN) LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+AC_SUBST([EV_INTLTOOL_EVINCE_BACKEND_RULE])
+
+GLIB_GSETTINGS
+
+# Check which platform to use
+
+AC_MSG_CHECKING([for which platform to build])
+AC_ARG_WITH([platform],
+ [AS_HELP_STRING([--with-platform=gnome|win32|hildon],
+ [Setting platform (default: gnome)])],
+ [case "$withval" in
+ gnome|win32|hildon) ;;
+ *) AC_MSG_ERROR([invalid argument "$withval" for --with-platform]) ;;
+ esac],
+ [case "$host" in
+ *-*-mingw*|*-*-cygwin*) with_platform="win32" ;;
+ *) with_platform=gnome ;;
+ esac])
+
+AC_MSG_RESULT([$with_platform])
+
+if test "$with_platform" = "win32"; then
+ AC_CHECK_TOOL([WINDRES],[windres])
+ AC_MSG_CHECKING([for native Win32])
+ case "$host" in
+ *-*-mingw*)
+ os_win32=yes
+ ;;
+ *)
+ os_win32=no
+ ;;
+ esac
+ AC_MSG_RESULT([$os_win32])
+fi
+
+AM_CONDITIONAL([PLATFORM_HILDON],[test "$with_platform" = "hildon"])
+AM_CONDITIONAL([PLATFORM_WIN32],[test "$with_platform" = "win32"])
+
+AC_MSG_CHECKING([which gtk+ version to compile against])
+AC_ARG_WITH([gtk],
+ [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
+ [case "$with_gtk" in
+ 2.0|3.0) ;;
+ *) AC_MSG_ERROR([invalid gtk version specified]) ;;
+ esac],
+ [with_gtk=2.0])
+AC_MSG_RESULT([$with_gtk])
+
+dnl Specify required versions of dependencies
+CAIRO_REQUIRED=1.9.10
+GLIB_REQUIRED=2.25.11
+KEYRING_REQUIRED=2.22.0
+
+case "$with_gtk" in
+ 2.0) GTK_API_VERSION=2.0
+ GAIL_API_VERSION=
+ GTK_REQUIRED=2.21.5
+ ;;
+ 3.0) GTK_API_VERSION=3.0
+ GAIL_API_VERSION=-3.0
+ GTK_REQUIRED=2.90.5
+ ;;