wiki:BuildingOnWindows

Version 4 (modified by tommy@ech-wel.nl, 15 years ago) (diff)

--

Building on Windows

There is a decent amount of setup work before building of JavaScriptCore and WebCore on Windows. There are also some areas of the code which are not entirely fleshed out yet on Win32. This page serves to document those issues.

Build Environment Setup

  • Install a compiler:
  • Download and install cygwin. On the package selection screen, make sure to select the following packages that are not part of the default install:
     bison         (Devel)
     curl          (Net)
     flex          (Devel)
     gcc           (Devel, we only use cpp)
     gperf         (Devel))
     make          (Devel)
     patch         (Utils)
     perl          (Perl)
     perl-libwin32 (Perl)
     subversion    (Devel)
     unzip         (Archive)
    
    The default text file type must be set to DOS / text during installation.
  • Check out WebKit in the usual way. Make sure that the path to the checkout directory does not contain spaces (e.g. 'Documents and Settings'), the Perl build scripts cannot handle this.
  • Run WebKitTools/Scripts/install-win-extras. This will install a few extra software packages on your system: icu, iconv, libxml, libxslt and setx. It will also configure the PATH and WebKitOutputDir environment variables. You may wish to change WebKitOutputDir from the default of C:\WebKitBuild.
  • Optional: if you would like an IRC client for Windows, try mIRC, X-Chat, or Trillian. If you want a non-IE browser, try Firefox or Opera.

Building

From within Visual Studio

To build from within Visual Studio, open up JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.sln and then select Build. There are two configurations, Debug and Release. The output directory structure is identical to Xcode, so you can safely change configurations and preserve your other configuration's intermediates and libraries/executables.

After you've succeeded in building JavaScriptCore, you can do the same for WebCore, by opening up WebCore/WebCore.vcproj/WebCore.sln and selecting Build.

For the test application, open WebKitTools/Spinneret/Spinneret.sln in VS. This also builds Webkit as a dependency.

From the command line

To build from the command line, you use the following syntax:

WebKitTools/Scripts/build-webkit

This will build both projects.

Problems?

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

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). Then restart the build.

Areas needing improvement

TODO: fill me in?

  • Describe DLL registration step