-dnl Look for header that defines FD_ZERO.
-AC_MSG_CHECKING([FD_ZERO and strings.h or bstring.h])
-AC_TRY_COMPILE([#include <stdlib.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif],
-[fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
-if test $xpdf_ok = yes; then
- AC_MSG_RESULT([not needed])
-else
- AC_TRY_COMPILE([#include <stdlib.h>
-#include <sys/types.h>
-#include <strings.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif],
- [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
- if test $xpdf_ok = yes; then
- AC_DEFINE(HAVE_STRINGS_H, 1, [Have strings.h.])
- AC_MSG_RESULT([need strings.h])
- else
- AC_TRY_COMPILE([#include <stdlib.h>
-#include <sys/types.h>
-#include <bstring.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif],
- [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
- if test $xpdf_ok = yes; then
- AC_DEFINE(HAVE_BSTRING_H, 1, [Have bstring.h.])
- AC_MSG_RESULT([need bstring.h])
+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 Check for thumbnailer build
+AC_ARG_ENABLE(thumbnailer,
+ AC_HELP_STRING([--disable-thumbnailer],[disable the GNOME thumbnailer]),
+ [case "${enableval}" in
+ yes) ENABLE_THUMBNAILER=yes ;;
+ no) ENABLE_THUMBNAILER=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-thumbnailer) ;;
+ esac],
+ [ENABLE_THUMBNAILER=yes]) dnl Default value
+AM_CONDITIONAL(ENABLE_THUMBNAILER, test x$ENABLE_THUMBNAILER = "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])
+
+AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[
+ AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available])
+ ],[],[#include <langinfo.h>])
+
+dnl ================== pdf checks ===================================================
+AC_ARG_ENABLE(pdf,
+ [AC_HELP_STRING([--enable-pdf], [Compile with pdf support])],enable_pdf="$enableval",enable_pdf=yes)
+
+if test "x$enable_pdf" = "xyes"; then
+ POPPLER_REQUIRED=0.6
+ PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED,enable_pdf=yes,enable_pdf=no)
+
+ if test "x$enable_pdf" = "xyes"; then
+ AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.])
+ SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS"
+ SHELL_CFLAGS="$SHELL_CFLAGS $POPPLER_CFLAGS"
+
+ evince_save_LIBS=$LIBS
+ LIBS="$LIBS $POPPLER_LIBS"
+ AC_CHECK_FUNCS(poppler_page_render)
+ AC_CHECK_FUNCS(poppler_page_render_for_printing)
+ AC_CHECK_FUNCS(poppler_page_get_image)
+ LIBS=$evince_save_LIBS
+
+ PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
+ if test x$enable_cairo_pdf == xyes; then
+ AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available])
+ fi
+
+ PKG_CHECK_MODULES(CAIRO_PS, cairo-ps, enable_cairo_ps=yes, enable_cairo_ps=no)
+ if test x$enable_cairo_ps == xyes; then
+ AC_DEFINE([HAVE_CAIRO_PS], [1], [defined if cairo-ps is available])
+ fi