build: only require cups >=1.7

In 9236ee0564 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)
This commit is contained in:
Christoph Reiter 2019-06-15 09:58:38 +02:00
parent 175c400678
commit d402cd4e2e
2 changed files with 7 additions and 5 deletions

View File

@ -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)

View File

@ -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