Require CUPS >= 2.0

Drop support for versions of CUPS < 2.0, to simplify the backend code
and drop a lot of conditional blocks.
This commit is contained in:
Emmanuele Bassi
2019-05-06 20:04:17 +01:00
committed by Marek Kasik
parent 9236ee0564
commit a7e207abe2
6 changed files with 35 additions and 265 deletions

View File

@ -74,14 +74,7 @@ if enabled_print_backends.contains('cups')
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 > 1 or cups_minor_version >= 2
if cups_major_version > 1 or cups_minor_version >= 6
cdata.set('HAVE_CUPS_API_1_6', 1)
endif
if cups_major_version > 1 or cups_minor_version >= 7
cdata.set('HAVE_CUPS_API_2_0', 1)
endif
if cups_major_version >= 2
if cc.compiles('#include <cups/http.h> \n http_t http; char *s = http.authstring;')
cdata.set('HAVE_HTTP_AUTHSTRING', 1,
description :'Define if cups http_t authstring field is accessible')
@ -91,7 +84,7 @@ if enabled_print_backends.contains('cups')
cdata.set('HAVE_HTTPGETAUTHSTRING', 1)
endif
else
cups_error = 'Need CUPS version >= 1.2'
cups_error = 'Need CUPS version >= 2.0'
endif
else
cups_error = 'Cannot find CUPS headers in default prefix.'