+ AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL],false)
+fi
+
+dnl Debug mode
+
+AC_ARG_ENABLE([debug],
+ AS_HELP_STRING([--enable-debug],
+ [Turn on evince debug mode]),
+ [enable_debug=$enableval],
+ [enable_debug=no])
+
+if test "x$enable_debug" = "xyes"; then
+ DEBUG_FLAGS="-DEV_ENABLE_DEBUG"
+fi
+
+AC_ARG_ENABLE([tests],
+ AS_HELP_STRING([--enable-tests], [Enable the tests]),
+ [enable_tests=$enableval],
+ [enable_tests=yes])
+
+AM_CONDITIONAL(ENABLE_TESTS, test x$enable_tests = xyes)
+
+LIBDOCUMENT_CFLAGS="$LIBDOCUMENT_CFLAGS $DEBUG_FLAGS"
+LIBDOCUMENT_LIBS="$LIBDOCUMENT_LIBS"
+AC_SUBST(LIBDOCUMENT_CFLAGS)
+AC_SUBST(LIBDOCUMENT_LIBS)
+
+LIBVIEW_CFLAGS="$LIBVIEW_CFLAGS $GTKUNIXPRINT_CFLAGS $DEBUG_FLAGS"
+LIBVIEW_LIBS="$LIBVIEW_LIBS $GTKUNIXPRINT_LIBS -lm"
+AC_SUBST(LIBVIEW_CFLAGS)
+AC_SUBST(LIBVIEW_LIBS)
+
+BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
+BACKEND_LIBS="$BACKEND_LIBS -lm"
+AC_SUBST(BACKEND_CFLAGS)
+AC_SUBST(BACKEND_LIBS)
+
+SHELL_CFLAGS="$SHELL_CORE_CFLAGS $KEYRING_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
+SHELL_LIBS="$SHELL_CORE_LIBS $KEYRING_LIBS -lz -lm"
+AC_SUBST(SHELL_CFLAGS)
+AC_SUBST(SHELL_LIBS)
+
+FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS $DEBUG_FLAGS"
+FRONTEND_LIBS="$FRONTEND_CORE_LIBS -lz"
+AC_SUBST(FRONTEND_CFLAGS)
+AC_SUBST(FRONTEND_LIBS)
+
+EV_DAEMON_CFLAGS="$EV_DAEMON_CFLAGS $DEBUG_FLAGS"
+AC_SUBST([EV_DAEMON_CFLAGS])
+AC_SUBST([EV_DAEMON_LIBS])
+
+# Check for Nautilus property page build
+AC_ARG_ENABLE([nautilus],
+ [AS_HELP_STRING([--disable-nautilus],
+ [Disable build of nautilus extensions])],
+ [],
+ [case "$with_platform" in
+ gnome) enable_nautilus=yes ;;
+ *) enable_nautilus=no ;;
+ esac])
+
+if test "$enable_nautilus" = "yes" ; then
+ PKG_CHECK_MODULES([NAUTILUS],[gtk+-x11-$GTK_API_VERSION $MM gthread-2.0 libnautilus-extension],
+ [],[AC_MSG_ERROR([libnautilus-extension not found; use --disable-nautilus to disable the nautilus extensions])])
+ NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
+ AC_SUBST([nautilusextensiondir],[$NAUTILUS_EXTENSION_DIR])
+ AC_SUBST(NAUTILUS_CFLAGS)
+ AC_SUBST(NAUTILUS_LIBS)
+
+ AC_DEFINE([HAVE_NAUTILUS],[1], [defined if you build the nautilus plugin])
+fi
+
+AM_CONDITIONAL([ENABLE_NAUTILUS],[test "$enable_nautilus" = "yes"])
+
+# Check for thumbnailer build
+
+AC_ARG_ENABLE([thumbnailer],
+ [AS_HELP_STRING([--disable-thumbnailer],
+ [Disable GNOME thumbnailer])],
+ [],
+ [case "$with_platform" in
+ hildon) enable_thumbnailer=no ;;
+ *) enable_thumbnailer=yes ;;
+ esac])
+
+AM_CONDITIONAL([ENABLE_THUMBNAILER],[test "$enable_thumbnailer" = "yes"])
+
+# ***************
+# Print Previewer
+# ***************
+
+AC_ARG_ENABLE([previewer],
+ [AS_HELP_STRING([--disable-previewer],
+ [Disable the GNOME Document Previewer])],
+ [],
+ [case "$with_platform" in
+ hildon) enable_previewer=no ;;
+ *) enable_previewer=yes ;;
+ esac])
+
+if test x$enable_previewer = "xyes" ; then
+ PKG_CHECK_MODULES([PREVIEWER],[gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED])
+fi
+
+AM_CONDITIONAL([ENABLE_PREVIEWER],[test "$enable_previewer" = "yes"])
+PREVIEWER_CFLAGS="$PREVIEWER_CFLAGS $GTKUNIXPRINT_CFLAGS $DEBUG_FLAGS"
+PREVIEWER_LIBS="$PREVIEWER_LIBS $GTKUNIXPRINT_LIBS -lz"
+AC_SUBST(PREVIEWER_CFLAGS)
+AC_SUBST(PREVIEWER_LIBS)
+
+# ***
+# GIR
+# ***
+
+AC_MSG_CHECKING([whether GObject introspection is requested])
+AC_ARG_ENABLE([introspection],
+ AS_HELP_STRING([--enable-introspection],
+ [Enable GObject introspection]),
+ [enable_introspection=$enableval],
+ [enable_introspection=no])
+AC_MSG_RESULT([$enable_introspection])
+
+G_IR_SCANNER=
+G_IR_COMPILER=
+G_IR_GENERATE=
+GIRDIR=
+GIRTYPELIBDIR=
+
+if test "$enable_introspection" = "yes"; then
+ GOBJECT_INTROSPECTION_REQUIRED=0.6
+ PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
+
+ G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
+ G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
+ G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
+ GIRDIR="$($PKG_CONFIG --variable=girdir gobject-introspection-1.0)"
+ GIRTYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+fi
+
+AC_SUBST([G_IR_SCANNER])
+AC_SUBST([G_IR_COMPILER])
+AC_SUBST([G_IR_GENERATE])
+AC_SUBST([GIRDIR])
+AC_SUBST([GIRTYPELIBDIR])
+
+AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
+
+dnl ================== portability checks ===========================================
+
+dnl for backtrace()
+AC_CHECK_HEADERS([execinfo.h])
+
+AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[
+ AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available])
+ ],[],[#include <langinfo.h>])
+
+dnl ================== pdf checks ===================================================
+AC_ARG_ENABLE([pdf],
+ [AS_HELP_STRING([--disable-pdf],
+ [Disable the PDF support])],
+ [enable_pdf=$enableval],
+ [enable_pdf=yes])
+
+if test "x$enable_pdf" = "xyes"; then
+ POPPLER_REQUIRED=0.14.0
+ PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED,enable_pdf=yes,enable_pdf=no)
+
+ if test "x$enable_pdf" = "xyes"; then
+ evince_save_LIBS=$LIBS
+ LIBS="$LIBS $POPPLER_LIBS"
+ AC_CHECK_FUNCS(poppler_page_get_text_layout)
+ AC_CHECK_FUNCS(poppler_page_get_selected_text)
+ AC_CHECK_FUNCS(poppler_page_add_annot)
+ LIBS=$evince_save_LIBS
+ PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
+ if test x$enable_cairo_pdf = xyes; then
+ AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available])
+ fi
+
+ PKG_CHECK_MODULES(CAIRO_PS, cairo-ps, enable_cairo_ps=yes, enable_cairo_ps=no)
+ if test x$enable_cairo_ps = xyes; then
+ AC_DEFINE([HAVE_CAIRO_PS], [1], [defined if cairo-ps is available])
+ fi
+ else
+ AC_MSG_ERROR("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found")
+ fi
+fi
+
+AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
+dnl ================== end of pdf checks ============================================
+
+dnl libspectre (used by ps and dvi backends)
+SPECTRE_REQUIRED=0.2.0
+PKG_CHECK_MODULES(SPECTRE, libspectre >= $SPECTRE_REQUIRED,have_spectre=yes,have_spectre=no)
+AM_CONDITIONAL(HAVE_SPECTRE, test x$have_spectre = xyes)
+if test "x$have_spectre" = "xyes"; then
+ AC_DEFINE([HAVE_SPECTRE], [1], [Have libspectre])
+fi
+
+dnl ================== ps checks ====================================================
+AC_ARG_ENABLE(ps,
+ [AS_HELP_STRING([--disable-ps],
+ [Disable the PostScript backend])],
+ [enable_ps=$enableval],
+ [enable_ps=yes])
+
+if test "x$enable_ps" = "xyes"; then
+ if test "x$have_spectre" = "xyes"; then
+ AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.])
+ else
+ enable_ps="no"
+ AC_MSG_WARN([PS support is disabled since libspectre (version >= $SPECTRE_REQUIRED) is needed])
+ fi
+fi
+AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes)
+dnl ======================== End of ps checks ===================================
+
+dnl ================== tiff checks ===================================================
+AC_ARG_ENABLE(tiff,
+ [AS_HELP_STRING([--disable-tiff],
+ [Disable the support of multipage tiff])],
+ [enable_tiff=$enableval],
+ [enable_tiff=yes])
+
+if test "x$enable_tiff" = "xyes"; then
+ AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
+ if test "x$enable_tiff" = "xyes"; then
+ AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
+ AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
+ fi
+ if test "x$enable_tiff" = "xyes"; then
+ AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
+ else
+ AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
+ fi