My favorites | Sign in
Project Home Downloads Wiki Issues
Search
for
BuildInstructions  
How to build leopard-webkit
Featured
Updated Sep 8, 2014 by Tobias.N...@gmail.com

Requirements

  • MacPorts is the recommended way to get the following necessary tools
  • gcc 4.2.4 Apple build 5666.3
    for Blocks support and additional bugfixes missing in Apple's 4.2.1
  • ruby >=1.9
    for building the Offline Assembler and the Low Level Interpreter for the JavaScript engine
  • Python >=2.6
  • JSON library for Python
  • Perl >=5.10
  • flex >=2.5.35
  • developer_cmds >=58
  • subversion

Preparing the toolchain

Here the steps to prepare the build environment using MacPorts:

  1. install MacPorts as described
  2. install Python 2.7 which already includes a JSON library
  3. sudo port install python27
  4. select Python 2.7 to be the default version
  5. sudo port select python python27
  6. install Apple gcc build 5666.3 (will take some hours)
    Make sure you get the gpl3 variant!
  7. sudo port install apple-gcc42 +gpl3
  8. install ruby 1.9
  9. sudo port install ruby19
    sudo port ruby select ruby19
  10. install Perl
  11. sudo port install perl5
  12. install flex
  13. sudo port install flex
  14. install developer_cmds
  15. sudo port install developer_cmds
  16. Now backup the existing Xcode tools:
    in order to force Xcode to use the recently built tools
  17. cd {path to your Xcode installation}/usr/bin
    mv gcc-4.2 gcc-4.2.bak
    mv g++-4.2 g++-4.2.bak
    mv nm nm.bak
    mv install_name_tool install_name_tool.bak
    mv flex flex.bak
    mv unifdef unifdef.bak
  18. Then create symlinks to the MacPorts versions (staying in the same directory):
  19. ln -s /opt/local/bin/gcc-apple-4.2 gcc-4.2
    ln -s /opt/local/bin/g++-apple-4.2 g++-4.2
    ln -s /opt/local/bin/nm nm
    ln -s /opt/local/bin/install_name_tool install_name_tool
    ln -s /opt/local/bin/flex flex
    ln -s /opt/local/bin/unifdef unifdef
  20. Now backup some existing system tools:
    in order to force all scripts to use the recently built tools
  21. cd /usr/bin
    mv perl perl.bak
    mv python python.bak
  22. Then create symlinks to the MacPorts versions (staying in the same directory):
  23. ln -s /opt/local/bin/perl perl
    ln -s /opt/local/bin/python python
  24. install subversion
  25. sudo port install subversion

Getting the sources

It is recommended to avoid checking out and updating the whole test suite as it is not needed for building anyway.

  1. Check out the root directory and the immediate childs of the WebKit SVN repository (inserting i.e. "Safari-536.25" as the version tag)
    15 GB disk space is needed for building all four architectures.
  2. cd {destination path}
    svn checkout http://svn.webkit.org/repository/webkit/tags/{some version tag} --depth=immediates WebKit
    cd WebKit
  3. Checkout the content of the needed subdirectories of the WebKit SVN repository (staying in the same directory "WebKit")
  4. svn update --set-depth=infinity Source Tools WebKitLibraries
  5. Checkout the JavaScriptGlue directory
  6. svn checkout ^/trunk/Source/JavaScriptGlue@105839 Source/JavaScriptGlue
  7. Checkout the WebKitSystemInterface static libraries
    They have been removed from the subversion trunk at revision 133670
  8. svn merge -c -133670 ^/trunk --accept=mf
  9. Apply the patchfiles corresponding to the version tag you checked out
  10. svn patch --strip 2 {path to the WebKit patchfile}
    svn patch --strip 3 {path to the JavaScriptGlue patchfile} Source/JavaScriptGlue

Building the WebKit frameworks

Safari in 10.5 doesn't support 64 bit so building x86_64 and ppc64 does only make sense when you also build a browser (like Sunrise) as 64 bit.

Issue the following commands from within the root directory of the source tree:

  • Release build
    You can choose to add to ARCHS any of i386, x86_64, ppc, ppc64, ppc7400, ppc970
  • Tools/Scripts/build-webkit --release ARCHS="ppc" ONLY_ACTIVE_ARCH=NO
  • Debug build
    You can choose to add to ARCHS any of i386, x86_64, ppc, ppc64, ppc7400, ppc970
  • Tools/Scripts/build-webkit --debug ARCHS="ppc" ONLY_ACTIVE_ARCH=NO
  • Building with distcc requires adding the following to the command line:
  • GCC_PRECOMPILE_PREFIX_HEADER=NO
  • In order to build targetting 10.6 when running a different version of OS X add the following to the command line:
  • TARGET_MAC_OS_X_VERSION_MAJOR=1060

Running the built code

Issue the following commands from within the root directory of the source tree:

  • Run Safari in the gdb debugger
  • Tools/Scripts/debug-safari
  • Launch Safari, forcing it to use the freshly built frameworks
  • Tools/Scripts/run-safari
  • Launch a WebKit based application, forcing it to use the freshly built frameworks
  • Tools/Scripts/run-webkit-app {path to the application}/Contents/MacOS/{application binary}

Updating the sources

In order to update your source tree to a newer tag, issue the following commands from within the root directory of the source tree:

  1. Undo the previous patchset and remove non-versioned files and directories
  2. svn revert -R .
    svn status | grep ^\? | cut -c9- | tr '\n' '\0' | xargs -0 rm -r
    svn revert -R Source/JavaScriptGlue
    svn status Source/JavaScriptGlue | grep ^\? | cut -c9- | tr '\n' '\0' | xargs -0 rm -r
  3. Update to the new tag
  4. svn switch ^/tags/{some version tag}
  5. Apply the patchfiles corresponding to the version tag you checked out
  6. svn patch --strip 2 {path to the WebKit patchfile}
    svn patch --strip 3 {path to the JavaScriptGlue patchfile} Source/JavaScriptGlue

Sign in to add a comment
Powered by Google Project Hosting