+dnl ================== End of djvu checks ===================================================
+
+dnl ================== dvi checks ===================================================
+
+AC_ARG_ENABLE(dvi,
+ [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=yes)
+
+AC_ARG_ENABLE(t1lib,
+ [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
+
+if test "x$enable_dvi" = "xyes"; then
+ AC_C_CONST
+ AC_C_INLINE
+ AC_TYPE_SIZE_T
+ AC_CHECK_SIZEOF(long, 4)
+ AC_CHECK_SIZEOF(int, 4)
+ AC_CHECK_SIZEOF(short, 2)
+ AC_CHECK_SIZEOF(void *, 4)
+ AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
+
+ if test "x$enable_dvi" = "xyes"; then
+ AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
+ else
+ AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
+ fi
+fi
+AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
+
+if test "x$enable_dvi" = "xyes"; then
+ if test "x$enable_type1_fonts" = "xyes"; then
+ AC_CHECK_LIB([t1],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no,[-lm])
+ fi
+
+ if test "x$enable_type1_fonts" = xyes; then
+ AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
+ fi
+else
+ enable_type1_fonts=no
+fi
+AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
+
+dnl ================== End of dvi checks ===================================================
+
+dnl ================== pixbuf checks ===================================================
+
+AC_ARG_ENABLE(pixbuf,
+ [AC_HELP_STRING([--enable-pixbuf], [Compile with support of pixbuf])],enable_pixbuf="$enableval",enable_pixbuf=no)
+if test "x$enable_pixbuf" = "xyes"; then
+ AC_DEFINE([ENABLE_PIXBUF], [1], [Enable pixbuf support.])
+fi
+AM_CONDITIONAL(ENABLE_PIXBUF, test x$enable_pixbuf = xyes)
+
+dnl ================== End of pixbuf checks ===================================================
+
+dnl ================== comic book checks ===================================================
+
+AC_ARG_ENABLE(comics,
+ [AC_HELP_STRING([--enable-comics], [Compile with support for comic book archives])],enable_comics="$enableval",enable_comics=yes)
+if test "x$enable_comics" = "xyes"; then
+ if test "x$os_win32" = "xyes"; then
+ # The comics backend is disabled on windows because:
+ # 1) it uses unix functions from sys/wait.h.
+ # 2) it uses external decompression tools not generally available on windows.
+ enable_comics=no
+ AC_MSG_WARN(The comics backend is not supported on windows.)
+ else
+ AC_DEFINE([ENABLE_COMICS], [1], [Enable support for comics.])
+ fi
+fi
+AM_CONDITIONAL(ENABLE_COMICS, test x$enable_comics = xyes)
+
+dnl ================== End of comic book checks ============================================
+
+dnl ================== impress book checks ===================================================
+
+AC_ARG_ENABLE(impress,
+ [AC_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;"
+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]))
+
+# 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_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