-dnl ================== ggv checks ===================================================
-AC_ARG_ENABLE(ps,
- [AC_HELP_STRING([--disable-ps], [Compile without PostScript backend])],enable_ps=$enableval,enable_ps="yes")
+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
+
+ POPPLER_MAJOR_VERSION=`$PKG_CONFIG --modversion poppler-glib | sed 's/0\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\?/\1/'`
+ POPPLER_MINOR_VERSION=`$PKG_CONFIG --modversion poppler-glib | sed 's/0\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\?/\3/'`
+ if test -z "$POPPLER_MINOR_VERSION"; then
+ POPPLER_MINOR_VERSION=0
+ fi