+
+SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS"
+SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS -lz"
+AC_SUBST(SHELL_CFLAGS)
+AC_SUBST(SHELL_LIBS)
+
+FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS"
+FRONTEND_LIBS="$FRONTEND_CORE_LIBS -lz"
+AC_SUBST(FRONTEND_CFLAGS)
+AC_SUBST(FRONTEND_LIBS)
+
+AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
+AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
+
+dnl Check for Nautilus property page build
+AC_ARG_ENABLE(nautilus,
+ AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
+ [case "${enableval}" in
+ yes) ENABLE_NAUTILUS=yes ;;
+ no) ENABLE_NAUTILUS=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
+ esac],
+ [ENABLE_NAUTILUS=yes]) dnl Default value
+
+if test x$ENABLE_NAUTILUS = "xyes" ; then
+ PKG_CHECK_MODULES(NAUTILUS, gtk+-x11-2.0 $MM gthread-2.0 libnautilus-extension,
+ [HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
+fi
+
+AC_SUBST(NAUTILUS_CFLAGS)
+AC_SUBST(NAUTILUS_LIBS)
+if test x$HAVE_NAUTILUS = "xyes"; then
+ AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
+fi
+AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")
+
+dnl GConf configuration
+AM_GCONF_SOURCE_2
+
+AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
+if test "x$GCONFTOOL" = "xno"; then
+ AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
+fi
+
+dnl ================== portability checks ===========================================
+
+dnl for backtrace()
+AC_CHECK_HEADERS([execinfo.h])
+
+dnl ================== ggv checks ===================================================
+AC_ARG_ENABLE(ps,
+ [AC_HELP_STRING([--disable-ps], [Compile without PostScript backend])],enable_ps=$enableval,enable_ps="yes")
+
+if test x$enable_ps = xyes; then
+ AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.])
+fi
+
+AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes)
+
+if test x$enable_ps = xyes; then
+
+dnl check for GS version
+AC_MSG_CHECKING(for Ghostscript version...)
+GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+AC_MSG_RESULT(found $GS_VERSION)
+if test "$GS_VERSION" -lt "7"; then
+ AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
+fi
+
+AC_ARG_WITH(gs-aa-params,
+ [AC_HELP_STRING([--with-gs-aa-params], [Define antialiasing params for ghostscript])],AA_PARAMS=$withval,
+ AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dDOINTERPOLATE"
+ )
+AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
+AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
+
+fi
+dnl ======================== End of ggv checks =================================
+
+dnl ================== tiff checks ===================================================
+AC_ARG_ENABLE(tiff,
+ [AC_HELP_STRING([--enable-tiff], [Compile with 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.])
+ FRONTEND_LIBS="$FRONTEND_LIBS -ltiff"
+ SHELL_LIBS="$SHELL_LIBS -ltiff"
+ else
+ AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
+ fi
+fi
+
+AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
+dnl ================== end of tiff checks ============================================
+
+dnl ================== djvu checks ===================================================
+
+AC_ARG_ENABLE(djvu,
+ [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=no)
+
+if test "x$enable_djvu" = "xyes"; then
+
+DJVULIBRE_REQUIRED=3.5.17
+
+PKG_CHECK_MODULES(DJVU, ddjvuapi >= $DJVULIBRE_REQUIRED, enable_djvu=yes, enable_djvu=no)
+
+ if test "x$enable_djvu" = "xyes"; then
+ AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
+ else
+ AC_MSG_WARN([
+** Djvu support is disabled since a recent version of the djvulibre
+** library was not found. You need at least djvulibre-3.5.17 which
+** can be found on http://djvulibre.djvuzone.org