-dnl ================== Xpdf aconf.h.in checks ==================================
-
-AH_TEMPLATE([HAVE_LIBSM], [Define to 1 if you have session management.])
-AH_TEMPLATE([ENABLE_NLS], [Use Native Language Support.])
-AH_TEMPLATE([HAVE_CATGETS], [Use catgets functions.])
-AH_TEMPLATE([HAVE_GETTEXT], [Use gettext functions.])
-
-dnl Optional features.
-AH_TEMPLATE([A4_PAPER],
- [Use A4 paper size instead of Letter for PostScript output.])
-AC_ARG_ENABLE(a4-paper,
- AC_HELP_STRING([--enable-a4-paper],
- [use A4 paper size instead of Letter for
- PostScript output]),
- AC_DEFINE(A4_PAPER))
-
-dnl never define NO_TEXT_SELECT, just remember this Xpdf setting.
-AH_TEMPLATE([NO_TEXT_SELECT], [Do not allow text selection.])
-
-AH_TEMPLATE([OPI_SUPPORT],
- [Include support for OPI comments.])
-AC_ARG_ENABLE(opi,
- AC_HELP_STRING([--enable-opi],
- [include support for OPI comments]),
- AC_DEFINE(OPI_SUPPORT))
-
-dnl enable these unconditionally.
-AC_DEFINE([MULTITHREADED], [1], [Enable multithreading support.])
-AC_DEFINE([TEXTOUT_WORD_LIST], [1], [Enable word list support.])
-
-AH_TEMPLATE([APPDEFDIR],
- [Directory with the Xpdf app-defaults file.])
-AC_ARG_WITH(appdef-dir,
- AC_HELP_STRING([--with-appdef-dir],
- [set app-defaults directory]),
- AC_DEFINE_UNQUOTED(APPDEFDIR, "$with_appdef_dir"))
-
-dnl Path to xpdfrc.
-dnl This ugly kludge to get the sysconfdir path is needed because
-dnl autoconf doesn't actually set the prefix variable until later.
-if test "$sysconfdir" = '${prefix}/etc'; then
- if test "x$prefix" = xNONE; then
- system_xpdfrc="$ac_default_prefix/etc/xpdfrc"
- else
- system_xpdfrc="$prefix/etc/xpdfrc"
- fi
-else
- system_xpdfrc="$sysconfdir/xpdfrc"
-fi
-AC_DEFINE_UNQUOTED(SYSTEM_XPDFRC, "$system_xpdfrc",
- [Full path for the system-wide xpdfrc file.])
-
-dnl Checks for header files.
-AC_HEADER_DIRENT
-
-dnl Switch over to C++. This will make the checks below a little
-dnl bit stricter (requiring function prototypes in include files).
-dnl (99% of xpdf is written in C++.)
-AC_LANG_CPLUSPLUS
-
-dnl Look for header that defines select() and fd_set.
-AC_MSG_CHECKING([select() and fd_set in sys/select.h and sys/bsdtypes.h])
-AC_TRY_COMPILE([#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <sys/types.h>],
- [fd_set fds;
-select(0, NULL, NULL, NULL, NULL);], 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 <stddef.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/select.h>],
- [fd_set fds;
-select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
- if test $xpdf_ok = yes; then
- AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Have sys/select.h.])
- AC_MSG_RESULT([need sys/select.h])
- else
- AC_TRY_COMPILE([#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/bsdtypes.h>],
- [fd_set fds;
-select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
- if test $xpdf_ok = yes; then
- AC_DEFINE(HAVE_SYS_BSDTYPES_H, 1, [Have sys/bsdtypes.h.])
- AC_MSG_RESULT([need sys/bsdtypes.h])
+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.5.9
+ 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.])
+ FRONTEND_LIBS="$FRONTEND_LIBS $POPPLER_LIBS"
+ SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS"
+ SHELL_CFLAGS="$SHELL_CFLAGS $POPPLER_CFLAGS"
+
+ evince_save_LIBS=$LIBS
+ LIBS="$LIBS $FRONTEND_LIBS"
+ AC_CHECK_FUNCS(poppler_page_render)
+ dnl we need latest poppler cvs head,
+ dnl this function was the last to be added
+ AC_CHECK_FUNCS(poppler_form_field_button_get_button_type)
+ AC_CHECK_FUNCS(poppler_form_field_text_get_max_len)
+ AC_CHECK_FUNCS(poppler_form_field_text_is_password)
+ 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