-dnl Check for mkstemps, just like mkstemp.
-AC_CACHE_CHECK([for mkstemps],
-xpdf_cv_func_mkstemps,
-[AC_TRY_LINK([#include <stdlib.h>
-#include <unistd.h>],
-[mkstemps("foo", 0);],
-xpdf_cv_func_mkstemps=yes, xpdf_cv_func_mkstemps=no)])
-if test "$xpdf_cv_func_mkstemps" = yes; then
- AC_DEFINE(HAVE_MKSTEMPS, 1, [Have mkstemps().])
+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
+ AC_CHECK_HEADERS([libdjvu/ddjvuapi.h],enable_djvu=yes,enable_djvu=no,)
+
+ if test "x$enable_djvu" = "xyes"; then
+ AC_CHECK_LIB([djvulibre],ddjvu_context_create,enable_djvu=yes,enable_djvu=no,"-lpthread")
+ AC_CHECK_LIB([djvulibre],ddjvu_document_get_pageinfo,enable_djvu=yes,enable_djvu=no,"-lpthread")
+ fi
+
+ 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.15 which
+** can be found on http://djvulibre.djvuzone.org
+])
+ fi