Win7 & VS2013 編譯 WebKit 總結

[轉載請註明Moon出品: http://blog.csdn.net/lzl124631x]

距離上次編譯WebKit(實際日期是2012年10月)已經過去一年多了, 這期間有很多人問我編譯相關的問題, 我由於時間關係沒有回覆這些朋友, 先在這裏說聲抱歉.
這幾天我再次編譯了一下WebKit, 發現編譯它已經要求VS2013了, 而且很多地方都變化了. 再次經過一番尿血的嘗試, 終於再次得到昇天...此次編譯版本是WebKit-r161524 (2014-01-09 02:29:27 GMT), 編譯成功於2014-01-10, 可以說還是熱乎的.
全部編譯過程如下, 先弄了個英文版, 稍後添加中文版. 這次省略了介紹什麼的, 如果大家感興趣請看第一篇編譯總結. 本篇文章內容還僅是Cygwin下的編譯, 稍後進行VS2013下的編譯和斷點調試.
我將編譯的Log文件和此文檔的html版本上傳到CSDN資源了(http://download.csdn.net/detail/lzl124631x/6835631), 大家可以去下載, 也許有幫助吧.
最後, 還望大家多多支持, 謝謝!

Special thanks to Roger Fong for his generous help and patience.

Environment:
     Operating System:     Windows 7 Ultimate 32-bit
     Processor:               Intel Core i7 860
     Installed Memory:     4.00 GB    

1. Installing VS2013:
     a. Install Win7 SP1 (windows6.1-KB976932-X86.exe)
     b. Install 5 patches for IE10
          ⅰ. Windows6.1-KB2533623-x86.msu
          ⅱ. Windows6.1-KB2670838-x86.msu
          ⅲ. Windows6.1-KB2729094-v2-x86.msu
          ⅳ. Windows6.1-KB2731771-x86.msu
          ⅴ. Windows6.1-KB2786081-x86.msu
     c. Install IE10 (IE10-Windows6.1-x86-en-us.exe)
     d. Install VS2013 (VS2013_RTM_ULT_ENU.iso)
     e. Right click on "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe", "Properties", "Compatibility", check "Run this program as an administrator".

2. Installing Cygwin
     a. Download cygwin-downloader.zip (http://svn.webkit.org/repository/webkit/trunk/Tools/CygwinDownloader/cygwin-downloader.zip) and unzip it.
     b. Run cygwin-downloader.exe and wait...
     c. Run setup.exe, select "Install from Local Directory" and install.
     d. Run setup.exe, select "Install from Internet"
          i. In steps before "Select Packages", just select default folders, whatever connection and download site.
          ⅱ. Select Packages: Search "gcc", expand Devel, select "gcc-g++: GNU Compiler Collection(C++)"
          ⅲ. Select Packages: Search "gdb", expand Devel, select "gdb: The GNU Debugger"
     See more at "Installing gcc with Cygwin"(http://www.eecg.utoronto.ca/~aamodt/ece242/cygwin.html)
     e. Open C:\cygwin\etc\profile
          ⅰ. Modify line 32 to PATH="/bin:${PATH}"
          ⅱ. Comment line 44-50 (related to TMP variable) by adding '#' at the beginning of each line.

3. Installing SDKs
     a. Install QuickTime SDK (https://developer.apple.com/quicktime/)
     b. Install Direct SDK (June 2010 DirectX SDK:http://www.microsoft.com/en-us/download/details.aspx?id=6812)

4. Getting the Code
     a. Download Nightly Build (http://nightly.webkit.org/) and unzip it. My version is WebKit-r161524.
     b. Suppress Warning 4309: Open "WebKitLibraries/win/tools/vsprops/common.props", find tag <DisableSpecificWarnings>, add 4309.
     c. Download Support Library (https://developer.apple.com/opensource/internet/webkit_sptlib_agree.html) and copy it into WebKit-r161524. DO NOT unzip it.
     d. Open Source/WebCore/platform/LocalizedString.cpp, search "Look Up", delete the DOUBLE-BYTE double quotation marks around “%@” and “<selection>”.

5. Save the following lines as a .cmd/.bat file (Build.cmd, for example), and put it into the WebKit-r161524 directory.
@echo off

echo Setting up links...
set CYGWIN_DIR=C:\cygwin

set WEBKIT_SOURCE_DIR=%~dp0%
if "%WEBKIT_SOURCE_DIR:~-1%"=="\" set WEBKIT_SOURCE_DIR=%WEBKIT_SOURCE_DIR:~0,-1%

for /R "delims=\" %%a in (%WEBKIT_SOURCE_DIR%) do set WEBKIT_DIR_NAME=%%~nxa
set WEBKIT_LINK_DIR=%CYGWIN_DIR%\home\%username%\%WEBKIT_DIR_NAME%

if exist "%WEBKIT_LINK_DIR%" rmdir "%WEBKIT_LINK_DIR%"
mklink /D "%WEBKIT_LINK_DIR%" "%WEBKIT_SOURCE_DIR%"

echo Exporting environment varibles...
set WEBKIT_OUTPUTDIR=%WEBKIT_LINK_DIR%\WebKitBuildByCygwin
set WEBKIT_LIBRARIES=%WEBKIT_LINK_DIR%\WebKitLibraries\win
set VSINSTALLDIR=%VS120COMNTOOLS%..\..
set PATH=%WEBKIT_LINK_DIR%\Tools\Scripts;%PATH%

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

6. Build
     a. run Build.cmd
     b. update-webkit
     c. build-webkit --debug | tee WebKit-r161524/log.txt

Other Material:
     a. Building on Windows:http://trac.webkit.org/wiki/BuildingOnWindows (WebKit Team's note on building on windows)
     b. ​WebKit Wiki: http://trac.webkit.org/wiki/WikiStart

Error Solutions:
---------------------------------------------------------------------
Error Message:
     17>     sh: /usr/bin/gcc: No such file or directory
     17>     Failed to read names from file: /cygdrive/g/WEBKIT~1/Source/WebCore/html/HTMLTagNames.in at /cygdrive/g/WEBKIT~1/Source/WebCore/dom/make_names.pl line 324.
     17>     /cygdrive/g/WEBKIT~1/Source/WebCore/DerivedSources.make:942: recipe for target 'HTMLElementFactory.cpp' failed
     17>     make: *** [HTMLElementFactory.cpp] Error 127
     17>     make: *** Waiting for unfinished jobs....
     17>     ./CSSGrammar.y:62.1: error: syntax error, unexpected end of file
Solution:
     Install gcc to Cygwin (step 2.d).
---------------------------------------------------------------------
Error Message:
     17>     build-generated-files.sh: line 59: cd: /home/Moon/WEBKIT~1/WEBKIT~2/Debug/obj32/WebCore/DerivedSources: Permission denied
     18>     c1xx : fatal error C1083: Cannot open source file: 'C:\cygwin\home\Moon\WebKit-r161524\WebKitBuildByCygwin\Debug\obj32\WebCore\DerivedSources\CSSPropertyNames.cpp': No such file or directory
Solution:
     Right click on "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe", "Properties", "Compatibility", check "Run this program as an administrator"
---------------------------------------------------------------------
Error Message:
     ..\platform\LocalizedStrings.cpp(248): error C2001: newline in constant
Or
     ..\platform\LocalizedStrings.cpp(250): error C2001: newline in constant
Solution:
     Open Source/WebCore/platform/LocalizedString.cpp, search "Look Up", delete the DOUBLE-BYTE double quotation marks around “%@” and “<selection>”.
     

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章