diff options
author | Johan Dahlin <johan@gnome.org> | 2008-03-05 16:43:10 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-03-05 16:43:10 +0000 |
commit | e9b26a6412980959d89bf6f07d45671965e262c4 (patch) | |
tree | f38986f9b9142252fc8dc0d91af46587435a06fc /configure.in | |
parent | 22900f7853970fbe634d390fae37998746de71fe (diff) | |
download | gtk+-e9b26a6412980959d89bf6f07d45671965e262c4.tar.gz |
Add --disable-cups option. (#513826, Alberto Ruiz)
2008-03-05 Johan Dahlin <johan@gnome.org>
* configure.in: Add --disable-cups option.
(#513826, Alberto Ruiz)
svn path=/trunk/; revision=19715
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 73 |
1 files changed, 42 insertions, 31 deletions
diff --git a/configure.in b/configure.in index cb1e8174b6..5ece1ebb76 100644 --- a/configure.in +++ b/configure.in @@ -1596,42 +1596,53 @@ LIBS="$old_LIBS" # Printing system checks ################################################################ -AC_PATH_PROG(CUPS_CONFIG, cups-config, no) -if test "x$CUPS_CONFIG" != "xno"; then - CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'` - CUPS_LIBS=`$CUPS_CONFIG --libs` - - CUPS_API_VERSION=`$CUPS_CONFIG --api-version` - CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'` - CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'` - - if test $CUPS_API_MAJOR -gt 1 -o \ - $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 2; then - AC_DEFINE(HAVE_CUPS_API_1_2) - fi +AC_ARG_ENABLE(cups, + [AC_HELP_STRING([--disable-cups] + [disable cups print backend])],, + [enable_cups=auto]) + +if test "x$enable_cups" = "xauto" +then + AC_PATH_PROG(CUPS_CONFIG, cups-config, no) + if test "x$CUPS_CONFIG" != "xno"; then + CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'` + CUPS_LIBS=`$CUPS_CONFIG --libs` + + CUPS_API_VERSION=`$CUPS_CONFIG --api-version` + CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'` + CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'` + + if test $CUPS_API_MAJOR -gt 1 -o \ + $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 2; then + AC_DEFINE(HAVE_CUPS_API_1_2) + fi - AC_SUBST(CUPS_API_MAJOR) - AC_SUBST(CUPS_API_MINOR) - AC_SUBST(CUPS_CFLAGS) - AC_SUBST(CUPS_LIBS) + AC_SUBST(CUPS_API_MAJOR) + AC_SUBST(CUPS_API_MINOR) + AC_SUBST(CUPS_CFLAGS) + AC_SUBST(CUPS_LIBS) - AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]])) -fi -AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno") + AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]])) + fi + AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno") -gtk_save_cflags="$CFLAGS" -CFLAGS="$CUPS_CFLAGS" -AC_TRY_COMPILE([#include <cups/http.h>], - [http_t http; char *s = http.authstring;], - [AC_DEFINE(HAVE_HTTP_AUTHSTRING,[],[Define if cups http_t authstring field is accessible])],) -CFLAGS="$gtk_save_cflags" + gtk_save_cflags="$CFLAGS" + CFLAGS="$CUPS_CFLAGS" + AC_TRY_COMPILE([#include <cups/http.h>], + [http_t http; char *s = http.authstring;], + [AC_DEFINE(HAVE_HTTP_AUTHSTRING,[],[Define if cups http_t authstring field is accessible])],) + CFLAGS="$gtk_save_cflags" -AC_SUBST(HAVE_HTTP_AUTHSTRING) + AC_SUBST(HAVE_HTTP_AUTHSTRING) -gtk_save_libs="$LIBS" -LIBS="$CUPS_LIBS" -AC_CHECK_FUNCS(httpGetAuthString) -LIBS="$gtk_save_libs" + gtk_save_libs="$LIBS" + LIBS="$CUPS_LIBS" + AC_CHECK_FUNCS(httpGetAuthString) + LIBS="$gtk_save_libs" + +else + AM_CONDITIONAL(HAVE_CUPS, false) +fi gtk_save_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS" |