GNOME Bugzilla – Bug 672182
Commit 66c99016 breaks building if cups 1.2 is not available
Last modified: 2012-03-19 01:06:36 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.
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
Review of attachment 209928 [details] [review]: makes sense
Comment on attachment 209928 [details] [review] Require cups >= 1.2 commit 80d54b45338fbf08f719efdaae08edc31bb89a73