-
-dnl ========= Check for libgnomeprintui
-AC_ARG_ENABLE(gnome-print,
- [AC_HELP_STRING([--disable-gnome-print], [Compile without print support])],
- enable_gnome_print="$enableval",
- enable_gnome_print=yes)
-
-if test x$enable_gnome_print = xyes; then
- PKG_CHECK_MODULES(GNOME_PRINT,
- libgnomeprintui-2.2 >= $LIBGNOMEPRINTUI_REQUIRED,
- enable_gnome_print=yes, enable_gnome_print=no)
+dnl ========= Print support
+AC_ARG_WITH(print,
+ [AC_HELP_STRING([--with-print=no/gtk/gnome/auto], [Compile with print support [default=auto]])],
+ PRINT=$withval,
+ PRINT="auto")
+
+PKG_CHECK_MODULES(GNOME_PRINT,
+ libgnomeprintui-2.2 >= $LIBGNOMEPRINTUI_REQUIRED,
+ enable_gnome_print=yes, enable_gnome_print=no)
+PKG_CHECK_MODULES(GTK_PRINT,
+ gtk+-unix-print-2.0 >= $GTK_PRINT_REQUIRED,
+ enable_gtk_print=yes, enable_gtk_print=no)
+enable_print=no
+if test x$PRINT = xgnome -a x$enable_gnome_print = xyes; then
+ enable_print=gnome
+else
+ if test x$PRINT = xgtk -a x$enable_gtk_print = xyes; then
+ enable_print=gtk
+ else
+ if test x$PRINT = xauto; then
+ if test x$enable_gtk_print = xyes; then
+ enable_print=gtk
+ else
+ if test x$enable_gnome_print = xyes; then
+ enable_print=gnome
+ fi
+ fi
+ fi
+ fi