X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=blobdiff_plain;f=WebKitSite%2Fbuilding%2Fbuild.html;h=3676f4131c31dc54c0a9468c73801cb4b9b7f45f;hp=b6e9de85641de3da9e1a1119b51d334d760391a5;hb=be91071b16a3dbdf7a7f94d1e07c060352cfaee9;hpb=28b3df5a1564f576b71c41432ba5a7726d91ff1c diff --git a/WebKitSite/building/build.html b/WebKitSite/building/build.html index b6e9de85641d..3676f4131c31 100644 --- a/WebKitSite/building/build.html +++ b/WebKitSite/building/build.html @@ -1,50 +1,75 @@ - - - - - Building WebKit - - - - - - - - - -
- -

Before you build WebKit, you'll need to check out sources.

+ + +

Building WebKit

+ +

Building WebKit requires a WebKit source tree and Xcode version 2.3 or greater.

    +
  1. Type this command to build WebKit:

    +

    WebKit/WebKitTools/Scripts/build-webkit

    +

    Use the --debug option for a debug build, which includes debugging symbols and assertions:

    +

    WebKit/WebKitTools/Scripts/build-webkit --debug

    +
  2. +
+ +

By default, build-webkit places build products in WebKit/WebKitBuild. If your Xcode preferences specify a custom build products location, build-webkit places build products there.

+

More information about building WebKit is available on the WebKit Wiki.

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

    -

    WebKitTools/Scripts/build-webkit

    -

    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.

    +

    Running Safari with the WebKit You Built

    +
      +
    1. Type this command to run Safari with the WebKit you built:

      +

      WebKit/WebKitTools/Scripts/run-safari

    2. +

      Use the --debug option for a debug build:

      +

      WebKit/WebKitTools/Scripts/run-safari --debug

      +
    +

    The run-safari script sets the DYLD_FRAMEWORK_PATH environment variable to point to your build products, +and then launches /Applications/Safari.app. DYLD_FRAMEWORK_PATH tells the system loader to prefer your build products over the frameworks installed in /System/Library/Frameworks.

    -
  • 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.

    -

    WebKitTools/Scripts/run-safari

    -

    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.

    +

    Setting a Default

    +
      +
    1. To set a default build configuration for build-webkit and other scripts, use the set-webkit-configuration script:

      +

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

      +

      WebKit/WebKitTools/Scripts/set-webkit-configuration --release

    2. +
    +

    Debugging the WebKit You Built in Xcode

    +
      +
    1. Open a project

      +

      Each WebKit component -- JavaScriptCore, WebCore, and WebKit -- contains its own Xcode project. Open the project belonging to the component you want to debug.

      +
    2. +
    3. Set the project's build products location

      +

      To find the WebKit you built, Xcode needs to know the build products location that build-webkit used. You can set the build products location from the project's Info window.

      + +
    4. +
    5. Set the project's active build configuration

      +

      Xcode also needs to know the build configuration you used. You can set the active build configuration from the project's Build window.

      + +
    6. +
    7. Add a custom executable to the project

      +

      Choose any WebKit application you want to use for debugging. To use Safari, select /Applications/Safari.app.

      + +
    8. +
    9. Set the project's active executable

      +

      You can set the active executable from the project's Build window. Choose the executable you just added.

      +
    10. +
    11. Close and re-open the project

      +

      This will force Xcode to discover generated source files, which output to your build products location, allowing you to set breakpoints in them.

      +
    12. +
    13. Launch the debugger

      +

      In the Debugger window, click the "Debug" button.

      + +
    -

    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 Deployment build, which is optimized and doesn't have development-only code, like assertions, compiled in. -If you're prefer to do a Development build, then do execute this command:

    -

    WebKitTools/Scripts/set-webkit-configuration --development

    -

    You can also pass the configuration on the command line to any of the build commands. -If you're using Xcode 2.0 you'll need to blow away your build products directory each time you switch configurations.

    -

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

    -

    [TODO: Talk about how to replace your system WebKit.framework, and why you probably don't want to, once we have scripts that help you do that.]

    - -
  • - - +
    +

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

    + + +