forked from AuroraMiddleware/gtk
Merge branch 'cups-check-cleanup' into 'gtk-3-24'
build: only require cups >=1.7 See merge request GNOME/gtk!938
This commit is contained in:
commit
0e866fd261
@ -62,12 +62,6 @@
|
||||
/* defines whether we have HarfBuzz */
|
||||
#mesondefine HAVE_HARFBUZZ
|
||||
|
||||
/* Define to 1 if you have the `httpGetAuthString' function. */
|
||||
#mesondefine HAVE_HTTPGETAUTHSTRING
|
||||
|
||||
/* Define if cups http_t authstring field is accessible */
|
||||
#mesondefine HAVE_HTTP_AUTHSTRING
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#mesondefine HAVE_INTTYPES_H
|
||||
|
||||
|
@ -74,12 +74,6 @@
|
||||
/* Define if gio-unix is available */
|
||||
/* #undef HAVE_GIO_UNIX */
|
||||
|
||||
/* Define to 1 if you have the `httpGetAuthString' function. */
|
||||
/* #undef HAVE_HTTPGETAUTHSTRING */
|
||||
|
||||
/* Define if cups http_t authstring field is accessible */
|
||||
/* #undef HAVE_HTTP_AUTHSTRING */
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#if !defined (_MSC_VER) || (_MSC_VER >= 1800)
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
21
configure.ac
21
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)
|
||||
@ -1543,22 +1544,6 @@ else
|
||||
PRINT_BACKENDS="$PRINT_BACKENDS cups"
|
||||
AM_CONDITIONAL(HAVE_CUPS, true)
|
||||
have_cups=yes
|
||||
|
||||
gtk_save_cflags="$CFLAGS"
|
||||
CFLAGS="$CUPS_CFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#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)
|
||||
|
||||
gtk_save_libs="$LIBS"
|
||||
LIBS="$CUPS_LIBS"
|
||||
AC_CHECK_FUNCS(httpGetAuthString)
|
||||
LIBS="$gtk_save_libs"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -709,13 +709,7 @@ _post_send (GtkCupsRequest *request)
|
||||
httpClearFields (request->http);
|
||||
httpSetField (request->http, HTTP_FIELD_CONTENT_LENGTH, length);
|
||||
httpSetField (request->http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
|
||||
#ifdef HAVE_HTTPGETAUTHSTRING
|
||||
httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, httpGetAuthString (request->http));
|
||||
#else
|
||||
#ifdef HAVE_HTTP_AUTHSTRING
|
||||
httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, request->http->authstring);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (httpPost (request->http, request->resource))
|
||||
{
|
||||
@ -1198,13 +1192,7 @@ _get_send (GtkCupsRequest *request)
|
||||
}
|
||||
|
||||
httpClearFields (request->http);
|
||||
#ifdef HAVE_HTTPGETAUTHSTRING
|
||||
httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, httpGetAuthString (request->http));
|
||||
#else
|
||||
#ifdef HAVE_HTTP_AUTHSTRING
|
||||
httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, request->http->authstring);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (httpGet (request->http, request->resource))
|
||||
{
|
||||
|
@ -73,18 +73,12 @@ 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
|
||||
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')
|
||||
endif
|
||||
libcups = cc.find_library('cups', required : true)
|
||||
if libcups.found() and cc.has_function('httpGetAuthString', dependencies : libcups)
|
||||
cdata.set('HAVE_HTTPGETAUTHSTRING', 1)
|
||||
endif
|
||||
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
|
||||
cups_error = 'Need CUPS version >= 2.0'
|
||||
libcups = cc.find_library('cups', required : true)
|
||||
endif
|
||||
else
|
||||
cups_error = 'Cannot find CUPS headers in default prefix.'
|
||||
|
Loading…
Reference in New Issue
Block a user