Wednesday, November 23, 2011

Building Webkit with Qt 4.8 on Linux

To build recent webkit codebase for qt, qt 4.8 is required.Currently to pre-built binaries for qt 4.8 is available, so you have to build it manually.

The steps to build webkit with qt4.8 on linux (mine is ubuntu Natty version) are as follows:-
Step 1. Get the qt 4.8 source:-
Get the qt 4.8 source from here in tar.gz format.

Step 2. Uncompress it:-
Uncompress it by using the below commands:-
  1. gunzip qt-everywhere-opensource-src-%VERSION%.tar.gz
  2. tar xvf qt-everywhere-opensource-src-%VERSION%.tar
Step 3. Building the qt 4.8 library:-
Move to the qt source home folder and use following commands:-
  1. cd qt-everywhere-opensource-src-%VERSION%
  2. ./configure // Deafault confing can be used
  3. make // create the library
  4. make install // install the library
Step 4: Set the Environment Variables:-
  • export PATH=/usr/local/Trolltech/Qt-4.8.0/bin:$PATH
With this step qt library is set-up is complete.

Step 5. Now build the webkit library

Get the webkit source from www.webkit.org.
From the home folder (which contains the "Source", "Tools" folder etc) use the below command:-
  • export QTDIR="/usr/local/Trolltech/Qt-4.8.0" // Set the Qt Dir
  • ./Tools/Scripts/build-webkit --qt [--debug]
Step 5. Launch qtwebkit
Now to launch the webkit library use the below command:-
  • ./Tools/Scripts/run-launcher --qt [--debug]