[gnome-settings-daemon] add option to explicitly disable cups



commit 05e4f662ceb2f632bc7323b0045755f19d9027f9
Author: Saleem Abdulrasool <compnerd compnerd org>
Date:   Mon Feb 21 21:10:19 2011 -0800

    add option to explicitly disable cups
    
    https://bugzilla.gnome.org/show_bug.cgi?id=643262

 configure.ac |   41 ++++++++++++++++++++---------------------
 1 files changed, 20 insertions(+), 21 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 255cd93..2a28965 100644
--- a/configure.ac
+++ b/configure.ac
@@ -396,32 +396,31 @@ AC_SUBST(POLKIT_LIBS)
 # CUPS
 # ---------------------------------------------------------------------------
 
-AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
-if test "x$CUPS_CONFIG" != "xno"; then
+AC_ARG_ENABLE(cups,
+              AS_HELP_STRING([--disable-cups], [disable CUPS support (default: enabled)]),,
+              enable_cups=yes)
+
+if test x"$enable_cups" != x"no" ; then
+   AC_PATH_PROG(CUPS_CONFIG, cups-config,
+                AC_MSG_ERROR([cups-config not found but CUPS support requested]))
+
   CUPS_API_VERSION=`$CUPS_CONFIG --api-version`
   CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | sed -e "s/\./\n/g" | sed -n "1p"`
   CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | sed -e "s/\./\n/g" | sed -n "2p"`
 
-  AC_CHECK_HEADERS([cups/cups.h cups/http.h cups/ipp.h], have_cups_headers=yes, have_cups_headers=no)
-  if test x$have_cups_headers = xyes ; then
-    if test $CUPS_API_MAJOR -gt 1 -o \
-            $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 4; then
-      have_cups=yes
-      CUPS_LIBS=-lcups
-      AC_SUBST(CUPS_LIBS)
-    else
-      have_cups=no
-      AC_MSG_WARN(*** Print-notifications plugin will not be built (CUPS 1.4 or newer not found) ***)
-    fi
-  else
-    have_cups=no
-    AC_MSG_WARN(*** Print-notifications plugin will not be built (CUPS header files not found) ***)
-  fi
-else
-  have_cups=no
-  AC_MSG_WARN(*** Print-notifications plugin will not be built (cups-config not found) ***)
+  AC_CHECK_HEADERS([cups/cups.h cups/http.h cups/ipp.h],,
+                   AC_MSG_ERROR([CUPS headers not found but CUPS support requested]))
+
+   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_LIBS=-lcups
+   AC_SUBST(CUPS_LIBS)
 fi
-AM_CONDITIONAL(BUILD_PRINT_NOTIFICATIONS, [test x$have_cups = xyes])
+
+AM_CONDITIONAL(BUILD_PRINT_NOTIFICATIONS, [test x"$enable_cups" = x"yes"])
 
 
 # ---------------------------------------------------------------------------



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