[gnome-control-center] printers: Make panel required on all platforms



commit 8074a31d5e606b1a177f262edfd7bdb98a4be90e
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Feb 8 20:06:40 2017 +0100

    printers: Make panel required on all platforms
    
    All the free Unix-compatible platforms we support have CUPS support, so
    require it from the get-go.

 configure.ac            |   63 ++++++++++++++++++-----------------------------
 panels/Makefile.am      |    7 +---
 shell/Makefile.am       |    7 +---
 shell/cc-panel-loader.c |    4 ---
 4 files changed, 28 insertions(+), 53 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 74ffef3..b539b04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -266,48 +266,38 @@ if test x${have_bluetooth} = xyes; then
 fi
 
 # Check for CUPS 1.4 or newer
-AC_ARG_ENABLE([cups],
-              AS_HELP_STRING([--disable-cups], [disable CUPS support (default: enabled)]),,
-              [enable_cups=yes])
+AC_PROG_SED
 
-if test x"$enable_cups" != x"no" ; then
-  AC_PROG_SED
+AC_PATH_PROG(CUPS_CONFIG, cups-config)
 
-  AC_PATH_PROG(CUPS_CONFIG, cups-config)
-
-  if test x$CUPS_CONFIG = x; then
-    AC_MSG_ERROR([cups-config not found but CUPS support requested])
-  fi
-
-  CUPS_API_VERSION=`$CUPS_CONFIG --api-version`
-  CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | cut -d . -f 1`
-  CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | cut -d . -f 2`
-
-  AC_CHECK_HEADERS([cups/cups.h cups/http.h cups/ipp.h cups/ppd.h],,
-                   AC_MSG_ERROR([CUPS headers not found but CUPS support requested]))
+if test x$CUPS_CONFIG = x; then
+  AC_MSG_ERROR([cups-config not found])
+fi
 
-  if ! test $CUPS_API_MAJOR -gt 1 -o \
-            $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 4 ; then
-    AC_MSG_ERROR([CUPS 1.4 or newer not found, but CUPS support requested])
-  fi
+CUPS_API_VERSION=`$CUPS_CONFIG --api-version`
+CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | cut -d . -f 1`
+CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | cut -d . -f 2`
 
-  AC_DEFINE(BUILD_PRINTERS, 1, [Define to 1 to build the Printers panel])
+AC_CHECK_HEADERS([cups/cups.h cups/http.h cups/ipp.h cups/ppd.h],,
+                 AC_MSG_ERROR([CUPS headers not found]))
 
-  # https://bugzilla.gnome.org/show_bug.cgi?id=696766
-  CUPS_CPPFLAGS=""
-  if test $CUPS_API_MAJOR -gt 1 -o \
-          $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 6 ; then
-     CUPS_CPPFLAGS=-D_PPD_DEPRECATED=""
-  fi
+if ! test $CUPS_API_MAJOR -gt 1 -o \
+          $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 4 ; then
+  AC_MSG_ERROR([CUPS 1.4 or newer not found])
+fi
 
-  CUPS_CFLAGS=`$CUPS_CONFIG --cflags | $SED -e 's/-O\w*//g' -e 's/-m\w*//g'`
-  CUPS_LIBS=`$CUPS_CONFIG --libs`
-  AC_SUBST(CUPS_CPPFLAGS)
-  AC_SUBST(CUPS_CFLAGS)
-  AC_SUBST(CUPS_LIBS)
+# https://bugzilla.gnome.org/show_bug.cgi?id=696766
+CUPS_CPPFLAGS=""
+if test $CUPS_API_MAJOR -gt 1 -o \
+        $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 6 ; then
+   CUPS_CPPFLAGS=-D_PPD_DEPRECATED=""
 fi
 
-AM_CONDITIONAL(BUILD_PRINTERS, [test x"$enable_cups" = x"yes"])
+CUPS_CFLAGS=`$CUPS_CONFIG --cflags | $SED -e 's/-O\w*//g' -e 's/-m\w*//g'`
+CUPS_LIBS=`$CUPS_CONFIG --libs`
+AC_SUBST(CUPS_CPPFLAGS)
+AC_SUBST(CUPS_CFLAGS)
+AC_SUBST(CUPS_LIBS)
 
 # Optional dependency for the user accounts panel
 AC_ARG_WITH([cheese],
@@ -601,11 +591,6 @@ if test "x$have_bluetooth" = "xyes"; then
 else
        AC_MSG_NOTICE([   Bluetooth panel disabled])
 fi
-if test "x$enable_cups" = "xyes"; then
-       AC_MSG_NOTICE([** CUPS (Printers panel)])
-else
-       AC_MSG_NOTICE([   Printers panel disabled])
-fi
 if test "x$have_cheese" = "xyes"; then
        AC_MSG_NOTICE([** Cheese (Users panel webcam support)])
 else
diff --git a/panels/Makefile.am b/panels/Makefile.am
index 9961c25..507cd2f 100644
--- a/panels/Makefile.am
+++ b/panels/Makefile.am
@@ -16,16 +16,13 @@ SUBDIRS= \
        datetime \
        search \
        privacy \
-       sharing
+       sharing \
+       printers
 
 if BUILD_WACOM
 SUBDIRS += wacom
 endif
 
-if BUILD_PRINTERS
-SUBDIRS += printers
-endif
-
 if BUILD_NETWORK
 SUBDIRS += network
 endif
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 45f6363..6af3199 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -93,16 +93,13 @@ gnome_control_center_LDADD =                                                \
        $(top_builddir)/panels/sharing/libsharing.la                    \
        $(top_builddir)/panels/sound/libsound.la                        \
        $(top_builddir)/panels/universal-access/libuniversal-access.la  \
-       $(top_builddir)/panels/user-accounts/libuser-accounts.la
+       $(top_builddir)/panels/user-accounts/libuser-accounts.la        \
+       $(top_builddir)/panels/printers/libprinters.la
 
 if BUILD_WACOM
 gnome_control_center_LDADD += $(top_builddir)/panels/wacom/libwacom-properties.la
 endif
 
-if BUILD_PRINTERS
-gnome_control_center_LDADD += $(top_builddir)/panels/printers/libprinters.la
-endif
-
 if BUILD_NETWORK
 gnome_control_center_LDADD += $(top_builddir)/panels/network/libnetwork.la
 endif
diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c
index 03dbfb1..20ebb85 100644
--- a/shell/cc-panel-loader.c
+++ b/shell/cc-panel-loader.c
@@ -45,9 +45,7 @@ extern GType cc_network_panel_get_type (void);
 extern GType cc_notifications_panel_get_type (void);
 extern GType cc_goa_panel_get_type (void);
 extern GType cc_power_panel_get_type (void);
-#ifdef BUILD_PRINTERS
 extern GType cc_printers_panel_get_type (void);
-#endif /* BUILD_PRINTERS */
 extern GType cc_privacy_panel_get_type (void);
 extern GType cc_region_panel_get_type (void);
 extern GType cc_search_panel_get_type (void);
@@ -89,9 +87,7 @@ static struct {
   PANEL_TYPE("notifications",    cc_notifications_panel_get_type),
   PANEL_TYPE("online-accounts",  cc_goa_panel_get_type          ),
   PANEL_TYPE("power",            cc_power_panel_get_type        ),
-#ifdef BUILD_PRINTERS
   PANEL_TYPE("printers",         cc_printers_panel_get_type     ),
-#endif
   PANEL_TYPE("privacy",          cc_privacy_panel_get_type      ),
   PANEL_TYPE("region",           cc_region_panel_get_type       ),
   PANEL_TYPE("search",           cc_search_panel_get_type       ),


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