[patch] Updated CUPS support in configure script...

Michael Sweet mike at easysw.com
Tue May 28 07:09:03 GMT 2002


The attached patch (against 2.2 CVS, but it probably will apply
cleanly against HEAD, etc.) adds a "--enable-cups" option to the
configure script (and of course the corresponding --disable-cups
option) to allow SAMBA to be built without CUPS support even if
CUPS is installed on the local (build) system.

The patch also switches to using the cups-config script rather than
testing for individual headers and libraries.  This greatly simplifies
the tests and should be more portable as well (for the systems that
use the configure script, anyways... :)

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products                  mike at easysw.com
Printing Software for UNIX                       http://www.easysw.com



-------------- next part --------------
Index: configure.in
===================================================================
RCS file: /cvsroot/samba/source/configure.in,v
retrieving revision 1.130.4.144
diff -u -r1.130.4.144 configure.in
--- configure.in	16 May 2002 21:00:50 -0000	1.130.4.144
+++ configure.in	28 May 2002 14:04:47 -0000
@@ -483,16 +483,17 @@
 ############################################
 # for cups support we need libcups, and a handful of header files
 
-AC_CHECK_LIB(cups,httpConnect)
+AC_ARG_ENABLE(cups,
+[  --enable-cups           Turn on CUPS support (default=auto)])
 
-# I wonder if there is a nicer way of doing this?
+if test x$ac_cv_enable_cups != xno; then
+	AC_PATH_PROG(CUPS_CONFIG, cups-config)
 
-if test x"$ac_cv_lib_cups_httpConnect" = x"yes"; then
-        AC_CHECK_HEADERS(cups/cups.h cups/language.h)
-        if test x"$ac_cv_header_cups_cups_h" = x"yes"; then
-                if test x"$ac_cv_header_cups_language_h" = x"yes"; then
-                        AC_DEFINE(HAVE_CUPS)
-                fi
+        if test "x$CUPS_CONFIG" != x; then
+	        AC_DEFINE(HAVE_CUPS)
+		CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`"
+		LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`"
+		LIBS="$LIBS `$CUPS_CONFIG --libs`"
         fi
 fi
 


More information about the samba-technical mailing list