Building on Windows
As with Apple's Windows Port, you must first follow the instructions on http://webkit.org/building/tools.html to install the necessary developer tools, support libraries, and check out the WebKit code.
Note that it is safest to build WebKit in your Cygwin home directory (c:\cygwin\home\username\WebKit). At the moment, there seems to be an implicit assumption in the build scripts that paths will be relative to the home directory.
In the ~/WebKit/Tools/Scripts folder, use
./build-webkit --wincairo --release
to start the build. Don't forget to add --release (or --debug), otherwise the --wincairo switch will be ignored.
You will need to obtain a set of build requirements that are analogous to the Apple port's WebKitAuxilliaryLibraries.zip. If you have a source tree newer than r83657 you will get these libraries installed automatically when you perform a update-webkit --wincairo or a build-webkit --wincairo. These files are now part of the normal build path.
Building from within Visual Studio
WebKit can be built from within Visual Studio by setting two environment variables:
- WEBKIT_OUTPUTDIR - An absolute Windows-style path pointing to the directory where you want the build products to go.
- WEBKIT_LIBRARIES - An absolute Windows-style path pointing to the WebKitLibraries/win folder in your WebKit checkout.
Common Build Errors
Error spawning cmd.exe
Sometimes, Visual Studio complains that it 'cannot spawn cmd.exe'. Should this happen, check if both your Cygwin\bin folder and c:\windows\sytem32 are both in the Visual Studio list of executable files (Tools -> Options -> VC++ Directories).
Bad line endings
When you see errors in WebCore/css/makeprops or WebCore/css/maketokenizer, open those files in a suitable editor (SciTE works) and convert the line endings to LF only (Unix-style). You can also use the dos2unix command from the Cygwin shell. Then restart the build.
Missing Autogenerated Files
If you have the Visual Studio IDE open while you are performing an update-webkit, you can sometimes run into a strange problem where Visual Studio is unable to locate the autogenerated files. These files are usually things like HTMLNames.cpp, which are generated by Perl as part of the WebCoreGenerated target.
Problems with Python auto-update
You may encounter errors when the build environment attempts to install Python modules when running Cygwin in a Windows host OS inside a VMWare instance. The errors will look like the following:
webkitpy.common.system.autoinstall: INFO Auto-installing package: eliza.py webkitpy.common.system.autoinstall: INFO From: "http://www.adambarth.com/webkit/eliza" webkitpy.common.system.autoinstall: INFO To: "/cygdrive/e/Projects/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/eliza.py" Traceback (most recent call last): File "/cygdrive/e/Projects/WebKit/Tools/Scripts/test-webkitpy", line 266, in <module> Tester().run_tests(sys.argv, external_package_paths) File "/cygdrive/e/Projects/WebKit/Tools/Scripts/webkitpy/test/main.py", line 1
This seems to happen when running VMWare in NAT networking mode. If you switch to Bridged networking, everything should work properly.
Visual C++ Express Edition
If you see errors like this you probably need to install the platform SDK.
Running the tests
After successfully building WebKit, in order to run the tests you need to:
- copy the DLLs from %WEBKIT_LIBRARIES%\bin32\ into your build output folder, otherwise jsc won't run properly.
- Make sure the Cairo, JPEG, and PNG libraries are either in this directory, or in your PATH.