QtWebkit开发环境配置及编译方法-Windows32bit

Dependencies



Please install these tools in a path without
spaces
 (i.e. not in "C:\Program Files")

Make sure the GnuWin32 packages are in your PATH as well as Perl and Python.
You also need to have %QTDIR% set and have %QTDIR%\bin in your PATH.
If you
have Cygwin‘s bin directory in your path, make sure that it comes after
ActiveState Perl and GnuWin32. You might have to remove it completely from your
PATH if you have problems with slashes and backslashes while building using
MinGW. mingw32-make and GnuWin32‘smake will use
sh.exe to run commands if they find it in the PATH.

Building QtWebKit


  • Open a Qt Command Prompt from the Start Menu.
    • Alternatively you can use a MSVC or MinGW command line environment that
      matches the version of Qt you downloaded and make
      sure qmake is accessible in PATH.
      Note that building
      inside Cygwin or MSYS is currently not supported. Please use a Windows
      command prompt.

  • Chdir into the WebKit source tree

  • Run perl Tools\Scripts\build-webkit --qt --release

  • Wait :)

  • Try to run WebKitBuild\Release\bin\QtTestBrowser.exe

Notes about
building QtWebKit with the
Qt/Windows OpenSource Edition


  • If you want to compile using multiple cores:
    • On MinGW you can try set MAKE_COMMAND=mingw32-make
      -j%NUMBER_OF_PROCESSORS%
      .
      If this do not work you might have to
      Ctrl-C build-webkit‘s execution, go in the
      WebKitBuild\Release\ directory and run:
      mingw32-make -C JavaScriptCore -f Makefile.Release -j%NUMBER_OF_PROCESSORS% && mingw32-make -C WebCore -f Makefile.Release -j%NUMBER_OF_PROCESSORS% && mingw32-make

    • On MSVC use the CL environment variable along with the /MP switch:
      set CL= /MP

  • If you haven‘t set up your PATH already to include the GnuWin32 packages
    then you may want to execute the following command:set
    PATH=C:\GnuWin32\bin;C:\Perl\bin;%PATH%
     Provided that the GnuWin32
    packages are installed in C:\GnuWin32\bin and Perl
    inC:\Perl\bin.

  • If you get build errors in JavaScriptCore\bindings\NP_jsobject.cpp
    or similar then please make sure that the Microsoft Platform SDK
    is NOT in your %INCLUDE% path because it conflicts
    with your MingW headers.

  • If you get build errors after makefile generation
    ("Makefile:178: * Multiple target patterns. Stop.") then you‘re
    probably still using the Cygwin version of make. Try removing Cygwin from your
    %PATH% for the time being (it‘s not currently supported, as mentioned
    above).

A
‘Works For Me‘ Step-by-Step Guide to building QtWebKit on
Windows using mingw-w64/w32


  1. The patch in bug report https://bugs.webkit.org/show_bug.cgi?id=38747 may
    not yet have been applied to Qt git, apply manually if necessary

  2. Until Qt 4.7 is released, use the git version of Qt 4.7: http://qt.gitorious.org/qt/qt/trees/4.7

  3. Get a mingw-w64 build with mingw32-make:
    • I‘m assuming you‘re running Windows x64, as you will be testing the
      build :)

    • Two options:

  4. Set up your environment:
    • Qt sources are in C:\Qt so that configure.exe is present in that
      directory

    • perl is installed: http://strawberryperl.com/ (installer
      should add perl.exe to PATH)

    • open cmd.exe

    • run following commands:
      set PATH=C:\mingw64\bin;C:\Qt\bin;%PATH%
      set QTDIR=C:\Qt
      cd C:\Qt
      configure -qt-style-windowsxp -qt-style-windowsvista -phonon
      mingw32-make

  5. Everything should have built. Have fun!

Remarks: mingw-w64/w32 also provides a toolchain targetting 32-bit windows.
Sezero provides builds:http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/ The
procedure to compile Qt is exactly the same, only that he mingw64 folder name
should be mingw32.

A
‘Works For Me‘ Step-by-Step Guide to Building QtWebKit on
Windows using MinGW


  1. The the mentioned GnuWin32 tools

  2. Download QT
    SDK (and QT Creator)
     and Download
    ActivePerl

  3. Open for example a Qt Command Prompt from the Start Menu. Click
    Start->Program Files->Qt->QT Command Prompt
    . In fact, you really
    do need to use Qt Command Prompt for this rather than the normal windows
    command prompt.

  4. Make sure the GnuWin32 packages are in your PATH as well as Perl (set
    PATH=C:\program files\gnuwin32\bin;C:\Perl\site\bin;%PATH%
    .

  5. You also need to have %QTDIR% set and have %QTDIR%\bin in your PATH.

  6. Trim your PATH down as much as possible. Remove Git and Mingw from your
    PATH if you have them installed, their presence can cause odd build failures.
    For example, the PATH that works for me is:
     set Path=c:\GnuWin32\bin;c:\Qt\2009.01\qt\bin;c:\Qt\2009.01\bin;C:\Perl\bin;C:\Windows\system32;c:\Qt\2009.01\mingw\bin;C:\Perl\site\bin;C:\Windows

    • Note that c:\Qt\2009.01\qt above will vary depending
      on the QT SDK that you downloaded. You should modify it appropriately.

  7. Download WebKit from svn (make sure you‘ve left the location of your svn
    client in your %PATH% above):
    $ svn checkout http://svn.webkit.org/repository/webkit/trunk %HOME%\WebKit
    $ cd %HOME%/WebKit

  8. Change into the WebKit source tree: cd
    c:\location\of\webkit

  9. For some reason, the build command was unable to create
    the WebKitBuild\Release folders by itself on my PC. I had
    to do mkdir WebKitBuild and mkdir
    WebKitBuild\Release
     before building.

  10. You may need to do a mkdir c:\tmp. The WebKit build relies
    on the existence of c:\tmp when building in Windows.

  11. Build the patched webkit (release mode): $perl
    Tools\Scripts\build-webkit --qt --release

  12. The webkit build takes forever, you can shorten it using the
    build-webkit‘s --no-svg or --minimal flags:
        $perl Tools\Scripts\build-webkit --qt --release --no-svg
    $perl Tools\Scripts\build-webkit --qt --release --minimal

Speedup Git on Windows

Git tends to be rather slow for repositories with a huge amount of files on
Windows. One way to deal with that is to use a sparse-checkout, to "ignore"
certain files. The LayoutTests directory is certainly a good
candidate, if you currently do not need these files. A sparse-checkout uses a
config file (.git/info/sparse-checkout) to determine if a file should
be checked out or not. Files mentioned in the config file will be part of the
checkout. Files not mentioned in the config file will be ignored. There is also
a syntax to invert this logic, but it is currently not working well with
directories.

  1. Create a .git/info/sparse-checkout file that will
    ignore the LayoutTests directory:
    /*
    !LayoutTests

  2. Enable sparse-checkout:
    git config core.sparsecheckout true

  3. Remove the LayoutTests directory if it is already there:
    rmdir /s LayoutTests

  4. Update the git tree cache:
    git read-tree -m -u HEAD

  5. Check which files have been excluded:
    git ls-files -v | grep ^S
     
    参考编译方法:
     
    1.Qt官网下载最新版本:http://qt-project.org/downloads
    2.将下载的压缩包解压(例如,路径为:F:/QtWebKit),配置相关环境变量:
    -----创建两个变量名,分别为QTDIR(值为 F:/QtWebKit/qt-windows-open.....),QMAKESPEC(值为 win32-msvc20XX; 这里的XX,根据VS的版本决定,本人用的是2010,所以为win32-msvc2010)
    3.编译源代码
    -----打开VS软件,进入Visual Studio Tools中,运行命令行,锁定到qt的源码目录下,运行命令:configure.exe -webkit
    -----编译过程中会出现GPL授权相关提示,yes即可,第一步会生成qmake
    -----然后运行nmake命令,编译完即成功编译
    4.编译应用程序,同上,一次执行qmake和nmake命令,会在debug目录下生成可执行文件
    5.qt安装环境里包含webkit源代码,而且自带一个简单的Browser项目
    6.将Browser工程设为启动项目,然后编译即可。
     

时间: 2024-08-08 05:22:15

QtWebkit开发环境配置及编译方法-Windows32bit的相关文章

【OpenCV入门教程之一】 OpenCV 2.4.8 +VS2010的开发环境配置

目录(?)[-] 因为读研期间的研究方向是图像处理所以浅墨这段时间闭门研究了很多OpenCV和图像处理相关的知识与内容眼看自己积累到一定的程度了于是决定开始开设这个OpenCV系列专栏总结自己所学也分享知识给大家 还是先放出待会儿的测试用图 下载和安装OpenCV SDK sources里面是源代码想查看完整的源代码需要用cmake来解包如何解包大家百度一下就可以或者下次浅墨来专门讲一讲这里就先不多说了 配置环境变量 工程包含include目录的配置 工程库lib目录的配置 链接库的配置 在Wi

Visual studio 通用开发环境配置:SDL,FFMPEG为例

引言 每一个C++库的使用都是从开发环境的配置开始的,其实每个库的配置过程都是大同小异,总结下来有下面几个步骤: 下载库文件,这里假定是已经预先编译完成的. 配置库文件的包含目录(include)和库目录(lib) 配置库文件的动态链接库(dll),这一步是很多人容易忽略的.上面配置好包含目录和库目录,只是开发环境配置完成了,没有配置好dll,在使用该库的程序运行时,会造成操作系统无法加载库对应的动态链接库.下面以SDL的配置为例,详细说明是如何配置的. SDL在visual studio下的开

Qt For Android 开发环境配置

想了想,还是再写一篇关于Qt for Android开发环境配置的教程. 准备:Java jdk,Android sdk,Android adb,Android ndk,Android ant,Qt 支持 安卓的版本,比如qt-opensource-windows-x86-android-5.6.2. 前言:在Qt的版本更新中,Qt支持的功能越来越多,安装包也越来越大,在Qt5.9出来之前,Qt的每个版本都对应的编译环境,而在Qt5.9后Qt官方将好多编译环境放到了一起,而在这里我要说的是要配置

(转) 安装OpenCV:OpenCV 2.4.8或OpenCV 2.4.9 +VS 开发环境配置

因为读研期间的研究方向是图像处理,所以浅墨这段时间闭门研究了很多OpenCV和图像处理相关的知识与内容.眼看自己积累到一定的程度了,于是决定开始开设这个OpenCV系列专栏,总结自己所学,也分享知识给大家. 好了,这篇文章作为OpenCV的启程篇,自然少不了先系统地介绍OpenCV开发环境的配置. 浅墨前后经历过OpenCV 2.4.6,OpenCV 2.4.7,OpenCV 2.4.8这三个版本的配置,有时候还要涉及到三个版本之间的转换,所以还是对OpenCV的配置有一定的理解的,希望自己的一

(转)OpenCV学习:OpenCV2.4.8+VS2010开发环境配置

初学OpenCV,关于OpenCV的环境配置,在网上搜索了很多方法,最后自己终于搞定了,纪念一下... 配置的过程深受一篇博文的影响,该博文讲述的十分清楚,特此转载过来,和大家分享!!!!! 本系列文章由zhmxy555(毛星云)编写,转载请注明出处. 文章链接:http://blog.csdn.net/poem_qianmo/article/details/19809337 作者:毛星云(浅墨)    邮箱: [email protected] 写作当前博文时配套使用OpenCV版本:2.4.

Android开发环境配置(以windows为例)

Android开发环境配置工具  如果你准备从事Android开发,那么无论选择在eclipse下开发,还是选择在AndroidStudio下开发,都可以参照以下步骤进行Android开发环境的配置. Android开发环境配置过程 1.准备笔记本或台式机 使用笔记本还是台式机,视个人需求而定,但我要强调的是在配置上不要手软,要舍得下手.一台流畅的电脑,会让你在枯燥的编程中不至于抓狂. 官方推荐的AndroidStudio或eclipse运行环境对电脑配置要求很低,现在市面上的电脑基本都可以达到

Mac系统cocos2dx + android 开发环境配置

Mac系统cocos2dx + android 开发环境配置 /****************************************************** 这遍文章主要转载自:http://www.cnblogs.com/wt616/p/3758828.html(这位大哥真的很牛,谢谢!) 然后,文章中又加入了一些自己的理解以及在实际操作过程中遇到问题的解决办法.而这些办法也是来自于伟大 的网友,但由于搜索的比较多,很多出处地址都没有记录好,抱歉,若你们看到,告诉我,我再加上地

VC/DDK/DriverWorks开发环境配置

1·前言开发windows内核驱动程序是一个非常具有挑战性的工作,你得忍耐调试过程中操作系统 不断蓝屏.不断崩溃的噩梦,所以强烈建议你采用虚拟机做开发平台,这样即使把整个系统都搞蹦了,大不了从新装过虚拟机而已.那么搭建一个完整的 Windows驱动开发环境是每个人必须迈过的第一道坎.本文将具体介绍如何安装和配置好一个完整的DDK开发换件:Windows XP + 英文原版Visual studio 6.0 + WinXP_DDK + DriverStudio 3.2 2·准备工作先要把eset(

【转】cocos2d-x windows开发环境配置

声明:本教程在参考了以下博文,并经过自己的摸索后实际操作得出,本教程系本人原创,由于升级后的cocos2d-x有了一些变化,目前的博文还没有关于Cocos2d-x 2.2.1最新版搭建Android交叉编译环境组建的说明,所以我这几天研究了一下,现在将具体的搭建方法分享出来,也给自己学习Cocos2d-x做个笔记. 参考博文: http://www.cnblogs.com/lhming/archive/2012/06/27/2566460.htmlhttp://www.cnblogs.com/l