-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])
+
+AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
+AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
+AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
+AM_CONDITIONAL([WITH_SMCLIENT_QUARTZ],[test "$with_smclient" = "quartz"])
+
+# ***
+
+BACKEND_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -export-symbols \$(top_srcdir)/backend/backend.symbols"
+AC_SUBST(BACKEND_LIBTOOL_FLAGS)
+
+dnl ===== Check special functions
+evince_save_LIBS=$LIBS
+LIBS="$LIBS $BACKEND_LIBS"
+AC_CHECK_FUNCS(cairo_format_stride_for_width)
+LIBS=$evince_save_LIBS
+
+# ******************
+# GKT+ Unix Printing
+# ******************
+
+AC_MSG_CHECKING([whether gtk+-unix-print support is requested])
+AC_ARG_WITH([gtk-unix-print],
+ [AS_HELP_STRING([--without-gtk-unix-print],
+ [Disable the use of gtk-unix-print])],
+ [],[case "$os_win32" in
+ yes) with_gtk_unix_print=no ;;
+ *) with_gtk_unix_print=yes ;;
+ esac])
+
+AC_MSG_RESULT([$with_gtk_unix_print])
+
+if test "$with_gtk_unix_print" = "yes"; then
+ PKG_CHECK_MODULES(GTKUNIXPRINT, [gtk+-unix-print-3.0 >= $GTK_REQUIRED])
+ AC_DEFINE([GTKUNIXPRINT_ENABLED], [1], [Define if gtk+-unix-print is enabled.])
+fi
+
+# *********************
+# GNOME Keyring support
+# *********************
+
+AC_ARG_WITH(keyring,
+ [AS_HELP_STRING([--without-keyring],
+ [Disable the use of gnome-keyring])],
+ [],
+ [case "$with_platform" in
+ gnome) with_keyring=yes ;;
+ hildon|win32) with_keyring=no ;;
+ esac])
+
+AM_CONDITIONAL([WITH_KEYRING],[test "$with_keyring" = "yes"])
+
+if test "$with_keyring" = "yes"; then
+ PKG_CHECK_MODULES(KEYRING, gnome-keyring-1 >= $KEYRING_REQUIRED)
+ AC_DEFINE([WITH_KEYRING],[1],[Define if KEYRING support is enabled])
+fi
+
+# ****
+# DBUS
+# ****
+
+AC_ARG_ENABLE([dbus],
+ [AS_HELP_STRING([--disable-dbus], [Disable support for dbus])],
+ [],
+ [case "$with_platform" in
+ gnome) enable_dbus=yes ;;
+ hildon) enable_dbus=no ;;
+ esac])
+
+if test "$enable_dbus" = "yes"; then
+ AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
+
+ PKG_CHECK_MODULES([EV_DAEMON], [gio-2.0 >= $GLIB_REQUIRED])
+fi
+
+AM_CONDITIONAL([ENABLE_DBUS], [test "$enable_dbus" = "yes"])
+
+dnl ========= Check for Desktop Schemas
+PKG_CHECK_MODULES([DESKTOP_SCHEMAS], [gsettings-desktop-schemas],
+ has_desktop_schemas=yes, has_desktop_schemas=no)
+if test x$has_desktop_schemas = xyes; then
+ AC_DEFINE([HAVE_DESKTOP_SCHEMAS], [1], [Whether GSettings Desktop Schemas are available])
+fi
+
+dnl Debug mode
+
+AC_ARG_ENABLE([debug],
+ AS_HELP_STRING([--enable-debug],
+ [Turn on evince debug mode]),
+ [enable_debug=$enableval],
+ [enable_debug=no])
+
+if test "x$enable_debug" = "xyes"; then
+ DEBUG_FLAGS="-DEV_ENABLE_DEBUG"
+fi
+
+AC_ARG_ENABLE([tests],
+ AS_HELP_STRING([--enable-tests], [Enable the tests]),
+ [enable_tests=$enableval],
+ [enable_tests=yes])
+
+AM_CONDITIONAL(ENABLE_TESTS, test x$enable_tests = xyes)
+
+LIBDOCUMENT_CFLAGS="$LIBDOCUMENT_CFLAGS $DEBUG_FLAGS"
+LIBDOCUMENT_LIBS="$LIBDOCUMENT_LIBS"
+AC_SUBST(LIBDOCUMENT_CFLAGS)
+AC_SUBST(LIBDOCUMENT_LIBS)
+
+LIBVIEW_CFLAGS="$LIBVIEW_CFLAGS $GTKUNIXPRINT_CFLAGS $DEBUG_FLAGS"
+LIBVIEW_LIBS="$LIBVIEW_LIBS $GTKUNIXPRINT_LIBS -lm"
+AC_SUBST(LIBVIEW_CFLAGS)
+AC_SUBST(LIBVIEW_LIBS)
+
+BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
+BACKEND_LIBS="$BACKEND_LIBS -lm"
+AC_SUBST(BACKEND_CFLAGS)
+AC_SUBST(BACKEND_LIBS)
+
+SHELL_CFLAGS="$SHELL_CORE_CFLAGS $KEYRING_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
+SHELL_LIBS="$SHELL_CORE_LIBS $KEYRING_LIBS -lz -lm"
+AC_SUBST(SHELL_CFLAGS)
+AC_SUBST(SHELL_LIBS)
+
+FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS $DEBUG_FLAGS"
+FRONTEND_LIBS="$FRONTEND_CORE_LIBS -lz"
+AC_SUBST(FRONTEND_CFLAGS)
+AC_SUBST(FRONTEND_LIBS)
+
+EV_DAEMON_CFLAGS="$EV_DAEMON_CFLAGS $DEBUG_FLAGS"
+AC_SUBST([EV_DAEMON_CFLAGS])
+AC_SUBST([EV_DAEMON_LIBS])
+
+# Check for Nautilus property page build
+AC_ARG_ENABLE([nautilus],
+ [AS_HELP_STRING([--disable-nautilus],
+ [Disable build of nautilus extensions])],
+ [],
+ [case "$with_platform" in
+ gnome) enable_nautilus=yes ;;
+ *) enable_nautilus=no ;;
+ esac])
+
+if test "$enable_nautilus" = "yes" ; then
+ PKG_CHECK_MODULES([NAUTILUS],[gtk+-x11-3.0 $MM gthread-2.0 libnautilus-extension >= $NAUTILUS_REQUIRED],
+ [],[AC_MSG_ERROR([libnautilus-extension not found; use --disable-nautilus to disable the nautilus extensions])])
+ NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
+ AC_SUBST([nautilusextensiondir],[$NAUTILUS_EXTENSION_DIR])
+ AC_SUBST(NAUTILUS_CFLAGS)
+ AC_SUBST(NAUTILUS_LIBS)
+
+ AC_DEFINE([HAVE_NAUTILUS],[1], [defined if you build the nautilus plugin])
+fi
+
+AM_CONDITIONAL([ENABLE_NAUTILUS],[test "$enable_nautilus" = "yes"])
+
+# Check for thumbnailer build
+
+AC_ARG_ENABLE([thumbnailer],
+ [AS_HELP_STRING([--disable-thumbnailer],
+ [Disable GNOME thumbnailer])],
+ [],
+ [case "$with_platform" in
+ hildon) enable_thumbnailer=no ;;
+ *) enable_thumbnailer=yes ;;
+ esac])
+
+AM_CONDITIONAL([ENABLE_THUMBNAILER],[test "$enable_thumbnailer" = "yes"])
+
+# ***************
+# Print Previewer
+# ***************
+
+AC_ARG_ENABLE([previewer],
+ [AS_HELP_STRING([--disable-previewer],
+ [Disable the GNOME Document Previewer])],
+ [],
+ [case "$with_platform" in
+ hildon) enable_previewer=no ;;
+ *) enable_previewer=yes ;;
+ esac])
+
+if test x$enable_previewer = "xyes" ; then
+ PKG_CHECK_MODULES([PREVIEWER],[gtk+-3.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED])
+fi
+
+AM_CONDITIONAL([ENABLE_PREVIEWER],[test "$enable_previewer" = "yes"])
+PREVIEWER_CFLAGS="$PREVIEWER_CFLAGS $GTKUNIXPRINT_CFLAGS $DEBUG_FLAGS"
+PREVIEWER_LIBS="$PREVIEWER_LIBS $GTKUNIXPRINT_LIBS -lz"
+AC_SUBST(PREVIEWER_CFLAGS)
+AC_SUBST(PREVIEWER_LIBS)
+
+# ***
+# GIR
+# ***
+
+AC_MSG_CHECKING([whether GObject introspection is requested])
+AC_ARG_ENABLE([introspection],
+ AS_HELP_STRING([--enable-introspection],
+ [Enable GObject introspection]),
+ [enable_introspection=$enableval],
+ [enable_introspection=no])
+AC_MSG_RESULT([$enable_introspection])
+
+G_IR_SCANNER=
+G_IR_COMPILER=
+G_IR_GENERATE=
+GIRDIR=
+GIRTYPELIBDIR=
+
+if test "$enable_introspection" = "yes"; then
+ GOBJECT_INTROSPECTION_REQUIRED=0.6
+ PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
+
+ G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
+ G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
+ G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
+ GIRDIR="$($PKG_CONFIG --variable=girdir gobject-introspection-1.0)"
+ GIRTYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+fi
+
+AC_SUBST([G_IR_SCANNER])
+AC_SUBST([G_IR_COMPILER])
+AC_SUBST([G_IR_GENERATE])
+AC_SUBST([GIRDIR])
+AC_SUBST([GIRTYPELIBDIR])
+
+AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
+
+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],
+ [AS_HELP_STRING([--disable-pdf],
+ [Disable the PDF support])],
+ [enable_pdf=$enableval],
+ [enable_pdf=yes])
+
+if test "x$enable_pdf" = "xyes"; then
+ POPPLER_REQUIRED=0.16.0
+ PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED,enable_pdf=yes,enable_pdf=no)
+
+ if test "x$enable_pdf" = "xyes"; then
+ 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