Bug 16349

Summary: make fails with "conflicting types for 'Picture'" on Mac OS X 10.4.11 PPC
Product: cairo Reporter: cfr <reescf>
Component: quartz backendAssignee: Carl Worth <cworth>
Status: RESOLVED WORKSFORME QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: critical    
Priority: medium    
Version: 1.6.4   
Hardware: PowerPC   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:

Description cfr 2008-06-14 04:05:59 UTC
Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC
gcc 4.0.1

1) ./configure
2) edit Makefiles to replace "-include render.h renderproto.h" with "-include render.h -include renderproto.h"
[3) edit libtool to replace "-dynamiclib" with "-dynamiclib -flat_namespace"]
4) make

Have tried with and without step 3. (Without step 2, make fails much sooner.)

make fails with the following error:

gcc -DHAVE_CONFIG_H -I. -I.. -I. -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include -I/usr/local/include/libpng12 -include render.h -include renderproto.h -DXTHREADS -I/usr/local/include -I/usr/local/include/X11/extensions -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/local/include/pixman-1 -Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement -Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter -Wno-long-long -Winline -fno-strict-aliasing -g -O2 -MT libcairo_la-cairo-quartz-surface.lo -MD -MP -MF .deps/libcairo_la-cairo-quartz-surface.Tpo -c cairo-quartz-surface.c  -fno-common -DPIC -o .libs/libcairo_la-cairo-quartz-surface.o
In file included from /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h:42,
                 from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:30,
                 from ./cairo-quartz.h:43,
                 from cairo-quartz-private.h:44,
                 from cairo-quartz-surface.c:39:
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:309: error: conflicting types for 'Picture'
/usr/local/include/X11/extensions/render.h:31: error: previous declaration of 'Picture' was here
make[2]: *** [libcairo_la-cairo-quartz-surface.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Any suggestions would be very welcome.

- cfr
Comment 1 cfr 2008-06-18 17:11:33 UTC
OK. Been fiddling some...

Compile with:
export X_CFLAGS="-I/usr/local/include -I/usr/X11R6/include"
export X_LIBS="-L/usr/local/lib -L/usr/X11R6/lib"
./configure \
        xlib_xrender_CFLAGS="-I/usr/local/include -I/usr/local/include/X11/extensions -I/usr/X11R6/include -DXTHREADS" \
        xlib_xrender_LIBS="-L/usr/local/lib -lXrender  -L/usr/X11R6/lib -lX11"

make succeeds
make check fails...

edit test/cairo-test.c and test/font-options.c to replace "#include <fontconfig/fontconfig.h>" with "#include </usr/local/include/fontconfig/fontconfig.h">.

make check completes with 48 of 173 test failures. (tests requiring X11 ignored as I've never got the parts of cairo's test suite requiring X11 to work.)

Most of these are minor though some are not. What I don't really understand, though, is that some tests fail when I compile like this but succeed if I disable quartz (and don't mess with the X11 or xlib_xrender flags) for interfaces other than quartz.


e.g. text-antialias-none-image-argb32-out is fine if I compile without quartz but not if I compile with -e even though I assume this is a different "backend". (Note that I realise I do not know what I'm talking about quite a long time before this point.)

- cfr
Comment 2 Chris Wilson 2008-10-14 15:42:10 UTC
The first part sounds like something is wrong with the build environment. #include </usr/local/include/.../fontconfig.h> is just broken somewhere. I suspect this is part of the pain that Travis Griggs was trying to communicate to us about building upon Mac OS/X where every major component seems to include different versions of the same headers. Hopefully this has been improved with the build system revamp... If 1.8.x is still problematic, please tell us on the mailing list (where more casual users and certainly more Mac users) and hopefully we can improve the build instructions/system for Mac OS/X.

The second aspect is due to the long standing issue of discrepancies between the different font backends. So if you compile with xlib enabled, the default font backend will be FreeType and without you'll default to CoreFont. And it seems that for the failing tests those reference images have been generated using FreeType which differs in its rasterisation/choice of font to CoreFont.

The test suite is due to undergo an overhaul through the 1.9 development cycle and resolving the font discrepancy is one of the planned tasks.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.