[[PageOutline]] = 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: * Visual Studio 2005, if you have MSDN subscription or have purchased it. * or [http://msdn.microsoft.com/vstudio/express/visualc/ Visual C++ Express Edition] (free of charge). See the [http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ MSDN documentation] for information on building Win32 C++ applications using Visual C++ Express Edition. * Download and install [http://cygwin.com/ 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) pkg-config (Devel) subversion (Devel) unzip (Archive) }}} The ''default text file type'' must be set to ''DOS / text'' during installation. * [http://webkit.opendarwin.org/building/checkout.html 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. * Install other dependencies needed by WebKit. There are two ways to do this: * Run `WebKitTools/Scripts/install-win-extras`. This will attempt to install the dependencies automatically. It will also configure the `PATH` and `WebKitOutputDir` environment variables. You may wish to change `WebKitOutputDir` from the default of `C:\WebKitBuild`. * Install the dependencies yourself. You will need the following packages. For each package, unzip, then move the resulting directory to a directory with the name given below (e.g. `iconv` for the iconv package) in the root of your WebKit checkout, except as directed. * iconv ( ftp://fr.rpmfind.net/pub/libxml/win32/iconv-1.9.1.win32.zip ) * icu ( ftp://ftp.software.ibm.com/software/globalization/icu/3.4/icu-3.4-Win32-msvc7.1.zip ) * libxml ( ftp://fr.rpmfind.net/pub/libxml/win32/libxml2-2.6.23.win32.zip ) * libxslt ( ftp://fr.rpmfind.net/pub/libxml/win32/libxslt-1.1.15.win32.zip ) * pthreads ( ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe ). Unzip (this is a `.zip` with an `.exe` wrapper) and move the resulting `Pre-built.2` directory to the target `pthreads` directory. * sqlite ( http://sqlite.org/sqlite-source-3_3_17.zip ). Unzip and move the resulting files to the target `sqlite` directory. * zlib ( ftp://fr.rpmfind.net/pub/libxml/win32/zlib-1.2.3.win32.zip ) * Configure your environment variables. If you ran `install-win-extras`, this is already done. Otherwise, consider setting the following environment variables: * `WebKitOutputDir` to `c:\WebKitBuild` * `Path` to include `WebKitTools/Scripts`, `c:\Program Files\Resource Kit`, and `c:\cygwin\bin` * Optional: if you would like an IRC client for Windows, try [http://www.mirc.com/ mIRC], [http://www.silverex.org/download/ X-Chat], or [http://www.ceruleanstudios.com/ Trillian]. If you want a non-IE browser, try [http://getfirefox.com/ Firefox] or [http://opera.com/ Opera]. == Building == === From within Visual Studio === To build from within Visual Studio, open up `WebKitTools/Spinneret/Spinneret.sln` in Visual Studio. There are two configurations, Debug and Release; building one will not clobber the other. The solution will build JavaScriptCore and WebCore as dependencies, and finally the Spinneret test app. === From the command line === To build from the command line, you use the following syntax: {{{ WebKitTools/Scripts/build-webkit }}} This will build both JavaScriptCore and WebCore in Release mode. == 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). Then restart the build. === Visual C++ Express Edition === {{{ 1>c:\cygwin\home\admin\webkit\javascriptcore\wtf\assertions.cpp(45) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory }}} If you see errors like this you probably need to install the [http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ platform SDK]. == Areas needing improvement == __TODO__: fill me in? * Describe DLL registration step