+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 ================== ggv checks ===================================================
+AC_ARG_WITH(gs-pkg,
+ [ --with-gs=dir Directory Where GhostScript package is installed.])
+
+if test "x$with_gs" = "x"; then
+ AC_PATH_PROG(GS_PROG, gs)
+ if test -z "$GS_PROG"; then
+ AC_MSG_ERROR(Unable to find GhostScript in the PATH. Provide the full path for GhostScript(--with-gs=PATH). You need to have Ghostscript installed in order to run evince)
+ fi
+else
+ GS_PROG=$with_gs
+fi
+
+AC_DEFINE_UNQUOTED(GS_PATH, "$GS_PROG", [Path to the 'gs' executable.])
+
+
+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
+AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS"
+AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
+AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
+dnl ======================== End of ggv checks =================================
+
+dnl ================== djvu checks ===================================================
+
+AC_ARG_ENABLE(djvu,
+ [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu=yes,enable_djvu=no)
+
+if test "x$enable_djvu" = "xyes"; then
+ AC_CHECK_HEADERS([libdjvu/ddjvuapi.h],enable_djvu=yes,enable_djvu=no,)
+fi
+
+if test "x$enable_djvu" = "xyes"; then
+ AC_CHECK_LIB([djvulibre],ddjvu_context_create,enable_djvu=yes,enable_djvu=no,"-lpthread")
+fi
+
+if test "x$enable_djvu" = "xyes"; then
+ AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
+fi
+AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
+
+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=yes,enable_dvi=no)
+
+AC_ARG_ENABLE(t1lib,
+ [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts=yes,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.])
+ 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([t1lib],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no)
+ fi
+
+ if test "x$enable_type1_fonts" = xyes; then
+ AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
+ fi
+fi
+AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
+
+
+dnl ================== End of dvi checks ===================================================
+