ibuilding QtWebKit

需要确保已安装的依赖库的版本:
  • gperf (v3.0 or later)
  • bison (v2.4.1 or later)
  • flex (v2.5.33 or later)
  • sqlite (development files)
  • fontconfig (development files)
  • xrender (development files)
  • phonon (development files)
  • libjpeg (development files)
  • libpng (development files)

B

sudo apt-get install bison flex libqt4-dev libqt4-opengl-dev libphonon-dev libicu-dev libsqlite3-dev libxext-dev libxrender-dev gperf libfontconfig1-dev libphonon-dev g++

uibuilding WebKit

First follow the instructions there to get the sources. The Qt port is part of the WebKit source tree, so you don't need anything extra.

Finally, set the QTDIR environment variable to Qt 4.x's installation path and make sure Qt 4.x's qmake is the first qmake in your PATH (typically by running export PATH=$QTDIR/bin:$PATH).// QTDIR就是安装qt的path

If you are planning to compile it with  Qt 5, QTDIR should point to PathToRepository/qt5/qtbase/. You should also use this script  build-qt5.sh to build Qt5 (this is what the buildbots are using). Usually once a week we update the current Qt5 hash, so keep checking out this script.

If your qmake binary has a different name, e.g. when using Debian, use the --qmake= option to specify the name.

Build WebKit and the Qt test browser with

WebKit/Tools/Scripts/build-webkit --qt

You can also build using Intel® compilers with the following command.

WebKit/Tools/Scripts/build-webkit --qt --qmakearg="CONFIG+=icc -spec linux-icc"

build-webkit (see above) also supports special variable for specifying the OBJDIR directory, as well as some configure and build arguments

WEBKITOUTPUTDIR=`pwd`/qtbuild  WebKit/Tools/Scripts/build-webkit --qt --makeargs="-j20 -s" --no-video --debug

If you are planning to compile webkit2, Qt5 is required ( build instructions) and it'll be compiling both webkit1 and webkit2 by default.


============================================================

1,首先安装qt环境

在网址http://qt.nokia.com/downloads下下载qt源码。

下载qt-x11_4.7.0-0ubuntu.debain.tar.gz,解压缩到某一个文件夹下,我选择的是/home/shixiaochan目录,解压缩后生成文件夹qt-everywhere-opensource-src-4.8.0,然后执行下列命令安装qt

cd qt-everywhere-opensource-src-4.8.0

make confclean  //这个命令具有选择性,如果你的电脑上已经安装了qt环境则执行该命令;如果你是第一次安装,则该命令需要跳过不知行

./configure -prefix /usr/Qt-4.8.0  //-prefix=/usr是qt安装的目录,即qt将安装到usr文件夹下

make

sudo make install

至此qt环境安装完成,接下来安装webkit

2,安装webkit

下载webkit源代码,我使用的是WebKit-r81946,该源代码我放在/home/shixiaochan文件夹下。

(1)export QTDIR=/usr/Qt-4.8.0,export PATH=$QTDIR/bin:$PATH  //设置QT环境变量

(2)cd WebKit-r81946

(3)Tools/Scritpts/build-webkit --qt  //编译

(4)运行QTWebkit浏览器

编译完成后会在源码根目录下产生一个WebKitBuild文件夹,运行WebKitBuild/Release/bin/QtTestBrowser即可

WebKitBuild/Release/bin/QtTestBrowser 

最后,如果大家还是有什么问题的话,可以查看webkit的官方网站介绍的安装方法,该网站上提供了安装过程中可能会出现的问题的解决办法,网址如下:

http://trac.webkit.org/wiki/BuildingQtOnLinux。

希望对大家有所帮助。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值