summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <creiter@src.gnome.org>2019-06-15 09:58:38 +0200
committerChristoph Reiter <creiter@src.gnome.org>2019-06-15 10:08:46 +0200
commitd402cd4e2e71824c1fc6a78828f8df123a2d28ec (patch)
treebab1bb25298bf4e408228b11f5a2b1dd793f5a71
parent175c4006780bfe4f433d02ad28f23f2c3429d811 (diff)
downloadgtk+-d402cd4e2e71824c1fc6a78828f8df123a2d28ec.tar.gz
build: only require cups >=1.7
In 9236ee0564de the cups code was updated to use newer API with cups >= 2 and a later commit (a7e207abe) dropped the old code paths and added version checks in meson/autotools. The newly used functions were httpConnect2 and httpReconnect2 which are available since 1.7 and don't require cups 2.0. Change the versions checks to 1.7 instead so gtk can still be build with older cups (macOS 10.9 for example, see #1950)
-rw-r--r--configure.ac5
-rw-r--r--modules/printbackends/meson.build7
2 files changed, 7 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 593bc088d5..2bda3f44d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1529,8 +1529,9 @@ else
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 -lt 2; then
- AC_MSG_ERROR([CUPS >= 2.0 not found])
+ if test $CUPS_API_MAJOR -lt 1 -o \
+ $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -lt 7; then
+ AC_MSG_ERROR([CUPS >= 1.7 not found])
fi
AC_SUBST(CUPS_API_MAJOR)
diff --git a/modules/printbackends/meson.build b/modules/printbackends/meson.build
index 930b9012a8..a83dbe0561 100644
--- a/modules/printbackends/meson.build
+++ b/modules/printbackends/meson.build
@@ -73,9 +73,10 @@ if enabled_print_backends.contains('cups')
if cc.has_header('cups/cups.h')
cups_major_version = cc.compute_int('CUPS_VERSION_MAJOR', prefix : '#include <cups/cups.h>')
cups_minor_version = cc.compute_int('CUPS_VERSION_MINOR', prefix : '#include <cups/cups.h>')
- message('Found CUPS version: @0@.@1@'.format(cups_major_version, cups_minor_version))
- if cups_major_version < 2
- cups_error = 'Need CUPS version >= 2.0'
+ cups_version = '@0@.@1@'.format(cups_major_version, cups_minor_version)
+ message('Found CUPS version: @0@'.format(cups_version))
+ if cups_version.version_compare('<1.7')
+ cups_error = 'Need CUPS version >= 1.7'
else
libcups = cc.find_library('cups', required : true)
endif