[gtk+] Move print backend list to configure.ac



commit 9e1187135ec61c5f035663fa50620592214abffe
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Nov 30 23:23:31 2014 -0500

    Move print backend list to configure.ac
    
    We already juggle the print backends here, might as well
    produce the list.

 configure.ac    |   22 ++++++++++++++++++----
 gtk/Makefile.am |   30 ------------------------------
 2 files changed, 18 insertions(+), 34 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 69adbe3..58163d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1462,6 +1462,7 @@ else
 
     PRINT_BACKENDS="$PRINT_BACKENDS cups"
     AM_CONDITIONAL(HAVE_CUPS, true)
+    have_cups=yes
 
     gtk_save_cflags="$CFLAGS"
     CFLAGS="$CUPS_CFLAGS"
@@ -1521,8 +1522,9 @@ else
   PKG_CHECK_MODULES(JSON_GLIB, [json-glib-1.0], have_json_glib=yes, have_json_glib=no)
   if test "x$have_rest" = "xyes" -a "x$have_json_glib" = "xyes"; then
     PRINT_BACKENDS="$PRINT_BACKENDS cloudprint"
+    have_cloudprint=yes
   fi
-  AM_CONDITIONAL(HAVE_CLOUDPRINT, test "x$have_rest" = "xyes" -a "x$have_json_glib" = "xyes")
+  AM_CONDITIONAL(HAVE_CLOUDPRINT, test "x$have_cloudprint" = "xyes")
 fi
 
 if test "x$enable_cloudprint" = "xyes" -a "x$have_rest" = "xno"; then
@@ -1537,8 +1539,6 @@ if test "x$enable_cloudprint" = "xyes" -a "x$have_json_glib" = "xno"; then
 ])
 fi
 
-AM_CONDITIONAL(HAVE_PAPI_CUPS, test "x$have_papi" = "xyes" -a "x$CUPS_CONFIG" != "xno")
-
 gtk_save_cppflags="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
 
@@ -1558,7 +1558,6 @@ fi
 
 CPPFLAGS="$gtk_save_cppflags"
 
-
 AC_ARG_ENABLE(test-print-backend,
               [AS_HELP_STRING([--enable-test-print-backend],
                               [build test print backend])],,
@@ -1572,6 +1571,21 @@ if test "$os_win32" = "yes"; then
   AC_CHECK_TYPES([IPrintDialogCallback],[],[],[[#include <windows.h>]])
 fi
 
+GTK_PRINT_BACKENDS="file"
+if test "$have_papi" = "yes"; then
+  GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,papi"
+fi
+if test "$have_cups" = "yes"; then
+  GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,cups"
+fi
+if test "$have_papi" != "yes" -a "$have_cups" != "yes"; then
+  GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,lpr"
+fi
+if test "$have_cloudprint" = "yes"; then
+  GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,cloudprint"
+fi
+AC_SUBST(GTK_PRINT_BACKENDS)
+
 ################################################################
 # Strip -export-dynamic from the link lines of various libraries
 ################################################################
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 86b69d6..14a76a9 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -8,36 +8,6 @@ else
 GTK_PRINT_PREVIEW_COMMAND="evince --unlink-tempfile --preview --print-settings %s %f"
 endif
 
-if HAVE_CLOUDPRINT
-if HAVE_PAPI_CUPS
-GTK_PRINT_BACKENDS=file,papi,cups,cloudprint
-else
-if HAVE_CUPS
-GTK_PRINT_BACKENDS=file,cups,cloudprint
-else
-if HAVE_PAPI
-GTK_PRINT_BACKENDS=file,papi,cloudprint
-else
-GTK_PRINT_BACKENDS=file,lpr,cloudprint
-endif
-endif
-endif
-else
-if HAVE_PAPI_CUPS
-GTK_PRINT_BACKENDS=file,papi,cups
-else
-if HAVE_CUPS
-GTK_PRINT_BACKENDS=file,cups
-else
-if HAVE_PAPI
-GTK_PRINT_BACKENDS=file,papi
-else
-GTK_PRINT_BACKENDS=file,lpr
-endif
-endif
-endif
-endif
-
 AM_CPPFLAGS =                                          \
        -DG_LOG_DOMAIN=\"Gtk\"                          \
        -DGTK_LIBDIR=\"$(libdir)\"                      \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]