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

Michael Sweet mike at easysw.com
Tue May 28 08:56:04 GMT 2002


The DJ wrote:
> on 28-05-2002 16:55, Michael Sweet at mike at easysw.com wrote:
> 
> 
>>The DJ wrote:
>>
>>>on 28-05-2002 16:04, Michael Sweet at mike at easysw.com wrote:
>>>
>>>
>>>
>>>>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... :)
>>>
>>>
>>>
>>>Is it correct that the make process still reports: "Using LIBS = -lcups"?
>>
>>It shouldn't if you did:
>>
>>   autoconf
>>   ./configure --disable-cups ... other options ...
>>
>>after applying the patch...
> 
> 
> 
> No joy. It looks like the automatic-dectection is overriding the
> --disable-cups value or something.
> ...

OK, I'm awake now and it's an easy fix; change "ac_cv_enable_cups"
to "enable_cups", and then autoconf/configure again.

Updated patch is attached...



-- 
______________________________________________________________________
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 15:55:05 -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$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