[gnome-settings-daemon] build: improve CUPS detection



commit d985e7b10b0f1373cc6d049c9677e1268a6c07b3
Author: Saleem Abdulrasool <compnerd compnerd org>
Date:   Wed Mar 2 10:56:18 2011 -0800

    build: improve CUPS detection
    
    https://bugzilla.gnome.org/show_bug.cgi?id=644063

 configure.ac |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 43b660b..d5e113a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -404,12 +404,14 @@ AC_ARG_ENABLE(cups,
               enable_cups=yes)
 
 if test x"$enable_cups" != x"no" ; then
+   AC_PROG_SED
+
    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"`
+  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],,
                    AC_MSG_ERROR([CUPS headers not found but CUPS support requested]))
@@ -419,7 +421,9 @@ if test x"$enable_cups" != x"no" ; then
       AC_MSG_ERROR([CUPS 1.4 or newer not found, but CUPS support requested])
    fi
 
-   CUPS_LIBS=-lcups
+   CUPS_CFLAGS=`$CUPS_CONFIG --cflags | $SED -e 's/-O\w*//g' -e 's/-m\w*//g'`
+   CUPS_LIBS=`$CUPS_CONFIG --libs`
+   AC_SUBST(CUPS_CFLAGS)
    AC_SUBST(CUPS_LIBS)
 fi
 



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