Building WebKit

Before you build WebKit, you'll need to check out sources. Next make sure that you have Xcode 2.3, which is the latest version at this point.

  1. To start a build, use the build-webkit script.


    It's handy to put the WebKitTools/Scripts directory in your shell path so you can type commands like build-webkit without specifying the path to the script.

  2. Once the frameworks are built, you'll probably want to run Safari using the newly-built WebKit. To do that, use the run-safari script.


    This script sets up the DYLD_FRAMEWORK_PATH environment variable, which will cause the system loader to use the frameworks you built from your Xcode build products directory instead of the ones installed in /System/Library/Frameworks, so it will start the version of Safari from the Applications directory with the WebKit frameworks you just built.

If you have specified custom location for the build products directory in Xcode preferences, the frameworks will be built in that directory. If you haven't, the build products will be put in a directory named WebKitBuild alongside the source code directories.

By default, the scripts will do a Release build, which is optimized and doesn't have debugging code, like assertions, compiled in. If you'd prefer to do a Debug build, then execute this command:

WebKitTools/Scripts/set-webkit-configuration --debug

You can also pass the configuration on the command line to any of the build commands.

More information about building WebKit can be found on its wiki.