WebKit compilation summary on Windows Platform

Source: Internet
Author: User
Tags subversion client perl script

WebKit is a world-recognized excellent open-source browser kernel. It has the advantages of Fast Rendering, flexible customization, and multi-platform support. China's well-known Maxthon and ucweb both select WebKit as the browser kernel. Google and Apple have also made only chrome and Safari browsers Based on WebKit.

Although WebKit is becoming increasingly popularProgramBut the compilation process is very painful. Below I will compile WebKitCodeTo share your experience.

 

1)Obtain WebKitSource code

The source code of WebKit is managed using the Subversion tool. Therefore, the source code can be obtained from the http://svn.webkit.org/repository/webkit/trunk as long as the Subversion client is available. However, this is not the best method. In the actual compilation process, the Code obtained through SVN may bring you a lot of troubles. Therefore, we recommend that you directly download the WebKit source code compressed package from the WebKit build. The specific address is: http://nightly.webkit.org/builds/trunk/src/1 such a large project as WebKit still follows the daily build principle, it is really amazing.

In this article, the source code of WebKit is r52221, but I haven't compiled this version of WebKit successfully in the last two days. The reason is that Visual Studio 2005 will stop responding after a few minutes of opening the project with Visual Studio 2005. I tested r50006, the first version of the 5-character header. The larger the version number, the newer the source code, and the older the version number.

 

2)Build a WebKit compiling environment

The WebKit website has an articleArticleExplains how WebKit is built in Windows: http://webkit.org/building/tools.html, but this article is too simple. This is also the best place for WebKit. After more than ten failures, I finally found a shortcut to the goal.

 

Hardware

It is best to find a computer with a memory greater than 2 GB. Because the WebKit project is too large, hundreds of. OBJ files are generated. When performing the link operation, the memory will require approximately GB of memory. If your machine is installed with a vista-like memory operating system, wait until link.exe tells you "out of memory. The memory of the machine where I installed Vista only has a zone of 2 GB, and the connection failed several times. In the end, it forced me to compile in safe mode (even the NIC driver didn't dare to load, finally, when the peak memory reaches 1.99 GB, It is very exciting and exciting to pass the risk.

Of course, the larger the hard disk is, the better, because after the WebKit source code is expanded, it will take up m-0000m disk space, and the intermediate files generated during the compilation process will need about 4 GB of storage space. In addition, the disk space occupied by cygwin Visual Studio is quite large. The most important thing is that it is best to reserve around 4 GB space for the system disk.

In fact, using a multi-core CPU can also be used to compile WebKit. Compiling scripts can be used to compile WebKit in parallel at the same time, greatly shortening the Compilation Time.

 

Software

First, you need to install Visual Studio 2005 SP1. If it is Vista or window 7, you need to install SP1 update for Vista. Visual c ++ 2005 Express can also compile WebKit, but you need to install the Platform SDK separately. Practice has proved that WebKit can be compiled on platform 5.0 6.0.

This also raises a problem. What if Visual Studio 2008 has been installed on your machine? Don't worry, Visual Studio 2005 and Visual Studio 2008 can coexist, and Visual Studio 2005 can be installed after Viusal studio 2008. However, when Visual Studio 2005 is installed after Visual Studio 2008, the Perl script of WebKit will only go to the binfolder of VC under "System Disk \ Program Files \ Microsoft Visual Studio \" (also the folder of cl.exe ). If the installed VS 2005 is not on the system disk, copy the bin folder of VC to the directory on the system disk.

After Visual Studio 2005 is installed, you need to install another large block header cygwin. Cygwin actually simulates a Unix environment on Windows. To install cygwinit, you 'd better not directly use the setup.exe file provided on cygwinnet. Instead, use the cygwin-downloader tool provided on the webkit.org website. Cygwin-downloader downloads the 101 tools required to compile WebKit (several more tools may be available now), such as Perl, zlib, and bash. After the download is complete, run cygwin's Installation Tool setup.exe and select to install it from the local directory. Please note! Cygwin must be installed in the system disk partition. If drive C is the system disk, cygwin must be installed in c: \ cygwin. After the installation is complete, it will occupy several hundred megabytes of space.

Next, you still need to install the QuickTime SDK. It is said that this QuickTime SDK can be not installed, but I found that if it is not installed, the qtmovie project in the WebKit solution must not be compiled successfully. QuickTime must be installed on the system disk: \ Program Files \ quciktime SDK \. Do not change the installation path.

 

Finally, after decompressing the WebKit source code file, you also need to download the webkitsupplibrlibrary.zip file from the webkit.org site, which is a pre-compiled version of some third-party libraries on the Windows platform. Used for WebKit link. After the download, the zip file can be directly stored in the root directory of WebKit Without decompression.

 

 

Compilation steps

1) set environment variables. Set webkitlibrariesdir to the WebKit source code directory \ webkitlibraries \ win path; Set webkitoutputdir to the output folder where you plan to store OBJ and DLL, of course, the partition of this folder must have at least 4 GB of space.

2) execute the update script. Run the cygwin command line window on the desktop, and then use the CD command (the same as the dos CD command) to jump to the WebKit source code directory \ webkittools \ scripts folder. For example, put the source code of my WebKit on the drive F, that is, cd f:/WebKit/webkittools/scripts/and run the update-WebKit and update-WebKit-support-libs scripts in this directory. This step is not mentioned in many blogs. In fact, this step is the key to successful compilation.

3) after successfully executing the preceding two steps, you can use Visual Studio 2005 to open the WebKit. sln solution under the WebKit source code directory \ WebKit \ win \ WebKit. vcproj. By default, this SLN has six compiling configurations: Debug, debug_all, debug_cairo, release, debug_internal, and release_cairo. The version compiled with release is the rendering engine version of Apple, which is consistent with that of safari. Release_cairo is compiled to support the Cairo rendering engine version. This version can be run independently from the apple environment, but cannot be run in Apple's Safari environment. To monitor compilation success, you can use the winlauncher.exe application to load WebKit for testing.

 

Write it here first, and then remember something to add.

 

 

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.