GNOME Bugzilla – Bug 322372
Quartz backend does not build on Mac OS X v10.3
Last modified: 2007-05-16 17:18:57 UTC
I get this error while trying to build gtk+ on MacOS X 10.3 using Xcode 1.5: gcc -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMAIN=\"Gdk\" -DGDK_COMPILATION -I../.. -I../../ gdk -I../../gdk -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_ENABLE_DEBUG -pthreads -I/Users/kiko/Development/prefix/ include/glib-2.0 -I/Users/kiko/Development/prefix/lib/glib-2.0/include -I/Users/kiko/Development/ prefix/include/pango-1.0 -I/Users/kiko/Development/prefix//include/cairo -xobjective-c -I/Users/ kiko/Development/prefix/include -framework Carbon -MT GdkQuartzView.lo -MD -MP -MF .deps/ GdkQuartzView.Tpo -c GdkQuartzView.c -fno-common -DPIC -o .libs/GdkQuartzView.o gcc: unrecognized option `-pthreads' In file included from GdkQuartzView.c:22: GdkQuartzView.h:21:26: Quartz/Quartz.h: No such file or directory In file included from GdkQuartzView.c:22: GdkQuartzView.h:26: error: cannot find interface declaration for `NSView', superclass of `GdkQuartzView' make: *** [GdkQuartzView.lo] Error 1
Seems that Quartz.h is supposed to be in the Quartz framework which is only available on 10.4.
The Quartz framework is only a wrapper around some other frameworks. On Tiger, I can still build everything in gtk+/gdk/quartz if '#import <Quartz/Quartz.h>' is replaced with '#import <AppKit/AppKit.h>' in GtkQuartzView.h. AppKit is definitely available on Panther, but there may be additional things preventing Gtk/OSX from building on Panther. Could you please verify that this bug is still valid even if you change the #import?
For CoreGraphics you need to import <ApplicationServices/ApplicationServices.h>
Some APIs only available in tiger are used though. I don't remember which ones off the top of my head but it should be fairly simple to make it work on panther if someone wants to take a look at that.
(In reply to comment #4) > Some APIs only available in tiger are used though. I don't remember which ones > off the top of my head but it should be fairly simple to make it work on > panther if someone wants to take a look at that. > Why don't you just use the SDK? You can build using 10.3 API only.
Hub, I was trying to do a complete build of gtk+ and its dependencies from scratch before, using the SDKs. Unfortunately, it's a little tricky to build Makefile-based projects that way. Apparently there's a bug in Apple's ld (what else is new?) so that if it gets more than one -syslibroot flags it dies, even if they're all the same. Also, if Apple's gcc sees -isysroot then it automagically passes -syslibroot to ld. (This behavior isn't documented, of course.) Altogether, this means that the instructions Apple gives don't work (http://developer.apple.com/documentation/developertools/Conceptual/cross_development/Using/chapter_3_section_2.html#//apple_ref/doc/uid/20002000-1114311-BABGCAAB). Most projects will still work with just -isysroot in CPPFLAGS, but others still get screwed up. For example, freetype uses both CPPFLAGS and LDFLAGS in its configure tests, but then only LDFLAGS when it links libfreetype. So there's actually no combination of flags that works. Ugh. Anyhow, I think I've discovered a really ugly workaround, and I've got a build with the 10.3.9 SDK running now. I expect it will probably die somewhere in cairo or pango, we'll see.
Alright, it looks like everything builds fine up to Gtk+. Changing Quartz.h to AppKit.h in all the headers appears to work. Here are the 10.4-only APIs that we use: CGContextSetAllowsAntialiasing CGContextSetBlendMode CGContextClipToMask CGImageCreateCopy CGImageGetBitmapInfo -[NSScreen userSpaceScaleFactor]
*** This bug has been marked as a duplicate of 408518 ***