Jan 292012
 

In a previous post I outlined a detailed description of how to build WebKit on Windows XP. My aim was to share with everyone the long and rather tricky process of building the beast that WebKit is. There are many pitfalls, gotchas and critical requirements to get from code to binary to execution. I also did away with the standard and default requirement of VS2005 and opted to go with the newer and less-buggy VS2008. Besides the improvements in this newer version, there was only 1 update to install (SP1) as opposed to the 5 or so that VS2005 required (in addition to QuickTime SDK, Windows 2003 SDK and DirectX SDK), it had a better compiler and, in my experience, caused much less problems (consider for example that newer DirectX SDK doesn’t support VS2005) to build WebKit than VS2005 did.

But that was VS2008 and Windows XP. Now, we’ll attempt to build WebKit with VS2010 and on Windows 7. This adds two groups of issues to the mix: One on the compiler/environment level and the other on the OS level. Regarding the issues that Windows 7 brings to the table, see the previous post and here. As before, I’ll build only WinCairo, but you should be well-advised to try the default – CoreGraphics.

Note: While this walk-through should be complete, obviously there are many concepts specific to WebKit and/or the tools, these I won’t repeat here. You don’t need to read the previous post, but if you find some reference that isn’t clear, search for the keyword in question in the previous post. If that doesn’t help, don’t shy from asking in the comments; I’ll get back to you.

Summary (TL;DR)

This is a detailed walk-through of getting WebKit built on Windows 7 with VS2010. For the bottom-line and an automated patch just skip the details and jump here. There is a very easy, virtually flawless, two-step, five-click procedure to get from code to binary.

Motivation

This project took my spare time during a whole week and almost two weekends. That’s an estimated 20 hours. So why do it? VS2005, which is the officially supported version, is outdated, has a painfully large number of updates and the end-user must install all its updated/patched runtime libraries and is notorious in losing/reseting the Include and Library paths. On top of that, it’s not supported on Windows 7. Since I upgraded my workstation to Win7 I couldn’t and didn’t want to install VS2005 (nor VS2008 for that matter). I could either build WebKit in a VM on WinXP (actually my old system is now turned into a cosy VM, so I could use that,) but then WebKit is too huge for a VM. The adventure of attempting a build on VS2010 was intimidating enough, considering that a single unsupported/incompatible issue could mushroom into 100s of thousands of errors that might actually require a sizable code change, which would be far more than what I bid for. To top it, I knew that Windows 7 had its own set of issues related to UAC and Cygwin’s Fork implementation, which conflicted with Windows’ randomized image mapping and other security features.

Ultimately, I wanted a clean build with the latest tools on the latest Windows incarnation. WebKit.org might not be tempted to force its development team to shell out for VS2010 or Windows 7, not to mention spend all that time to upgrade both their machines and code, but, eventually, they will. So, here it is. A complete walkthrough documenting every step of the way, from code download to environment setup to successful build. In addition, all changes to fix errors are automated with just two scripts… read on.

Environment

WebKit has a lot of dependencies and requirements. So first we need to setup everything that is expected by the code before we even try to build.

Getting the Code

As with the tip from the previous post, I avoided the Trunk and used the prepackaged sources of r106194 (but relatively recent packages should also work). While the trunk may often be broken, the nightly build isn’t guaranteed to build. To increase your odds, pick a revision of the sources that has a Mac or Windows nightly build as well. From the 7 nightly builds I picked (r105569-r106194) 2 were broken. A considerable time is wasted figuring out whether or not the errors are our fault or the source code’s.

Cygwin

The first hurdle was to setup Cygwin. Get the download instructions from the previous post. (Read and use the Cygwin downloader from here is the gist of it.) Since WebKit expects the sources to be within the user’s home directory of Cygwin, I decided to avoid placing the 100s of thousands of files and the gigabytes that a single source working-copy is within Cygwin. Instead, I can have WebKit sources anywhere and Cygwin elsewhere and get them both together using symbolic links.

My Cygwin installation is in my Tools folder, which hosts a rather large number of portable programs and scripts, including MinGW. Tools is in the root of my system drive. To make things easy for me, I’d like to have Cygwin in the system drive as well (it’s a fast drive). So the first thing is to setup symbolic links where from the original folders to where we’d like to see our environment setup. This is done using the mklink command, but before executing it we delete any directories in that path, so make sure your target path is safe!

Visual Studio 2010

With VS2005 and VS2008 the Express editions worked fine. Since I don’t have VS2010 Express, I can’t vouch the same guarantee. Regardless, it’s probably reasonable to expect it to work. At any rate, we need to install a functional version. We also need to install SP1 and Windows SDK. Microsoft deserves some scolding for releasing Windows SDK that reverts Visual Studio updates for yet another time. So, to avoid stepping on your own feet, here is how you need to proceed with the VS2010 and WinSDK installations:

  1. Visual Studio 2010.
  2. Windows SDK 7.1.
  3. Visual Studio 2010 SP1.
  4. Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1.

Interestingly, I didn’t change the toolchain from VC100 to Windows SDK 7.1. I also didn’t install QuickTime or DirectX SDKs. It seems that the Windows and DirectX headers that come with VS2010 were enough that I didn’t have to go through any settings as I had to with VS2005. However, QuickTime’s missing SDK, while didn’t break the build, might mean that there wouldn’t be full media support in the resulting build. Actually, I suspect QuickTime SDK is needed for the CoreGraphics build. Nevertheless, that’s a minor issue that can be remedied later.

Environment Variables

Next we need to setup the WEBKITLIBRARIESDIR and WEBKITOUTPUTDIR environment variables, add scripts folder on the path and setup VS2010. WebKit build scripts expect VSINSTALLDIR environment variable, which, it seems, VS2010 installation isn’t creating. I found only VS100COMNTOOLS on my system, so I added a make-shift VSINSTALLDIR to my build environment setup script. Once that is done, we need to ask VS to setup its own environment variables and fire-up Cygwin.

I want to automate as much as possible, including the ability to run the same boiler-plate setup script for any revision of WebKit. The script is designed to be thrown into the source code folder of WebKit and run as administrator. The only missing thing is your Cygwin installation folder. But don’t worry, if you don’t provide this folder (or is invalid,) of you don’t run as admin, the script will warn you and stop.

Here is the cmd script I use to do the magic of setting up the build environment:

vs2010-build-env.cmd:

@rem Setup the Cygwin environment to build WebKit.
@rem Copyright 2012 Ashod Nakashian
@rem Your are free to use this however you see fit,
@rem provided you give credit where credit is due.

@rem Comment to debug and see what is being set exactly.
@echo off
@echo.

echo Setting up Cygwin directory...
@rem Change CYGWIN_SOURCE_DIR to where Cygwin is installed.
set CYGWIN_SOURCE_DIR=C:\Tools\cygwin
set CYGWIN_DIR=C:\Cygwin
if not exist "%CYGWIN_SOURCE_DIR%" (@echo Error: Please specify the correct Cygwin installation folder in '%0' @ CYGWIN_SOURCE_DIR.
goto exit)
if exist "%CYGWIN_DIR%" rmdir "%CYGWIN_DIR%"
mklink /D "%CYGWIN_DIR%" "%CYGWIN_SOURCE_DIR%"
if not %ERRORLEVEL%==0 (@echo Error: Please run this script as administrator.
goto exit)

echo Setting up WebKit directory...
set WEBKIT_SOURCE_DIR=%~dp0%
set CURRENT_DIR=%WEBKIT_SOURCE_DIR%
if "%CURRENT_DIR:~-1%"=="\" set CURRENT_DIR=%CURRENT_DIR:~0,-1%
for /R "delims=\" %%a in (%CURRENT_DIR%) do set WEBKIT_DIR_NAME=%%~nxa
set WEBKIT_DIR=%CYGWIN_DIR%\home\%username%\%WEBKIT_DIR_NAME%
if exist "%WEBKIT_DIR%" rmdir "%WEBKIT_DIR%"
mklink /D "%WEBKIT_DIR%" "%WEBKIT_SOURCE_DIR%"

echo Exporting environment varibles...
set WEBKITOUTPUTDIR=%WEBKIT_DIR%\WebKitBuild
set WEBKITLIBRARIESDIR=%WEBKIT_DIR%\WebKitLibraries\win
set VSINSTALLDIR=%VS100COMNTOOLS%..\..
set PATH=%WEBKIT_DIR%\Tools\Scripts;%PATH%
set PATH=%CYGWIN_DIR%\bin;%PATH%

@rem Uncomment if you want to execute VC tools from the shell.
@rem call "%VSINSTALLDIR%\VC\vcvarsall.bat" x86

echo Note: Remember to set devenv.exe to run as administrator!

echo Running Cygwin...
call "%CYGWIN_DIR%\Cygwin.bat"

:exit

This should be straight forward. All we do is setup the Cygwin and source-code folders and the environment variables. Take your time to read it and don’t forget to set your Cygwin installation folder to CYGWIN_SOURCE_DIR.

Building

First, download the source code and extract it in any folder you like. Next, place this script in the extracted folder. What you need to edit are: CYGWIN_SOURCE_DIR to point to your cygwin folder. The other settings should be automatically set. Note: You must run this script as Administrator!

Here is a sample of the output you should expect:

Setting up Cygwin directory...
symbolic link created for C:\Cygwin <> C:\Tools\cygwin
Setting up WebKit directory...
symbolic link created for C:\Cygwin\home\Ash\WebKit-r105582 <> C:\prj\WebKit\WebKit\WebKit-r105582\
Exporting environment varibles...
Running Cygwin...

Ash@Bull ~
#

If you get the prompt as I did above, then you’re good to go. But before we try to build, we need to let the build scripts know about VS2010, which isn’t really supported. Go to Tools\Scripts within the source folder and open the pdevenv file for editing. On the 18th line you should add a case for VS100COMNTOOLS and make it the first, next VS90COMNTOOLS followed by VS80COMNTOOLS. This way VS2010 will be preferred, followed by VS2008 then by 2005 if neither is found. Here is how lines 17-31 should look:

my $vsToolsVar;
if ($ENV{'VS100COMNTOOLS'}) {
    $vsToolsVar = "VS100COMNTOOLS";
} elsif ($ENV{'VS90COMNTOOLS'}) {
    $vsToolsVar = "VS90COMNTOOLS";
} elsif ($ENV{'VS80COMNTOOLS'}) {
    $vsToolsVar = "VS80COMNTOOLS";
} else {
    print "*************************************************************\n";
    print "Cannot find Visual Studio tools dir.\n";
    print "Please ensure that \$VS80COMNTOOLS or \$VS90COMNTOOLS\n";
    print "is set to a valid location.\n";
    print "*************************************************************\n";
    die;
}

Let’s do an initial run of the build script so it’d download the WinCairo files and install them (no change is done outside the WebKit source folder).

Here is an initial run…

# build-webkit --wincairo
Checking Last-Modified date of WinCairoRequirements.zip...
Downloading WinCairoRequirements.zip...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14.0M  100 14.0M    0     0   320k      0  0:00:44  0:00:44 --:--:--  480k

Installing WinCairoRequirements...
The WinCairoRequirements has been sucessfully installed in
 /cygdrive/c/Cygwin/home/Ash/WebKit-r105582/WebKitLibraries/win
Building results into: /cygdrive/c/Cygwin/home/Ash/WebKit-r105582/WebKitBuild
WEBKITOUTPUTDIR is set to: C:\prj\WebKit\WebKit\WebKit-r105582\WebKitBuild
WEBKITLIBRARIESDIR is set to: C:\Cygwin\home\Ash\WebKit-r105582\WebKitLibraries\win
/cygdrive/c/Cygwin/home/Ash/WebKit-r105582/Tools/Scripts/pdevenv win\WebKit.vcproj\WebKit.sln /build Release_Cairo_CFLite
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.

Solution file 'C:\prj\WebKit\WebKit\WebKit-r105582\Source\WebKit\win\WebKit.vcproj\WebKit.sln' is from a previous version of this application and must be converted in order to build in this version of the application. To convert the solution, open the solution in this version of the application.

===== BUILD FAILED ======

Please ensure you have run ../../../../Cygwin/home/Ash/WebKit-r105582/Tools/Scripts/update-webkit to install dependencies.

You can view build errors by checking the BuildLog.htm files located at:
/cygdrive/c/Cygwin/home/Ash/WebKit-r105582/WebKitBuild/obj//.

Ash@Bull ~
#

Great! So far so good. We downloaded and installed WinCairoRequirements (to redownload, just delete WebKitLibraries\win\WinCairoRequirements.headers) and we got VS2010 to run and try to load (and complain of) the solution file. Let’s upgrade it.

Open the solution file located at Source\WebKit\win\WebKit.vcproj\WebKit.sln in VS2010. (The easiest way to run VS2010 is to simply run pdevenv from the shell.) You’ll be prompted to convert the solution and all 40 projects. Now we should save the solution and close VS. (Alternatively you can use the /upgrade command.) Let’s go back and try to build again. Run build-webkit --wincairo from the shell. You should see the projects getting built and fail with more errors than you can count. Let’s Fix the errors.

Windows 7 UAC

Here is a generic error that’s omnipresent:

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: JavaScriptCoreGenerated, Configuration: Release_Cairo_CFLite Win32 ------
2>------ Build started: Project: WTF, Configuration: Release_Cairo_CFLite Win32 ------
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(153,5): error MSB6006: "CL.exe" exited with code -1073741819.

The above error actually means “CL.exe” failed to execute. It’s a general failure. The culprit here is UAC of Windows 7. To fix this issue, navigate to the VSINSTALLDIR folder, in Common7\IDE\ there should be devenv.exe (not devenv.com). Select the file, open properties then Compatibility tab. At the bottom under “Privilege Level” check “Run this program as an administrator”. Now VS2010 should run with full privileges and executing CL.exe (the C++ compiler) should work.

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: JavaScriptCoreGenerated, Configuration: Release_Cairo_CFLite Win32 ------
1>EXEC : cygwin warning :
2>------ Build started: Project: WTF, Configuration: Release_Cairo_CFLite Win32 ------
2>LINK : fatal error LNK1181: cannot open input file 'C:\Cygwin\home\Ash\WebKit-r105582\WebKitBuild\Release_Cairo_CFLite\obj\WTF\MainThreadWin.obj'

This time the Linker is complaining of not finding an OBJ file. Here we notice a couple of things. First, since CL no longer complains, it’s safe to assume our UAC fix worked and CL ran. Second, and more importantly, we see no CPP file compilation output before the linker error. Checking the output folder clearly shows no OBJ files. May be the output folder is different, so we need to see more details. Changing the log-level from Visual Studio (Tools > Options > Projects and Solutions > Build and Run. Change “MSBuild project build output verbosity” from “Quiet” to “Detailed” or higher) shows that CL is not compiling anything at all! After some investigation, it turns out the culprit is the parallelcl script (in Tools/Scripts). This middleware gets called from Tools/vcbin/cl.exe, which is what is actually called by VS2010 since it’s found first on the path. The purpose of this script is to parallelize the build by executing multiple concurrent instances of the compiler.

The older Visual Studio versions used to dump all command-line parameters passed to CL in a compiler response file. VS2010 isn’t using response files and is passing the params in the classical way. This behavior may be specific to Windows 7 as its shell supports a larger command-line param buffer than previous versions, but I haven’t checked either way. Bottom line is that parallelcl needs to accomodate this fact because as-is it’s simply failing to pass anything to CL, which is why nothing is actually getting compiled.

We can of course bypass this script altogether. Unfortunately, this will cost us much in terms of build time (which is significant to start with) because VS2010 (and 2008 as well) support only project-level parallelization, which isn’t much help for WebKit. The fix is to directly call the real CL. We may later try to do a better fix and support compiler-level parallelization, which is what this script was actually doing. To disable this custom script all we have to do is simply rename the CL.exe in Tools\vcbin\cl.exe.

mv Tools/vcbin/cl.exe Tools/vcbin/cl-.exe

Warnings (as Error)

Building again we see source files getting compiled. This time the errors come from the warnings. We resolved this issue by removing the “warnings as errors” options. Fire up VS2010 (which can be done by running pdevenv from the shell) then load the WebKit solution. Select every C++ solution (either one at a time, or all together) and open their properties. From the C/C++ > General node, change “Treat Warnings As Errors” to “No (/WX-)”. You probably want to do this for “All Configurations”. Save the solution and lets build again from the shell. To change settings, we’ll use property sheets (quick into here and here, more details here) which not only is the correct way to share common settings between large number of projects and configurations, but also WebKit heavily utilizes anyway.

Output showing “warning as error” and some superfluous warnings:

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: JavaScriptCoreGenerated, Configuration: Release_Cairo_CFLite Win32 ------
2>------ Build started: Project: WTF, Configuration: Release_Cairo_CFLite Win32 ------
2>c:\prj\webkit\webkit\webkit-r105582\source\javascriptcore\wtf\PassRefPtr.h(86): error C2220: warning treated as error - no 'object' file generated
2>c:\prj\webkit\webkit\webkit-r105582\source\javascriptcore\wtf\PassRefPtr.h(86): warning C4396: 'WTF::adoptRef' : the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
2>C:\prj\WebKit\WebKit\WebKit-r105582\Source\JavaScriptCore\wtf/HashSet.h(96): warning C4396: 'WTF::deleteAllValues' : the inline specifier cannot be used when a friend declaration refers to a specialization of a function template

The property sheet file format was changed in VS2010. As with the C++ project file names, which changed from vcproj to vcxproj, the property sheet file names have also changed from vsprops to props. The reason for this is because now C++ projects are now built using MSBuild and not VCBuild. Old vcproj files, for example, contained file filters (which defined the folder structure shown in Visual Studio) as well as build instructions. New vcxproj files now contain only build instructions and filters are now in vcxproj.filters. Since property sheets contain compiler switches and flags, the format must also comform to the MSBuild format. The same is true for vcxproj files.

To disable “warnings as errors” open WebKitLibraries\win\tools\vsprops\common.props and change the code TreatWarningAsError from true to false. We also see a lot of compiler warning C4396 and linker warning LNK4221, so let’s disable them as well.

Lines 13-23 of common.props:

<ClCompile>
<AdditionalOptions>/bigobj /GS %(AdditionalOptions)</AdditionalOptions>
<PreprocessorDefinitions>WIN32;_WINDOWS;WINVER=0x502;_WIN32_WINNT=0x502;_WIN32_IE=0x603;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_HAS_EXCEPTIONS=0;BUILDING_$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4396;4018;4068;4099;4100;4127;4138;4180;4189;4201;4244;4251;4275;4288;4291;4305;4344;4355;4389;4481;4503;4505;4510;4512;4610;4706;4800;4951;4952;4996;6011;6031;6211;6246;6255;6387;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>

Fixing Errors

nullptr

VS2010’s C++ compiler supports the new nullptr keyword. This was previously simulated in WTF\NullPtr.cpp/h as class std::nullptr_t; which isn’t simulated for VS2010 and newer (WTF\Compiler.h disables nullptr simulation for _MSC_VER >= 1600). Unfortunately, the simulated class, unlike a native one, needs to be exported so that it may be consumed by other projects. JavaScriptCore exports it, and since it’s not simulated, it can’t be found. From Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def we need to remove “?nullptr@@3Vnullptr_t@std@@A”.

MIDL

Like CL, there is a MIDL wrapper in Tools/vcbin. The purpose of this wrapper is to wrap command-line parameters in double-quotes. What it does wrong is that it, like the CL wrapper, assumes that the only parameter is a response file. Unfortunately, VS2010 doesn’t feel obliged to pass a response file in every case, so the wrapper ends up double-quotting every parameter and thus ends up passing invalid parameters to the real MIDL. Two solutions: we can temporarily rename the wrapper file to by-pass it (it works for me) or we can improve the MIDL wrapper to support both cases. For now, let’s simply rename the wrapper to bypass it.

mv Tools/vcbin/midl.exe Tools/vcbin/midl-.exe

Link Errors

If you got thus far, then you compiled everything until WebKit proper. Your biggest milestones were JavaScriptCore, Interfaces and WebCore. WebCore, however, seems to be missing a dozen or so definitions. Turns out that during the project conversion VS2010 set the Item Type (under General settings) to “Custom Build Tool” instead of “C/C++ compiler” thereby getting ignored by the C++ compiler. The culprit here is the VS2005 project file, which has incorrect Item Type for these files, one the original project file is fixed, the conversion should produce valid output. These files are:

Source\WebCore\platform\network\curl\CookieJarCurl.cpp
Source\WebCore\platform\image-decoders\ImageDecoder.cpp

Just change their Item Type to “C/C++ compiler” from their properties and rebuild. If all goes well, you should get no error and everything should build successfully.

Wrapping up

Summary

Here is what we did so far:

  1. Install Cygwin.
  2. Installed VS2010 Sp1 (and Windows SDK 7.1).
  3. Set WEBKITLIBRARIESDIR and WEBKITOUTPUTDIR environment variables.
  4. Make devenv.exe run as administrator.
  5. Change Tools\Scripts\pdevenv to recognize VS100COMNTOOLS.
  6. Remove the nullptr_t export from Source\JavaScriptCore\JavaScriptCore.vcproj\JavaScriptCore\JavaScriptCore.def.
  7. Disable CL and MIDL wrappers (the files may be renamed or their folder removed from the path).
  8. Disable Warning as Error from WebKitLibraries\win\tools\vsprops\common.props (optionally disable warning C4396 and enable MultiProcessor Compilation).
  9. Change the Item Type of Source\WebCore\platform\network\curl\CookieJarCurl.cpp and Source\WebCore\platform\image-decoders\ImageDecoder.cpp to C/C++ compiler.

Of course it would be great if one didn’t have to make all the code changes every time they updated the source code. Also, VS2010 project and props files have a different extension and format than the older ones. This means that any changes done to these files won’t get reflected in our converted files. The fix to that is to delete the converted Solution file and VS2010 will convert the files again. But even the conversion is a manual process. Let’s automate these changes…

Automating

Every modification we make to the source code, is a departure from the mainline and therefore a pain in maintaining it. I wanted somethin maintainable. This meant minimal change. I didn’t want to add new scripts, if any at all. Not only that, but I also wanted to support VS2005/VS2008 builds as well. That is, I plan to send this patch to become part of the mainline codebase. Turns out, we only need to modify one script in the WebKit proper source code: pdevenv.

We must modify pdevenv anyway to add support for VS2010 toolchain, no escape to that. So, here is what we can also do. First, add the VS100COMNTOOLS check, then, we need to convert the project, edit JavaScriptCore.def to remove the nullptr_t reference. We don’t need to rename the CL and MIDL wrappers; it’s enough to remove their folder from the path. Next, we need to edit common.props to disable warning as error, disable warning C4396 (which is optional) and enable MultiProcessor Compilation (again optional). Finally, we need to find all .cpp files and change their type to ClCompiler.

All of the editing tasks can be done using perlre (Perl Regex). In fact, they are simple one-line scripts. The tricky part was to generate Windows Batch file with the perl calls from pdevenv, which is a perl script itself. The reason for this is because that’s how Visual Studio is called; it’s a separate CMD shell. As you can see, the regex code is pretty twisted. Here is the updated pdevenv script:

#!/usr/bin/perl -w

use strict;
use warnings;

use File::Temp qw/tempfile/;
use File::Copy;
use FindBin;

use lib $FindBin::Bin;
use webkitdirs;

my ($fh, $path) = tempfile(UNLINK => 0, SUFFIX => '.cmd') or die;

chomp(my $vcBin = `cygpath -w "$FindBin::Bin/../vcbin"`);
chomp(my $scriptsPath = `cygpath -w "$FindBin::Bin"`);

my $command = join(" ", @ARGV);
my $vsToolsVar;
if ($ENV{'VS100COMNTOOLS'}) {
    $vsToolsVar = "VS100COMNTOOLS";
    $vcBin = ''; # We no longer need cl and midl wrappers.
	print $fh "\@echo Using VS2010 toolchain.\r\n";
	# If there is no vs2010 solution, upgrade.
	my $solution = $ARGV[0];
	$solution =~ s/WebKit.sln/WebKit-vs2010.sln/g;
	print $fh "\@echo off\r\n";
	print $fh "if not exist ..\\..\\WebKitLibraries ( \@echo This is not a WebKit directory! Stopping.\n goto exit )\r\n";
	print $fh "if not exist " . $solution . " (\r\n";
	print $fh "copy " . $ARGV[0] . " " . $solution . "\r\n";
	print $fh ")\r\n"; # If no vs2010 solution.
	print $fh "\@echo Upgrading solution file @ " . $solution . ". Build will resume when done. Please be patient.\r\n";
	print $fh "call \"\%" . $vsToolsVar . "\%\\vsvars32.bat\"\r\n";
	print $fh "IF EXIST \"\%VSINSTALLDIR\%\\Common7\\IDE\\devenv.com\" (devenv.com /useenv /upgrade " . join(" ", $solution) . ") ELSE ";
	print $fh "VCExpress.exe /useenv /upgrade " . join(" ", $solution) . "\r\n";

	# Correct the solution file name.
	$command = '';
    foreach my $arg (@ARGV) {
		$arg =~ s/WebKit.sln/WebKit-vs2010.sln/g;
        $command = $command . ' ' . $arg;
    }

	print $fh "\@echo Patching common.props...\r\n";	
	my $props_filename = "..\\..\\WebKitLibraries\\win\\tools\\vsprops\\common.props";
	chomp($props_filename = `cygpath -w '$props_filename'`);
	print $fh "\@echo  Disabling warning as error.\r\n";	
	my $replace_string = "s/\\true\\/\\false\\/g";
	print $fh "perl -p -i -e \"" . $replace_string . "\" \"" . $props_filename . "\"\r\n";
	print $fh "\@echo  Disabling warning C4396.\r\n";	
	$replace_string = "s/\\4396;/\\/g"; # Delete disabled warning 4396.
	print $fh "perl -p -i -e \"" . $replace_string . "\" \"" . $props_filename . "\"\r\n";
	$replace_string = "s/\\/\\4396;/g";
	print $fh "perl -p -i -e \"" . $replace_string . "\" \"" . $props_filename . "\"\r\n"; # Disable warning 4396.
	print $fh "\@echo  Enabling multiprocess compile.\r\n";	
	$replace_string = "s/\\(.*?)\\//g"; # Delete MP compilation.
	print $fh "perl -p -i -e \"" . $replace_string . "\" \"" . $props_filename . "\"\r\n";
	$replace_string = "s/\\/\\\\n      \\true\\/g";
	print $fh "perl -p -i -e \"" . $replace_string . "\" \"" . $props_filename . "\"\r\n"; # Enable MP compilation.

	my $jsdef_filename = "..\\..\\Source\\JavaScriptCore\\JavaScriptCore.vcproj\\JavaScriptCore\\JavaScriptCore.def";
	chomp($jsdef_filename = `cygpath -w '$jsdef_filename'`);
	print $fh "if not exist \"" . $jsdef_filename . ".orig\" (\r\n";
	print $fh "\@echo Patching JavaScriptCore.def...\r\n";	
	print $fh "move \"" . $jsdef_filename . "\" \"" . $jsdef_filename . ".orig\" \r\n";
	print $fh "findstr /V ?nullptr\@\@3Vnullptr_t\@std\@\@A \"" . $jsdef_filename . ".orig\" > \"" . $jsdef_filename . "\"\r\n";
	print $fh ")\r\n"; # If no JavaScriptCore.def.orig.

	my $webcore_filename = "..\\..\\Source\\WebCore\\WebCore.vcproj\\WebCore.vcxproj";
	chomp($webcore_filename = `cygpath -w '$webcore_filename'`);
	print $fh "\@echo Correcting WebCore.vcxproj...\r\n";	
	$replace_string = "undef \$/; s/\\/\\/msgi";
	print $fh "perl -0pi -e \"" . $replace_string . "\" \"" . $webcore_filename . "\"\r\n";
} elsif ($ENV{'VS90COMNTOOLS'}) {
    $vsToolsVar = "VS90COMNTOOLS";
} elsif ($ENV{'VS80COMNTOOLS'}) {
    $vsToolsVar = "VS80COMNTOOLS";
} else {
    print "*************************************************************\n";
    print "Cannot find Visual Studio tools dir.\n";
    print "Please ensure that \$VS80COMNTOOLS or \$VS90COMNTOOLS\n";
    print "is set to a valid location.\n";
    print "*************************************************************\n";
    die;
}

print $fh "\@echo off\r\n";
print $fh "call \"\%" . $vsToolsVar . "\%\\vsvars32.bat\"\r\n";
print $fh "set PATH=$vcBin;$scriptsPath;\%PATH\%\r\n";

print $fh "IF EXIST \"\%VSINSTALLDIR\%\\Common7\\IDE\\devenv.com\" (devenv.com /useenv " . join(" ", $command) . ") ELSE ";
print $fh "VCExpress.exe /useenv " . join(" ", $command) . "\r\n";
print $fh ":exit\n";

close $fh;
chmod 0755, $path;
chomp($path = `cygpath -w -s '$path'`);

exec("cmd /c \"call $path\"");

One-Command Build

Having installed Cygwin and Visual Studio, we need to change devenv.exe to run as administrator. Beyond that, just download the source code and the patch. Extract the source code anywhere you like, then extract the patch in the same folder. You should get a new vs2010-build-env.cmd file in the root of that folder and replace pdevenv in the Tools/Scripts folder.

Right-click vs2010-build-env.cmd and Run as Administrator. In the shell, simply execute build-webkit --wincairo and go read something, exercise or eat some healthy meal… Be back in an hour or so. Your station won’t be much usable during the build anyway.

Complete run of a patched nightly build for reference and completeness:

Setting up Cygwin directory...
symbolic link created for C:\Cygwin <> C:\Tools\cygwin
Setting up WebKit directory...
symbolic link created for C:\Cygwin\home\Ash\WebKit-r106194 <> C:\prj\WebKit\WebKit-r106194\
Exporting environment varibles...
Note: Remember to set devenv.exe to run as administrator!
Running Cygwin...

Ash@Bull ~
$ build-webkit --wincairo
Checking Last-Modified date of WinCairoRequirements.zip...
Downloading WinCairoRequirements.zip...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14.0M  100 14.0M    0     0   400k      0  0:00:35  0:00:35 --:--:--  407k

Installing WinCairoRequirements...
The WinCairoRequirements has been sucessfully installed in
 /cygdrive/c/Cygwin/home/Ash/WebKit-r106194/WebKitLibraries/win
Building results into: /cygdrive/c/Cygwin/home/Ash/WebKit-r106194/WebKitBuild
WEBKITOUTPUTDIR is set to: C:\prj\WebKit\WebKit-r106194\WebKitBuild
WEBKITLIBRARIESDIR is set to: C:\Cygwin\home\Ash\WebKit-r106194\WebKitLibraries\win
/cygdrive/c/Cygwin/home/Ash/WebKit-r106194/Tools/Scripts/pdevenv win\WebKit.vcproj\WebKit.sln /build Release_Cairo_CFLite
Using VS2010 toolchain.
        1 file(s) copied.
Upgrading solution file @ win\WebKit.vcproj\WebKit-vs2010.sln. Build will resume when done. Please be patient.
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.

Upgrade completed successfully. Results can be seen in the
upgrade report:
C:\prj\WebKit\WebKit-r106194\Source\WebKit\win\WebKit.vcproj\UpgradeLog.XML
Patching common.props...
 Disabling warning as error.
 Disabling warning C4396.
 Enabling multiprocess compile.
Patching JavaScriptCore.def...
        1 file(s) moved.
Correcting WebCore.vcxproj...
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: JavaScriptCoreGenerated, Configuration: Release_Cairo_CFLite Win32 ------
2>------ Build started: Project: WTF, Configuration: Release_Cairo_CFLite Win32 ------
2>StringExtras.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2>SizeLimits.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2>NullPtr.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2>HashTable.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2>DynamicAnnotations.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
2>BinarySemaphore.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
3>------ Build started: Project: JavaScriptCore, Configuration: Release_Cairo_CFLite Win32 ------
3>JSGlobalObject.obj : warning LNK4197: export '?s_globalObjectMethodTable@JSGlobalObject@JSC@@1UGlobalObjectMethodTable@2@B' specified multiple times; using first specification
3>PropertyDescriptor.obj : warning LNK4197: export '?defaultAttributes@PropertyDescriptor@JSC@@0IA' specified multiple times; using first specification
3>MachineStackMarker.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>Heap.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>JSValueRef.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific* WTF::WTFThreadData::staticData) imported
3>JSWeakObjectMapRefPrivate.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>BytecodeGenerator.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>Parser.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>JSCallbackObject.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>JSClassRef.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific* WTF::WTFThreadData::staticData) imported
3>JSContextRef.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>JSObjectRef.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>JSGlobalData.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>JSBase.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>JSCallbackConstructor.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
3>JSCallbackFunction.obj : warning LNK4049: locally defined symbol ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A (private: static class WTF::ThreadSpecific * WTF::WTFThreadData::staticData) imported
4>------ Build started: Project: WebCoreGenerated, Configuration: Release_Cairo_CFLite Win32 ------
4>C:\prj\WebKit\WebKit-r106194\Source\WebCore\WebCore.vcproj\WebCoreGeneratedCairo.props(4,5): warning MSB4011: "C:\prj\WebKit\WebKit-r106194\WebKitLibraries\win\tools\vsprops\common.props" cannot be imported again. It was already imported at "C:\prj\WebKit\WebKit-r106194\Source\WebCore\WebCore.vcproj\WebCoreGeneratedCommon.props (4,5)". This is most likely a build authoring error. This subsequent import wi
ll be ignored. [C:\prj\WebKit\WebKit-r106194\Source\WebCore\WebCore.vcproj\WebCoreGenerated.vcxproj]
5>------ Skipped Build: Project: QTMovieWin, Configuration: Release_Cairo_CFLite Win32 ------
5>Project not selected to build for this solution configuration
6>------ Build started: Project: WebCore, Configuration: Release_Cairo_CFLite Win32 ------
6>..\platform\graphics\cairo\DrawErrorUnderline.h(24): warning C4067: unexpected tokens following preprocessor directive - expected a newline
6>..\platform\graphics\cairo\DrawErrorUnderline.h(24): warning C4067: unexpected tokens following preprocessor directive - expected a newline
6>InspectorIndexedDBAgent.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>InspectorFileSystemAgent.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>StorageInfo.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBTransaction.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBRequest.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBObjectStoreBackendImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBObjectStore.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBKeyRange.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBKey.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBIndexBackendImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBIndex.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBFactoryBackendInterface.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBFactoryBackendImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBFactory.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBDatabaseBackendImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBDatabase.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBCursorBackendImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBCursor.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>IDBAny.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>PluginDebug.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSFileReaderCustom.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSEntrySyncCustom.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSEntryCustom.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSDirectoryEntrySyncCustom.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSDirectoryEntryCustom.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>ProgressShadowElement.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MediaControls.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MediaControlRootElement.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MediaControlElements.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>WeekInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>TimeInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>OperationNotAllowedException.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MonthInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MicroDataItemValue.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MediaFragmentURIParser.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MediaDocument.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MediaController.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>LocalFileSystem.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>HTMLPropertiesCollection.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>HTMLParserErrorCodes.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileWriterSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileWriterBase.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileWriter.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileThread.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileSystemCallbacks.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileStreamProxy.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileReaderSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileReaderLoader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileReader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileException.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileEntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileEntry.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>EntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>EntryArraySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>EntryArray.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>Entry.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DOMURL.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DOMFileSystemSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DOMFileSystemBase.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DOMFileSystem.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DOMFilePath.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DirectoryReaderSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DirectoryReader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DirectoryEntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DirectoryEntry.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DateTimeLocalInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DateTimeInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DateInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>ColorInputType.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>NotificationCenter.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>Notification.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>ScriptedAnimationController.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>StyleCachedShader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>RenderLayerBacking.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>RenderFullScreen.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>WebKitCSSShaderValue.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>WebKitCSSFilterValue.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>SpeechInputClientMock.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>LoaderRunLoopCF.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>BlobResourceHandle.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>BlobRegistryImpl.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MediaPlayerPrivateAVFoundationCF.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MediaPlayerPrivateAVFoundation.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>WKCACFViewLayerTreeHost.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>PlatformCALayerWinInternal.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>PlatformCALayerWin.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>PlatformCAAnimationWin.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>LegacyCACFLayerTreeHost.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>TransformationMatrixCA.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>GraphicsLayerCA.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FilterOperations.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FilterOperation.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FELightingNEON.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FEGaussianBlurNEON.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FECustomFilter.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FECompositeArithmeticNEON.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>CustomFilterShader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>CustomFilterProgram.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>CustomFilterOperation.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>CustomFilterMesh.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FullScreenController.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MediaPlayer.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>GraphicsLayer.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>WebCorePrefix.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>ScrollbarThemeSafari.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>GDIObjectCounter.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>ScrollAnimatorWin.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>PlatformEvent.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>FileStream.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>CalculationValue.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>AsyncFileSystem.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>CachedShader.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MHTMLParser.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>MHTMLArchive.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>SpeechInput.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>PerformanceTiming.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>PerformanceNavigation.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>Performance.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>PageVisibilityState.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSStorageInfoUsageCallback.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSStorageInfoQuotaCallback.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSStorageInfoErrorCallback.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSStorageInfo.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSOperationNotAllowedException.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSFileWriterCallback.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSFileReaderSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSFileException.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSFileEntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSFileEntry.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSFileCallback.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSEntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSEntryArraySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSDOMFileSystemSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSDirectoryReaderSync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>JSDirectoryEntrySync.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
6>DerivedSources.obj : warning LNK4006: "protected: void __thiscall WebCore::JSWebKitCSSRegionRule::finishCreation(class JSC::JSGlobalData &)" (?finishCreation@JSWebKitCSSRegionRule@WebCore@@IAEXAAVJSGlobalData@JSC@@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "private: __thiscall WebCore::JSWebKitCSSRegionRuleConstructor::JSWebKitCSSRegionRuleConstructor(class JSC::Structure *,class WebCore::JSDOMGlobalObject *)" (??0JSWebKitCSSRegionRuleConstructor@WebCore@@AAE@PAVStructure@JSC@@PAVJSDOMGlobalObject@1@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "public: static bool __cdecl WebCore::JSWebKitCSSRegionRuleConstructor::getOwnPropertyDescriptor(class JSC::JSObject *,class JSC::ExecState *,class JSC::Identifier const &,class JSC::PropertyDescriptor &)" (?getOwnPropertyDescriptor@JSWebKitCSSRegionRuleConstructor@WebCore@@SA_NPAVJSObject@JSC@@PAVExecState@4@ABVIdentifier@4@AAVPropertyDescriptor@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "protected: __thiscall WebCore::JSWebKitCSSRegionRule::JSWebKitCSSRegionRule(class JSC::Structure *,class WebCore::JSDOMGlobalObject *,class WTF::PassRefPtr)" (??0JSWebKitCSSRegionRule@WebCore@@IAE@PAVStructure@JSC@@PAVJSDOMGlobalObject@1@V?$PassRefPtr@VWebKitCSSRegionRule@WebCore@@@WTF@@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "public: static bool __cdecl WebCore::JSWebKitCSSRegionRuleConstructor::getOwnPropertySlot(class JSC::JSCell *,class JSC::ExecState *,class JSC::Identifier const &,class JSC::PropertySlot &)" (?getOwnPropertySlot@JSWebKitCSSRegionRuleConstructor@WebCore@@SA_NPAVJSCell@JSC@@PAVExecState@4@ABVIdentifier@4@AAVPropertySlot@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "public: static bool __cdecl WebCore::JSWebKitCSSRegionRule::getOwnPropertyDescriptor(class JSC::JSObject *,class JSC::ExecState *,class JSC::Identifier const &,class JSC::PropertyDescriptor &)" (?getOwnPropertyDescriptor@JSWebKitCSSRegionRule@WebCore@@SA_NPAVJSObject@JSC@@PAVExecState@4@ABVIdentifier@4@AAVPropertyDescriptor@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "public: static bool __cdecl WebCore::JSWebKitCSSRegionRule::getOwnPropertySlot(class JSC::JSCell *,class JSC::ExecState *,class JSC::Identifier const &,class JSC::PropertySlot &)" (?getOwnPropertySlot@JSWebKitCSSRegionRule@WebCore@@SA_NPAVJSCell@JSC@@PAVExecState@4@ABVIdentifier@4@AAVPropertySlot@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "public: static class JSC::JSObject * __cdecl WebCore::JSWebKitCSSRegionRule::createPrototype(class JSC::ExecState *,class JSC::JSGlobalObject *)" (?createPrototype@JSWebKitCSSRegionRule@WebCore@@SAPAVJSObject@JSC@@PAVExecState@4@PAVJSGlobalObject@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "public: static class JSC::JSObject * __cdecl WebCore::JSWebKitCSSRegionRulePrototype::self(class JSC::ExecState *,class JSC::JSGlobalObject *)" (?self@JSWebKitCSSRegionRulePrototype@WebCore@@SAPAVJSObject@JSC@@PAVExecState@4@PAVJSGlobalObject@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "private: void __thiscall WebCore::JSWebKitCSSRegionRuleConstructor::finishCreation(class JSC::ExecState *,class WebCore::JSDOMGlobalObject *)" (?finishCreation@JSWebKitCSSRegionRuleConstructor@WebCore@@AAEXPAVExecState@JSC@@PAVJSDOMGlobalObject@2@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "public: static class JSC::JSValue __cdecl WebCore::JSWebKitCSSRegionRule::getConstructor(class JSC::ExecState *,class JSC::JSGlobalObject *)" (?getConstructor@JSWebKitCSSRegionRule@WebCore@@SA?AVJSValue@JSC@@PAVExecState@4@PAVJSGlobalObject@4@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "class JSC::JSValue __cdecl WebCore::jsWebKitCSSRegionRuleCssRules(class JSC::ExecState *,class JSC::JSValue,class JSC::Identifier const &)" (?jsWebKitCSSRegionRuleCssRules@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@V23@ABVIdentifier@3@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "class JSC::JSValue __cdecl WebCore::jsWebKitCSSRegionRuleConstructor(class JSC::ExecState *,class JSC::JSValue,class JSC::Identifier const &)" (?jsWebKitCSSRegionRuleConstructor@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@V23@ABVIdentifier@3@@Z) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "public: static struct JSC::ClassInfo const WebCore::JSWebKitCSSRegionRuleConstructor::s_info" (?s_info@JSWebKitCSSRegionRuleConstructor@WebCore@@2UClassInfo@JSC@@B) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "public: static struct JSC::ClassInfo const WebCore::JSWebKitCSSRegionRulePrototype::s_info" (?s_info@JSWebKitCSSRegionRulePrototype@WebCore@@2UClassInfo@JSC@@B) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
6>DerivedSources.obj : warning LNK4006: "public: static struct JSC::ClassInfo const WebCore::JSWebKitCSSRegionRule::s_info" (?s_info@JSWebKitCSSRegionRule@WebCore@@2UClassInfo@JSC@@B) already defined in JSWebKitCSSRegionRule.obj; second definition ignored
7>------ Build started: Project: Interfaces, Configuration: Release_Cairo_CFLite Win32 ------
8>------ Build started: Project: WebKitGUID, Configuration: Release_Cairo_CFLite Win32 ------
9>------ Build started: Project: WebKitLib, Configuration: Release_Cairo_CFLite Win32 ------
9>WebDesktopNotificationsDelegate.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
9>FullscreenVideoController.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
10>------ Build started: Project: WebKit2Generated, Configuration: Release_Cairo_CFLite Win32 ------
11>------ Build started: Project: WebKit, Configuration: Release_Cairo_CFLite Win32 ------
11>libjpeg.lib(jdapimin.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdapimin.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdapistd.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdapistd.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdmarker.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdmarker.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jerror.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jerror.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdmaster.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdmaster.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jcomapi.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jcomapi.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdinput.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdinput.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jmemmgr.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jmemmgr.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jutils.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jutils.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdhuff.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdhuff.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jquant1.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jquant1.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jddctmgr.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jddctmgr.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdsample.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdsample.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdarith.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdarith.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdcolor.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdcolor.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdcoefct.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdcoefct.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jquant2.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jquant2.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdmerge.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdmerge.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdmainct.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdmainct.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jdpostct.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jdpostct.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jmemnobs.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jmemnobs.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jidctint.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jidctint.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jidctflt.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jidctflt.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jidctfst.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jidctfst.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libjpeg.lib(jaricom.obj) : warning LNK4099: PDB 'libjpeg.pdb' was not found with 'libjpeg.lib(jaricom.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libjpeg.pdb'; linking object as if no debug info
11>libpng.lib(pngerror.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngerror.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11>libpng.lib(pngread.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngread.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11>libpng.lib(pngpread.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngpread.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11>libpng.lib(pngget.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngget.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11>libpng.lib(pngtrans.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngtrans.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11>libpng.lib(pngrtran.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngrtran.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11>libpng.lib(pngset.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngset.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11>libpng.lib(png.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(png.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11>libpng.lib(pngrio.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngrio.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11>libpng.lib(pngrutil.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngrutil.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
11>libpng.lib(pngmem.obj) : warning LNK4099: PDB 'libpng.pdb' was not found with 'libpng.lib(pngmem.obj)' or at 'C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\libpng.pdb'; linking object as if no debug info
12>------ Build started: Project: WebKit2WebProcess, Configuration: Release_Cairo_CFLite Win32 ------
13>------ Build started: Project: testapi, Configuration: Release_Cairo_CFLite Win32 ------
14>------ Build started: Project: jsc, Configuration: Release_Cairo_CFLite Win32 ------
15>------ Build started: Project: testRegExp, Configuration: Release_Cairo_CFLite Win32 ------
16>------ Build started: Project: WinLauncher, Configuration: Release_Cairo_CFLite Win32 ------
17>------ Build started: Project: WinLauncherLauncher, Configuration: Release_Cairo_CFLite Win32 ------
17>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WinLauncherLauncher.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WinLauncher.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(WinLauncherLauncher) does not match the Linker's OutputFile property value (WinLauncher). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
18>------ Build started: Project: TestNetscapePlugin, Configuration: Release_Cairo_CFLite Win32 ------
18>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\TestNetscapePlugin.dll) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\TestNetscapePlugin\npTestNetscapePlugin.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
18>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(TestNetscapePlugin) does not match the Linker's OutputFile property value (npTestNetscapePlugin). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
19>------ Build started: Project: ImageDiff, Configuration: Release_Cairo_CFLite Win32 ------
19>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\ImageDiff.dll) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\ImageDiff.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
19>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5): warning MSB8012: TargetExt(.dll) does not match the Linker's OutputFile property value (.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
20>------ Build started: Project: ImageDiffLauncher, Configuration: Release_Cairo_CFLite Win32 ------
20>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\ImageDiffLauncher.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\ImageDiff.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
20>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(ImageDiffLauncher) does not match the Linker's OutputFile property value (ImageDiff). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
21>------ Build started: Project: WebCoreTestSupport, Configuration: Release_Cairo_CFLite Win32 ------
22>------ Build started: Project: DumpRenderTree, Configuration: Release_Cairo_CFLite Win32 ------
23>------ Build started: Project: DumpRenderTreeLauncher, Configuration: Release_Cairo_CFLite Win32 ------
23>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\DumpRenderTreeLauncher.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\DumpRenderTree.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
23>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(DumpRenderTreeLauncher) does not match the Linker's OutputFile property value (DumpRenderTree). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
24>------ Build started: Project: WebKitLauncherWin, Configuration: Release_Cairo_CFLite Win32 ------
24>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WebKitLauncherWin.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WebKit.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
24>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(WebKitLauncherWin) does not match the Linker's OutputFile property value (WebKit). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
25>------ Build started: Project: record-memory-win, Configuration: Release_Cairo_CFLite Win32 ------
26>------ Build started: Project: InjectedBundleGenerated, Configuration: Release_Cairo_CFLite Win32 ------
27>------ Build started: Project: InjectedBundle, Configuration: Release_Cairo_CFLite Win32 ------
28>------ Build started: Project: WebKitTestRunner, Configuration: Release_Cairo_CFLite Win32 ------
29>------ Build started: Project: WebKitTestRunnerLauncher, Configuration: Release_Cairo_CFLite Win32 ------
29>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WebKitTestRunnerLauncher.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\WebKitTestRunner.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
29>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(WebKitTestRunnerLauncher) does not match the Linker's OutputFile property value (WebKitTestRunner). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile)
.
30>------ Build started: Project: gtest-md, Configuration: Release_Cairo_CFLite Win32 ------
30>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1151,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\lib\gtest-md.lib) does not match the Library's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\lib\gtest.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
30>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1153,5): warning MSB8012: TargetName(gtest-md) does not match the Library's OutputFile property value (gtest). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
31>------ Build started: Project: TestWebKitAPIGenerated, Configuration: Release_Cairo_CFLite Win32 ------
32>------ Build started: Project: TestWebKitAPI, Configuration: Release_Cairo_CFLite Win32 ------
33>------ Build started: Project: TestWebKitAPIInjectedBundle, Configuration: Release_Cairo_CFLite Win32 ------
34>------ Build started: Project: MiniBrowser, Configuration: Release_Cairo_CFLite Win32 ------
35>------ Build started: Project: MiniBrowserLauncher, Configuration: Release_Cairo_CFLite Win32 ------
35>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\MiniBrowserLauncher.exe) does not match the Linker's OutputFile property value (C:\prj\WebKit\WebKit-r106194\WebKitBuild\Release_Cairo_CFLite\bin\MiniBrowser.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
35>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(MiniBrowserLauncher) does not match the Linker's OutputFile property value (MiniBrowser). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
========== Build: 34 succeeded, 0 failed, 0 up-to-date, 1 skipped ==========

===========================================================
 WebKit is now built (49m:07s).
 To run Safari with this newly-built code, use the
 "../../../Cygwin/home/Ash/WebKit-r106194/Tools/Scripts/run-safari" script.
===========================================================

Ash@Bull ~
$

The Patch

The Patch: WebKit-vs2010-Patch.zip
Good luck and happy hacking.

Sep 252011
 

Building a large and complex such as WebKit is anything but straightforward. WebKit is the core of multiple browsers, most notably Safari and Chrome. Even the official instructions are sometimes lacking. This is mostly because such large projects are moving targets and it’s hard to keep track of all the changes in the requirements. Another issue is that most developers don’t setup build systems from scratch regularly. Probably no more than once or twice during the lifetime of a project. Even blogs, articles, forums and mailing lists that discuss building WebKit are almost completely outdated.

At any rate, these notes are up-to-date as of September 2011, I hope you find them helpful.

Background

WebKit can be built in different flavors. The differences are important, because one must setup the build system slightly differently for each flavor. There are essentially 4 different flavors: Apple Windows, WinCairo, Qt and GTK. All four require external libraries to be present for the build to succeed. I have no experience building the Qt and GTK flavors. Here I’ll cover Apple Windows and WinCairo. I do not cover building Chromium.

Build Environment

There are some common requirements, so first and foremost make sure these are setup correctly. You may follow the instructions described here. Unless you want to build using VS2005, ignore the instructions on VS2005.

Here is a summary:

  1. Install Cygwin. Use this downloader. Preferably install to C:\cygwin (I’ll assume that’s where it is). Never to a path with spaces! Make sure you install: svn, curl, unzip, make, perl, python, gcc, gcc-g++, gcc4, gcc4-g++, bison, flex, gperf.
  2. Install QuickTime SDK in the default location.
  3. Install DirectX SDK. However, if you’ll build with VS2005, don’t install anything newer than February 2010. It’s worth noting that the August 2007 version builds WebKit just fine (as of r95358 with default flags).
  4. Install Visual Studio 2005 or 2008 with all updates and Service Packs. For VS2005 please refer to the updates listed here. Personally, I suggest sticking with 2008.
  5. Install Windows SDK for Server 2003 R2 or newer. See below for more details.
  6. Download the Support Libraries from Apple. Copy the file (don’t extract, just copy the zip) into the WebKit source folder.
  7. Create WEBKITLIBRARIESDIR and WEBKITOUTPUTDIR environment variables. The values must be fully-qualified Windows paths and not Cygwin/unix paths. If you don’t want to change you system-wide path, skip this and see the script below.

Windows SDK

If you have multiple Windows SDKs (as is typically the case when installing multiple Visual Studio versions) then you will have to setup your target Visual Studio to use the SDK of choice. There are two ways to achieve this.

The first method is to change the BIN, INCLUDE and LIB directories from the Visual Studio Options dialog. From Tools > Options menu, from Projects and Solutions > VC++ Directories page, set the Executable files‘s top entry to %SDK%\bin folder, the %SDK%\lib at the top of the Library files entries and %SDK%\include to the top of the Include files‘s entries. Where %SDK% is the installation path of the SDK. Note: This will change the Visual Studio paths for all instances. So don’t make this change if other projects depend on your current settings, unless you care more about WebKit, of course.

The second method is much less intrusive. We can change the environment variables in a shell instance and pass them on to Visual Studio. This is relatively easy and convenient, but will require scripting. In the Tools/Scripts folder of WebKit there is a script called pdevenv. This Perl script is responsible for creating a Windows CMD file which ultimately runs Visual Studio. The reason for this is because Bash can’t execute the scripts necessary for setting up Visual Studio’s environment.

Here is an example of a modified pdevenv script that sets up the SDK:

#!/usr/bin/perl -w

use strict;
use warnings;
use File::Temp qw/tempfile/;
use FindBin;
use lib $FindBin::Bin;
use webkitdirs;

my ($fh, $path) = tempfile(UNLINK => 0, SUFFIX => '.cmd') or die;

chomp(my $vcBin = `cygpath -w "$FindBin::Bin/../vcbin"`);
chomp(my $scriptsPath = `cygpath -w "$FindBin::Bin"`);

# Reverse the order of these if you prefer to use VS2008.
my $vsToolsVar;
if ($ENV{'VS80COMNTOOLS'}) {
    $vsToolsVar = "VS80COMNTOOLS";
} elsif ($ENV{'VS90COMNTOOLS'}) {
    $vsToolsVar = "VS90COMNTOOLS";
} else {
    print "*************************************************************\n";
    print "Cannot find Visual Studio tools dir.\n";
    print "Please ensure that \$VS80COMNTOOLS or \$VS90COMNTOOLS\n";
    print "is set to a valid location.\n";
    print "*************************************************************\n";
    die;
}

# Comment the following to see the environment variables used.
print $fh "\@echo off\n\n";

# Setup Visual Studio.
print $fh "call \"\%" . $vsToolsVar . "\%\\vsvars32.bat\"\n\n";
print $fh "set PATH=$vcBin;$scriptsPath;\%PATH\%\n\n";

# Setup the 2003 SDK. Don't call its own SetEnv as it doesn't detect VS2008 or newer.
print $fh "Set MSSdk=C:\\Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\n\n";
print $fh "Set INETSDK=%MSSdk%\n\n";
print $fh "Set MSSdk=%MSSdk%\n\n";
print $fh "Set Mstools=%MSSdk%\n\n";
print $fh "Set Lib=%MSSdk%\\Lib;%Lib%\n\n";
print $fh "Set Include=%MSSdk%\\Include;%Include%\n\n";
print $fh "Set Path=%MSSdk%\\Bin;%MSSdk%\\Bin\\WinNT;%path%\n\n";

# Run Visual Studio.
print $fh "IF EXIST \"\%VSINSTALLDIR\%\\Common7\\IDE\\devenv.com\" (devenv.com /useenv " . join(" ", @ARGV) . ") ELSE ";
print $fh "VCExpress.exe /useenv " . join(" ", @ARGV) . "\n";

close $fh;
chmod 0755, $path;
chomp($path = `cygpath -w -s '$path'`);
exec("cmd /c \"call $path\"");

Note: If you already have SDK 6.0, 6.0A, 7.0, 7.0A or 7.1, you should be fine, but be warned: DirectX conflicts with 7.x SDKs, so make sure DirectX headers come after Windows SDK. If you have 6.0 or 6.0A you should have no problems building.

Building with VS2008

  1. Install VS2008 with all Service Packs and updates. (Express version needs a bit of a push to work. Please follow the these instructions.)
  2. Run update-webkit and build-webkit at least once. Regardless of the outcome, delete the contents of WEBKITOUTPUTDIR folder, wherever it is.
  3. Run VS2008 and open C:\cygwin\home\{username}\WebKitTrunk\Source\WebKit\win\WebKit.vcproj\WebKit.sln. You’ll be prompted to convert the project files from VS2005 format to 2008. Convert and save-all.
  4. WebKit projects have no tolerance for warnings and they are set to the highest level. Since VS2008 does emit some superfluous warnings (such as not inlining a force-inline function) the build will fail with these settings. As such, we need to change these setting.
    Select every project that doesn’t end in “generated”, right-click and select Properties. In the Properties window, from the top, change the Configuration to “All Configurations”. Navigate to Configuration Properties/C++/General in the left tree and on the right-side change the Warning Level to “Off: Turn Off All Warnings (/W0)” and Treat Warnings As Errors to “No”. Click OK to close this dialog.
    If you don’t see C++/General in the left tree it means you selected a non-C++ project. You may do this one project at a time.
  5. The project files are now ready. Save all and exit Visual Studio.

Build Notes

  1. Disable Anti-Virus scanners. (Can you spell incredible?) Cygwin needs to simulate Fork, which needs to clone process memory exactly. Many AV products add system hooks to scan processes in-memory. This disrupts memory layout and DLL relocation results in differences in the memory of forked processes resulting in memory corruption. This issue may never happen even with an AV running. However, if you see fork, out-of-memory or Virtual-Memory allocation failures, try disabling AV and try again. Some don’t remove their system hooks by temporarily disabling them, so you’ll need to uninstall them completely.
  2. Don’t build the Trunk. WebKit is large, complex and fast moving. Unless you like testing the limits of your sanity, you may want to stay away from the Trunk, which can be broken and problem-laden. Instead, get a successfully-built and packaged source archive from the nightly builds. At least have one recent successful build from a nightly archive before attempting the Trunk.
  3. Place Cygwin/bin before others in Path. In the system path, place CygWin binary folder after System folders but before anything else. Example: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\cygwin\bin;. This will insure that if you have Perl, SVN and other similar utilities installed outside of Cygwin, the Cygwin version will take precendence. NOTE: This may break other products that rely on the non-cygwin variants, in that case, you’ll have to perform this change in a build-script (see below).
  4. Place WebKit sources in your Cygwin home directory. If you install Cygwin in the root, your home should be here: C:\cygwin\home\{username}. WebKit should be in a folder directly within your home. Example: C:\cygwin\home\{username}\webkit.
  5. Add the scripts folder to the path. The webkit scripts must be reachable at all times, makes sure C:\cygwin\home\{username}\webkit\Tools\Scripts is prepended to the path.
  6. Don’t update the WinCairo code unless you want to build that flavor. It seems that running update-webkit --wincairo is changing enough in the code that it’s rendering the Apple Windows flavor broken. If this happens and you can’t build Apple Windows, then simply delete the WebKitLibraries folder, and run update-webkit (without --wincairo!).
  7. Run update-webkit at least once. Even if you don’t need to update the code, you must run this script at least once. Note that if you’ve downloaded a nightly-build package this script won’t update the code to the Trunk! It’ll only update the support libraries and other scripts.
  8. You may have to build twice before it works. The build almost always fails the first time and after deleting the WEBKITOUTPUTDIR folder, so the build script must be executed more than once to get a successful build.
  9. Look for the first failed project to fix errors. Since the WebKit build copies many source files as well as output binaries from one project to another, it’s vital that all dependencies of a sub-project succeed before it is built. That is, if a project fails, typically due to missing headers, identifiers etc, before panicking look for the first failed project and try to fix it. Most probably the errors are due to a previously broken dependency. This can get tricky, as some projects depend on external scripts that may be partially completed and stop reporting errors on subsequent builds. In such a case you won’t see failed dependencies and the sub-project in question would be the first to fail. To make sure this is the case, delete the WEBKITOUTPUTDIR folder and build again. If you get errors, note the first error you got and build again. Repeat this until you get the same error. This is the error you need to fix.
  10. Disable warning as error. If you get error C2220: warning treated as error - no 'object' file generated errors, then follow the instruction for disabling warning as error in the Building with VS2008 section above.

Here is a bash script to setup the environment, update and build. You must set your home folder name. Save this file in the webkit folder, name it build.

#! /bin/sh

echo
echo "Exporting environment varibles..."
export PATH=~/webkit/Tools/Scripts:$PATH
export WEBKITLIBRARIESDIR=C:\\cygwin\\home\\{username}\\webkit\\WebKitLibraries\\win
export WEBKITOUTPUTDIR=C:\\cygwin\\home\\{username}\\webkit\\WebKitBuild

echo
echo "Updating source tree..."
update-webkit

echo
echo "Building..."
build-webkit $*

Apple Windows

This flavor is the one used by Safari on Windows. The external libraries are copyrighted by Apple and aren’t redistributable. As such, the build system will require one to manually download an archive holding them from Apple after accepting the license agreement. This build, therefore, cannot be distributed on the internet with the external libraries. Having said that, one should at least try to get this flavor successfully built before attempting others.

To build this flavor follow these steps:

  1. Run the Cygwin shell.
  2. cd webkit
  3. ./build

WinCairo

To build the WinCairo flavor one had to manually download and install the various libraries, often having to build them manually or get a prebuilt version. Thanks to the efforts of volunteers now the update-webkit script automates all that. If you have built the Apple Windows flavor, you should be able to build WinCairo using the following:

  1. Run the Cygwin shell.
  2. cd webkit
  3. ./build –wincairo

If the build fails, try running the build script again.

However if you get “CF” identifier errors, consider updating the CF library manually. All public CF library identifiers and even filenames either begin or end with “CF”, so they are easy to spot. WebKit WinCairo uses a modified version of the original Apple sources called OpenCFLite. Download a recent version from the project’s page or get the trunk. You’ll have to bite the bullet and build the library yourself, update the headers and libs and build WebKit again.

To build OpenCFLite, open the solution in VS2005 or 2008 (depending on which you’ll use for the WebKit build). Choose the Release configuration and build the CFLite project. Ignore the mountain of warning and see if the build succeeded or not. If all goes well, in the root of the OpenCFLite source folder you should see a dist folder. Now copy the contents of dist into %WEBKITLIBRARIESDIR%\win overwriting existing files.

Delete the %WEBKITLIBRARIESDIR% folder and build Webkit WinCairo again. You should get a clean build.

Debugging

Now that you have a successful build, you may want to build the Debug version by passing --debug switch to the build-webkit script. You can execute this script directly (without running the above build script or update-webkit) or you can modify the above build script to the same effect.

With the debug build we can use the Visual Studio debugger or the ultra-powerful WinDbg. In Visual Studio simply open the solution file from C:\cygwin\home\{username}\WebKitTrunk\Source\WebKit\win\WebKit.vcproj\WebKit.sln, select one of the runner test projects as the startup and hit F5.

Happy hacking and don’t forget, you can contribute by submitting bug reports and sending patches and fixes. Good luck.

References

I couldn’t have succeeded in building WebKit without the help of numerous developers who shared their experience on the web. Here is a list of the most helpful and relevant pages. Be forewarned however, they are mostly outdated!

QR Code Business Card