Bug 17001 - Build error with Gtk port on Mac OS X (r29781)
Summary: Build error with Gtk port on Mac OS X (r29781)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2008-01-24 23:19 PST by Randall Wood
Modified: 2008-01-26 02:03 PST (History)
2 users (show)

See Also:


Attachments
Patch (1.24 KB, patch)
2008-01-25 07:59 PST, Mark Rowe (bdash)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Randall Wood 2008-01-24 23:19:23 PST
I am attempting to build webkit-gtk on Mac OS X 10.5 (PPC) and am having the following error:

 /usr/bin/g++-4.0 -DHAVE_CONFIG_H -I. -I./JavaScriptCore -I./JavaScriptCore/ForwardingHeaders -I./JavaScriptCore/wtf -I./JavaScriptCore/kjs -I./DerivedSources -DBUILDING_GTK__=1 -DWTF_CHANGES -DXP_UNIX -DNDEBUG -DENABLE_ICONDATABASE=0 -I./JavaScriptCore/bindings -I./WebCore -I./WebCore/ForwardingHeaders -I./WebCore/platform -I./WebCore/platform/network -I./WebCore/platform/graphics -I./WebCore/platform/text -I./WebCore/loader -I./WebCore/loader/icon -I./WebCore/css -I./WebCore/dom -I./WebCore/page -I./WebCore/bridge -I./WebCore/editing -I./WebCore/history -I./WebCore/xml -I./WebCore/html -I./WebCore/bindings/js -I./WebCore/platform/image-decoders -I./WebCore/platform/image-decoders/bmp -I./WebCore/platform/image-decoders/gif -I./WebCore/platform/image-decoders/ico -I./WebCore/platform/image-decoders/jpeg -I./WebCore/platform/image-decoders/png -I./WebCore/platform/image-decoders/xbm -I./WebCore/plugins -I./WebCore/rendering -I./WebCore/bindings/js -DWTF_USE_CURL=1 -I./WebCore/platform/network/curl -DENABLE_DATABASE=1 -I./WebCore/platform/sql -I./WebCore/storage -DENABLE_XPATH=1 -DENABLE_XSLT=1 -I./WebKit/gtk/WebView -DBUILDING_CAIRO__=1 -DBUILD_WEBKIT -I./WebCore/platform/gtk -I./WebCore/platform/graphics/gtk -I./WebCore/platform/graphics/cairo -I./WebCore/loader/gtk -I./WebCore/page/gtk -I./WebKit/gtk/WebCoreSupport -I./WebKit/gtk/WebView -I/opt/local/include -I/opt/local/include -fno-strict-aliasing -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k -Wundef -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -fvisibility-inlines-hidden -fno-rtti -fno-exceptions -fvisibility=hidden -D_REENTRANT -DXTHREADS -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/gtk-2.0 -I/opt/local/lib/gtk-2.0/include -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include/freetype2 -I/opt/local/include/libpng12 -I/usr/X11/include -I/opt/local/include/libxml2 -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include/libxml2 -O2 -MT WebCore/page/libWebKitGtk_la-Frame.lo -MD -MP -MF WebCore/page/.deps/libWebKitGtk_la-Frame.Tpo -c WebCore/page/Frame.cpp  -fno-common -DPIC -o WebCore/page/.libs/libWebKitGtk_la-Frame.o
/opt/local/include/X11/X.h:108: error: conflicting declaration 'typedef XID Cursor'
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:269: error: 'Cursor' has a previous declaration as 'typedef struct Cursor Cursor'
make[1]: *** [WebCore/page/libWebKitGtk_la-Frame.lo] Error 1
make: *** [all] Error 2

Complete logs are at http://homepage.mac.com/rhwood/webkit/r29781/install.log

It seems to me that perhaps something is trying to use QuickDraw because I am on a Mac, despite my wanting to build the gtk version?
Comment 1 Mark Rowe (bdash) 2008-01-25 02:34:57 PST
I'm curious what is pulling in the QuickDraw headers.  It may or may not be a bug that they are being pulled in when building the Gtk port on Mac OS X.  One way to find out where they are being included from is to intentionally introduce an error into the header.  For example, you could edit:

/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h

and add a "#error Why am I here?" line somewhere near the beginning.  Then when you build, GCC will emit an error which will mention which file is including the one triggering the error.
Comment 2 Randall Wood 2008-01-25 05:09:04 PST
Adding the error message results in:

...[blah blah blah]...
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 /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:24,
                 from ./JavaScriptCore/bindings/npapi.h:84,
                 from ./JavaScriptCore/bindings/npruntime.h:76,
                 from ./JavaScriptCore/bindings/npruntime_internal.h:28,
                 from ./JavaScriptCore/bindings/NP_jsobject.h:31,
                 from WebCore/page/Frame.cpp:70:
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:1:2: error: #error Why am I here?
/opt/local/include/X11/X.h:108: error: conflicting declaration 'typedef XID Cursor'
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:270: error: 'Cursor' has a previous declaration as 'typedef struct Cursor Cursor'

Comment 3 Mark Rowe (bdash) 2008-01-25 05:42:31 PST
Thanks!  So the problem would seem to be that both XP_MAC and XP_UNIX are defined on Mac OS X.  This pulls in both Quickdraw.h and Xlib.h, which have conflicting definitions for Cursor.

I'm guessing that for the Gtk port on Mac OS X, we probably don't want XP_MAC defined at all.  Whether or not XP_UNIX is defined should depend on whether you're using the X11 or "native" version of Gtk.
Comment 4 Mark Rowe (bdash) 2008-01-25 05:56:12 PST
It might be as simple as changing:

#if defined(__APPLE_CC__) && !defined(__MACOS_CLASSIC__)

to:

#if defined(__APPLE_CC__) && !defined(__MACOS_CLASSIC__) && !defined(XP_UNIX)

I'm a little wary of changing npapi.h though as it's technically an API header, but a simple change like this is unlikely to cause problems.
Comment 5 Rodney Dawes 2008-01-25 06:32:21 PST
(In reply to comment #3)
> I'm guessing that for the Gtk port on Mac OS X, we probably don't want XP_MAC
> defined at all.  Whether or not XP_UNIX is defined should depend on whether
> you're using the X11 or "native" version of Gtk.

We don't want XP_MAC or XP_UNIX defined I don't think. In fact, XP_UNIX only gets defined with the qmake build, when the GTK+ port is being built against X11. Is this problem occurring with the autotools build? Are you sure that the GTK+ you're building against, isn't using X11?

Comment 6 Mark Rowe (bdash) 2008-01-25 07:51:19 PST
I've just verified that the one-line change I suggested resolves this issue when building the Gtk port on Mac OS X.
Comment 7 Mark Rowe (bdash) 2008-01-25 07:59:06 PST
Created attachment 18690 [details]
Patch
Comment 8 Darin Adler 2008-01-25 13:05:44 PST
Comment on attachment 18690 [details]
Patch

Looks good. r=me
Comment 9 Mark Rowe (bdash) 2008-01-26 02:03:37 PST
Fix landed in r29806.