Correctly check for presence of cups-devel
authorVolker Lendecke <vl@samba.org>
Sat, 14 Jun 2008 08:31:11 +0000 (10:31 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 14 Jun 2008 08:39:25 +0000 (10:39 +0200)
On SuSE at least cups-config belongs to cups-libs which does not contain the
headers which are in cups-devel.
(This used to be commit 2408d2493f7c6e0beee58febd547516bbeb0929d)

source3/configure.in

index 358d9da7b7b77350af46e9841c834ace14fb2cd6..f3663d72c7dc312af564d6a7befe60c75fb2bf37 100644 (file)
@@ -769,10 +769,24 @@ if test x$enable_cups != xno; then
        AC_PATH_PROG(CUPS_CONFIG, cups-config)
 
         if test "x$CUPS_CONFIG" != x; then
-                AC_DEFINE(HAVE_CUPS,1,[Whether we have CUPS])
+
+               ac_save_CFLAGS=$CFLAGS
+               ac_save_LDFLAGS=$LDFLAGS
+               ac_save_PRINT_LIBS=$PRINT_LIBS
                CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`"
                LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`"
                PRINT_LIBS="$PRINT_LIBS `$CUPS_CONFIG --libs`"
+               AC_CHECK_HEADERS(cups/cups.h cups/language.h)
+               if test x"$ac_cv_header_cups_cups_h" = xyes -a \
+                       x"$ac_cv_header_cups_language_h" = xyes; then
+                       AC_DEFINE(HAVE_CUPS,1,[Whether we have CUPS])
+               else
+                       AC_MSG_WARN([cups-config around but cups-devel not installed])
+                       CFLAGS=$ac_save_CFLAGS
+                       LDFLAGS=$ac_save_LDFLAGS
+                       PRINT_LIBS=$ac_save_PRINT_LIBS
+               fi
+
        elif test x"$enable_cups" = x"yes"; then
                AC_MSG_ERROR(Cups support required but cups-config not located.  Make sure cups-devel related files are installed.)
         fi