Tuesday, May 26, 2009

Compiling WebKit on Windows

  1. If you're doing any open source programming, you'll need to constrain yourself to the Cairo-based WebKit, as Apple's CoreGraphics-based rendering is non-redistributable.
  2. You'll need VS 2005, as anything newer isn't supported. If you're using Express edition, make sure you have the Windows Platform SDK.
  3. You'll need cygwin to run the build scripts. Make sure you install perl (in cygwin) -- but not GCC, as this may interfere with the scripts finding Visual Studio's compiler.
  4. If cygwin has any problems with "/r" character in text files, run the command "dos2unix $(find . -name '*.sh' -o -name '*.pm')" in "C:\cygwin\home\$username", to convert bash and perl files to UNIX new-lines.
  5. Run "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" to enable the path's needed to run the compiler from command line.
  6. Check out your source from SVN. Nightly tarballs have some sort processing step specific to the platform that may remove things you might want.
  7. Check out the SVN into "C:\cygwin\home\$username", as the build scripts assume this.
  8. Set the environment variables "WEBKITLIBRARIESDIR=C:\cygwin\home\$username\WebKitSupportLibrary\win" and "WEBKITOUTPUTDIR=C:\cygwin\home\$username\webkit\WebKitBuild".
  9. Configure WebCore/config.h to build with Cairo instead of "Safari", as according to this.
  10. Run WebKit/WebKitTools/Scripts/update-webkit
  11. Run WebKit/WebKitTools/Scripts/update-webkit-support-libs
  12. Run WebKit/WebKitTools/Scripts/update-webkit-auxiliary-libs
  13. Run WebKit/WebKitTools/Scripts/build-webkit --cairo-win32 --debug
  14. To be continued!

2 comments:

Xpert2408 said...

I followed all steps but following error is coming...
Error 1 fatal error U1077: 'C:\Utils\Cygwin\bin\bash.EXE' : return code '0x1' NMAKE

JTech said...

I have followed the above mentioned steps, still I am getting the following error.

$ WebKit/WebKitTools/Scripts/build-webkit --debug
Calling 'qmake -r OUTPUT_DIR=D:\cygwin\home\jaffar\WebKit\WebKitBuild/Debug \Web
Kit.pro CONFIG-=release CONFIG+=debug' in D:\cygwin\home\jaffar\WebKit\WebKitBui
ld/Debug

Cannot find file: \WebKit.pro.
Failed to setup build environment using qmake!

jaffar@pcch-jaffar ~
$ WebKit/WebKitTools/Scripts/build-webkit --debug
Calling 'qmake -r OUTPUT_DIR=D:\cygwin\home\jaffar\WebKit\WebKitBuild/Debug d:\c
ygwin\home\jaffar\WebKitWebKit.pro CONFIG-=release CONFIG+=debug' in D:\cygwin\h
ome\jaffar\WebKit\WebKitBuild/Debug

Cannot find file: d:\cygwin\home\jaffar\WebKitWebKit.pro.
Failed to setup build environment using qmake!

jaffar@pcch-jaffar ~
$ WebKit/WebKitTools/Scripts/build-webkit --debug
Calling 'qmake -r OUTPUT_DIR=D:\cygwin\home\jaffar\WebKit\WebKitBuild/Debug d:\c
ygwin\home\jaffar\WebKit\WebKit.pro CONFIG-=release CONFIG+=debug' in D:\cygwin\
home\jaffar\WebKit\WebKitBuild/Debug

Reading D:/cygwin/home/jaffar/WebKit/WebCore/WebCore.pro [D:/cygwin/home/jaffar/
WebKit/WebKitBuild/Debug//WebCore]
c:\Qt\4.4.3\bin\rcc.exe: File does not exist '..\..\..\WebCore\inspector\front-e
nd\WebKit.qrc'
c:\Qt\4.4.3\bin\rcc.exe: File does not exist '..\..\..\WebCore\WebCore.qrc'
c:\Qt\4.4.3\bin\rcc.exe: File does not exist '..\..\..\WebCore\inspector\front-e
nd\WebKit.qrc'
c:\Qt\4.4.3\bin\rcc.exe: File does not exist '..\..\..\WebCore\WebCore.qrc'
Reading D:/cygwin/home/jaffar/WebKit/JavaScriptCore/jsc.pro [D:/cygwin/home/jaff
ar/WebKit/WebKitBuild/Debug//JavaScriptCore]
Reading D:/cygwin/home/jaffar/WebKit/WebKit/qt/QtLauncher/QtLauncher.pro [D:/cyg
win/home/jaffar/WebKit/WebKitBuild/Debug//WebKit/qt/QtLauncher]
Reading D:/cygwin/home/jaffar/WebKit/WebKit/qt/tests/tests.pro [D:/cygwin/home/j
affar/WebKit/WebKitBuild/Debug//WebKit/qt/tests]
Reading D:/cygwin/home/jaffar/WebKit/WebKit/qt/tests/qwebframe/qwebframe.pro [D
:/cygwin/home/jaffar/WebKit/WebKitBuild/Debug/WebKit/qt/tests//qwebframe]
Reading D:/cygwin/home/jaffar/WebKit/WebKit/qt/tests/qwebpage/qwebpage.pro [D:/
cygwin/home/jaffar/WebKit/WebKitBuild/Debug/WebKit/qt/tests//qwebpage]
Reading D:/cygwin/home/jaffar/WebKit/WebKit/qt/tests/qwebelement/qwebelement.pr
o [D:/cygwin/home/jaffar/WebKit/WebKitBuild/Debug/WebKit/qt/tests//qwebelement]
Reading D:/cygwin/home/jaffar/WebKit/WebKit/qt/tests/qwebhistoryinterface/qwebh
istoryinterface.pro [D:/cygwin/home/jaffar/WebKit/WebKitBuild/Debug/WebKit/qt/te
sts//qwebhistoryinterface]
Reading D:/cygwin/home/jaffar/WebKit/WebKit/qt/tests/qwebview/qwebview.pro [D:/
cygwin/home/jaffar/WebKit/WebKitBuild/Debug/WebKit/qt/tests//qwebview]
Reading D:/cygwin/home/jaffar/WebKit/WebKit/qt/tests/qwebhistory/qwebhistory.pr
o [D:/cygwin/home/jaffar/WebKit/WebKitBuild/Debug/WebKit/qt/tests//qwebhistory]
Makefile:178: *** multiple target patterns. Stop.


Please let me know, How to come out from this issue.

Regards,
Jaffar