After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 672182 - Commit 66c99016 breaks building if cups 1.2 is not available
Commit 66c99016 breaks building if cups 1.2 is not available
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-03-15 19:37 UTC by Anselm Kruis
Modified: 2012-03-19 01:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Preliminary patch (518 bytes, patch)
2012-03-15 19:37 UTC, Anselm Kruis
none Details | Review
Require cups >= 1.2 (6.84 KB, patch)
2012-03-16 13:20 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description Anselm Kruis 2012-03-15 19:37:47 UTC
Created attachment 209878 [details] [review]
Preliminary patch

Git commit 66c99016d3d063aee0e00793da8f087c80172012 breaks compiling if cups API 1.2 is not available. This commit is a fix for bug #543520.
See https://bugzilla.gnome.org/show_bug.cgi?id=543520#c44

Details: 
I have a custom build environment, that contains cups 1.1.22 only. configure correctly detects, that cups API 1.2 is not available. As a consequence the feature macro HAVE_CUPS_API_1_2 is not defined in config.h

The source file modules/printbackends/cups/gtkprintbackendcups.c does not compile.

Output from gcc:
gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../gtk -I../../../gtk
-I../../../gdk -I../../../gdk -DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED -pthread
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pango-1.0
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/libpng12 -I/usr/X11R6/include -I/usr/include/gdk-pixbuf-2.0
-I/usr/include/atk-1.0 -DG_ENABLE_DEBUG -DG_ERRORCHECK_MUTEXES
-DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES
-DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES
-I/usr/X11R6/include -DGDK_PIXBUF_DISABLE_DEPRECATED -O2 -g -pipe -m64 -Wall
-MT gtkprintbackendcups.lo -MD -MP -MF .deps/gtkprintbackendcups.Tpo -c
gtkprintbackendcups.c  -fPIC -DPIC -o .libs/gtkprintbackendcups.o
gtkprintbackendcups.c: In function `add_cups_options':
gtkprintbackendcups.c:516: error: `ppd_coption_t' undeclared (first use in this
function)
gtkprintbackendcups.c:516: error: (Each undeclared identifier is reported only
once
gtkprintbackendcups.c:516: error: for each function it appears in.)
gtkprintbackendcups.c:516: error: `coption' undeclared (first use in this
function)
gtkprintbackendcups.c:520: warning: implicit declaration of function
`ppdFindCustomOption'


The type ppd_coption_t and the function ppdFindCustomOption are part of the cups 1.2 API. The problematic code around line 516 was added with commit 66c99016d3d063aee0e00793da8f087c80172012. This code fails to guard the usage of the cups 1.2 API with appropriate #ifdef HAVE_CUPS_API_1_2 ... #endif preprocessor macros.

I have added an preliminary patch, that makes the code compilable again, but I'm not sure that my patch is the right way to fix this problem.
Comment 1 Javier Jardón (IRC: jjardon) 2012-03-16 13:20:16 UTC
Created attachment 209928 [details] [review]
Require cups >= 1.2

All supported versions of major distros (Debian stable, Ubuntu, Fedora, OpenSuse) are using 1.4 or greater, so lets require 1.2 as a minimum
Comment 2 Matthias Clasen 2012-03-18 01:53:37 UTC
Review of attachment 209928 [details] [review]:

makes sense
Comment 3 Javier Jardón (IRC: jjardon) 2012-03-19 01:06:16 UTC
Comment on attachment 209928 [details] [review]
Require cups >= 1.2

commit 80d54b45338fbf08f719efdaae08edc31bb89a73