+dnl ================== impress book checks ===================================================
+
+AC_ARG_ENABLE(impress,
+ [AS_HELP_STRING([--enable-impress],
+ [Compile with support for impress presentations])],
+ [enable_impress=$enableval],
+ [enable_impress=no])
+
+if test "x$enable_impress" = "xyes"; then
+ AC_DEFINE([ENABLE_IMPRESS], [1], [Enable support for impress.])
+fi
+AM_CONDITIONAL(ENABLE_IMPRESS, test x$enable_impress = xyes)
+
+dnl ================== End of impress book checks ============================================
+
+dnl =================== Mime types list ====================================================
+
+if test "x$enable_pdf" = "xyes" ; then
+ EVINCE_MIME_TYPES="application/pdf;application/x-bzpdf;application/x-gzpdf;"
+fi
+if test "x$enable_ps" = "xyes" ; then
+ EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;"
+fi
+if test "x$enable_dvi" = "xyes"; then
+ EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-dvi;application/x-bzdvi;application/x-gzdvi;"
+fi
+if test "x$enable_djvu" = "xyes"; then
+ EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/vnd.djvu;"
+fi
+if test "x$enable_tiff" = "xyes"; then
+ EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/tiff;"
+fi
+if test "x$enable_comics" = "xyes"; then
+ EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;"
+fi
+if test "x$enable_pixbuf" = "xyes"; then
+ EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/*;"
+fi
+if test "x$enable_impress" = "xyes"; then
+ EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/vnd.sun.xml.impress;application/vnd.oasis.opendocument.presentation;"
+fi
+AC_SUBST(EVINCE_MIME_TYPES)
+
+AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
+
+# *****************
+# Help files
+# *****************
+
+GNOME_DOC_INIT([], gnome_doc_utils=yes, gnome_doc_utils=no)
+
+AC_ARG_ENABLE(help,
+ [AS_HELP_STRING([--disable-help], [Disable offline help files])],
+ [enable_help=$enableval],
+ [enable_help=yes])
+
+if test "x$enable_help" = "xyes" && test "x$os_win32" = "xyes" ; then
+ AC_MSG_WARN([Offline help is disabled (not implemented on Windows).])
+ enable_help=no
+fi
+
+if test "x$enable_help" = "xyes" && test "x$gnome_doc_utils" == "xno"; then
+ AC_MSG_ERROR(
+ [gnome-doc-utils not found; use --disable-help to disable help files]
+ )
+fi
+
+if test "x$enable_help" = "xyes"; then
+ AC_DEFINE([OFFLINE_HELP_ENABLED], [1], [Enable offline help])
+fi
+
+AM_CONDITIONAL(ENABLE_HELP, test "x$enable_help" = "xyes")
+
+# *****************
+# API documentation
+# *****************
+
+GTK_DOC_CHECK([1.13],[--flavour no-tmpl])
+
+AC_SUBST([GLIB_PREFIX],[$($PKG_CONFIG --variable=prefix glib-2.0)])
+AC_SUBST([GTK_PREFIX],[$($PKG_CONFIG --variable=prefix gtk+-$GTK_API_VERSION)])
+
+# ******************
+# Backends directory
+# ******************
+
+AC_SUBST([backenddir],"\$(libdir)/evince/ev_binary_version/backends")
+AC_SUBST([backend_binary_version],"ev_binary_version")
+
+# **********
+# Versioning
+# **********
+
+AC_SUBST([EV_MAJOR_VERSION],[ev_major_version])
+AC_SUBST([EV_MINOR_VERSION],[ev_minor_version])
+AC_SUBST([EV_MICRO_VERSION],[ev_micro_version])
+
+AC_SUBST([EV_API_VERSION],[ev_api_version])
+AC_SUBST([EV_API_VERSION_U],[AS_TR_SH([ev_api_version])])
+AC_SUBST([EV_BINARY_VERSION],[ev_binary_version])
+
+AC_SUBST([EV_DOCUMENT_LT_VERSION_INFO],[ev_document_lt_version_info])
+AC_SUBST([EV_DOCUMENT_LT_CURRENT_MINUS_AGE],[ev_document_lt_current_minus_age])
+AC_SUBST([EV_VIEW_LT_VERSION_INFO],[ev_view_lt_version_info])
+AC_SUBST([EV_VIEW_LT_CURRENT_MINUS_AGE],[ev_view_lt_current_minus_age])
+
+# *****************************************************************************
+# *****************************************************************************
+
+AC_CONFIG_FILES([
+backend/Makefile
+backend/comics/Makefile
+backend/djvu/Makefile
+backend/dvi/Makefile
+backend/dvi/mdvi-lib/Makefile
+backend/impress/Makefile
+backend/pdf/Makefile
+backend/pixbuf/Makefile
+backend/ps/Makefile
+backend/tiff/Makefile