<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Playing on the frontier &#187; msvc</title>
	<atom:link href="http://siphon9.net/loune/tag/msvc/feed/" rel="self" type="application/rss+xml" />
	<link>http://siphon9.net/loune</link>
	<description></description>
	<lastBuildDate>Sun, 19 Feb 2012 05:57:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Compiling WebKit/Cairo on Windows with Visual C++ Express</title>
		<link>http://siphon9.net/loune/2009/07/compiling-webkitcairo-on-windows-with-visual-c-express/</link>
		<comments>http://siphon9.net/loune/2009/07/compiling-webkitcairo-on-windows-with-visual-c-express/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 15:27:22 +0000</pubDate>
		<dc:creator>Loune</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[cairo]]></category>
		<category><![CDATA[msvc]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://siphon9.net/loune/?p=48</guid>
		<description><![CDATA[Just for interest, I decided to build webkit on Windows. This supposed to be a painless task but unfortunately, anything that involves build scripts creates drama. The instructions on compiling are a bit scant, giving the impression that it&#8217;s super easy. Maybe it is and I&#8217;m just a bit dumb, but anyways after a few [...]]]></description>
			<content:encoded><![CDATA[<p>Just for interest, I decided to build webkit on Windows. This supposed to be a painless task but unfortunately, anything that involves build scripts creates drama. The <a href="http://trac.webkit.org/wiki/BuildingCairoOnWindows">instructions</a> on compiling are a bit scant, giving the impression that it&#8217;s super easy. Maybe it is and I&#8217;m just a bit dumb, but anyways after a few hours battling with it I finally got it working. Don&#8217;t bother trying with Visual Studio 2008 as you might as well jump off a cliff from compilation errors &#8211; Get the <a href="http://go.microsoft.com/fwlink/?linkid=57034">Visual C++ Express 2005</a> edition and <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=7B0B0339-613A-46E6-AB4D-080D4D4A8C4E&amp;displaylang=en">SP1 patch</a>. Here are the steps from scratch:</p>
<p>Go to http://nightly.webkit.org/ and get the source tar.bz2.</p>
<p>Extract it somewhere (WinRAR is a good tool for this). This somewhere will now be referred to as {EXTRACTED}.</p>
<p>For compiling on windows, you need windows Download the <a href="http://developer.apple.com/opensource/internet/webkit_sptlib_agree.html">WebKitSupportLibrary.zip</a> then copy this zip file on the root of your extracted webkit folder. Don&#8217;t extract it. This zip gives you unicode/uchar.h or pthread.h which would otherwise be reported missing.</p>
<p>So what&#8217;s the difference between webkit/cairo and regular webkit? The regular webkit depends on proprietary Apple libraries such as CoreGraphics. The webkit/<a href="http://www.cairographics.org/">cairo</a> build substitutes that dependency with the free Cairo 2D graphics library. The library has a clean C API and contains very compehensive drawing routines. It also sports multiple output backends allowing you to create PDFs or SVGs.</p>
<p>Webkit/cairo has more dependencies on open source libraries such as curl. You either build them or get the pre-built ones some nice folks have put online &#8211; Get it <a href="http://idisk.mac.com/bfulgham-Public/requirements.zip">here</a> and extract it to a place like {EXTRACTED}\requirements.</p>
<p>Now you have to install Cygwin as noted <a href="http://webkit.org/building/tools.html">here</a> on point number 3. The important point I want to highlight is due to some assumptions made in the VS project files, the directory HAS to be: at c:\cygwin (or $(SYSTEMROOT)\cygwin). For Vista, you need to perform additional minor gymnastics which I&#8217;m not going to outline here. Read it on the previous link.</p>
<p>You also need to get the <a href="http://developer.apple.com/quicktime/download/">Quick Time SDK</a>. Annoyingly, to download quicktime SDK you need to register a Apple Developer Connection (ADC) account. After entering details of your daily life, you&#8217;re grant access to the file. Good thing was that you don&#8217;t need quick time or itunes installed. You should probably keep the default install directory as well.</p>
<p>Next is setting two environment variables. This involves going into the System Properties in your Control Panel. You can just put add it under the User variables:</p>
<ul>
<li>WEBKITLIBRARIESDIR &#8211; point it to your {EXTRACTED}\WebKit\WebKitLibraries\win</li>
<li>WEBKITOUTPUTDIR &#8211; point it somewhere like c:\webkitdist (create this directory as well)</li>
</ul>
<p>You will now need to add some VC++ paths. Open C++ Express and go to Tools &gt; Options &gt; Projects &gt; VC++ Directories</p>
<p>On the top drop down, select show directories for include files and add</p>
<ul>
<li>{EXTRACTED}\requirements\include</li>
<li>{EXTRACTED}\requirements\include\cairo</li>
<li>{EXTRACTED}\requirements\include\curl</li>
<li>{EXTRACTED}\requirements\include\libpng13</li>
</ul>
<p>then select show directories for library files and add</p>
<ul>
<li>{EXTRACTED}\requirements\lib</li>
</ul>
<p>Lastly in the Executables files section add</p>
<ul>
<li> <em>C:\cygwin\bin</em> &#8211; Put this just above <em>$(PATH)</em> but after all the other directories. This is important as if you put it on top, cygwin&#8217;s link.exe will conflict with MSVC&#8217;s, and you need to put it above $(PATH) or the PATH directories that have similarly named binaries to cygwin&#8217;s will conflict.</li>
</ul>
<p>You will also need to get the Platform SDK as noted in the <a href="http://webkit.org/building/build.html">build instructions</a> if you don&#8217;t have it already. Any recent version of the SDK should be alright. Add the executable, include and lib directories to the VC++ directories like the above, described <a href="http://msdn.microsoft.com/en-us/library/ms235626(VS.80).aspx">here</a>. The instructions about vcprops editing aren&#8217;t really important.</p>
<p>For the include path, you also need to add the mfc includes or the compiler will complain about missing winres.h</p>
<p>Due to some bootstrapping scripts, the first time you compile you can&#8217;t do it through the Visual C++ IDE. You will need to compile it via the command line in cygwin. Open the cygwin shell and change directory to {EXTRACTED} ie <em>cd c:/webkit/</em></p>
<p>Then run:</p>
<p><code>WebkitTools/Scripts/update-webkit</code></p>
<p>After it completes, you can start building</p>
<p><code>WebkitTools/Scripts/build-webkit --wincairo --debug</code></p>
<p>Remove the &#8211;debug flag if you want to compile for Release. <i>Note: Previously the wincairo flag was cairo-win32.</i></p>
<p>After the first successful build, you can now open {EXTRACTED}\WebKit\win\WebKit.vcproj in Visual Studio. Make sure the build profile is set to Debug_Cairo, set it. You can choose Release_Cairo as well if you so wish. Finally, <em>winlauncher</em> is the test browser you use to try out your new build, so set that as your active project. Don&#8217;t forget to copy all the requirements dlls (ie cairo.dll) into the dist\bin folder where winlauncher.exe is or else it&#8217;ll complain about missing DLLs.</p>
]]></content:encoded>
			<wfw:commentRss>http://siphon9.net/loune/2009/07/compiling-webkitcairo-on-windows-with-visual-c-express/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
	</channel>
</rss>

