Thursday, February 15, 2007

Building WebKit on OS X when you have Qt installed

I ran into trouble building WebKit (Safari) on my MacBook. When I entered the command to build it
% WebKit/WebKitTools/Scripts/build-webkit --debug
the build script immediately started complaining about qmake not understanding the "-r" option. This seemed really strange to me as I hadn't thought Safari was a Qt application; it certainly looks much better than any Qt application I've ever seen on the Mac, and I've written 3. It turns out that Safari is not a Qt application but the build script does look for the QTDIR environment variable and will try to build a Qt version if it finds that variable. [Thanks to Mark Rowe on the WebKit team for this information].

So the solution to my problem was to temporarily undefine QTDIR.

% echo $QTDIR
% unsetenv QTDIR
% WebKit/WebKitTools/Scripts/build-webkit --debug