zoukankan      html  css  js  c++  java
  • [Webkit]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%in 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 ToolsScriptsuild-webkit --qt --release
    • Wait :)
    • Try to run WebKitBuildReleaseinQtTestBrowser.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 WebKitBuildRelease 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:GnuWin32in;C:Perlin;%PATH% Provided that the GnuWin32 packages are installed in C:GnuWin32in and Perl inC:Perlin.
    • If you get build errors in JavaScriptCoreindingsNP_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:
    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:mingw64in;C:Qtin;%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 filesgnuwin32in;C:Perlsitein;%PATH%.
    5. You also need to have %QTDIR% set and have %QTDIR%in 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:GnuWin32in;c:Qt2009.01qtin;c:Qt2009.01in;C:Perlin;C:Windowssystem32;c:Qt2009.01mingwin;C:Perlsitein;C:Windows
      • Note that c:Qt2009.01qt 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:locationofwebkit
    9. For some reason, the build command was unable to create the WebKitBuildRelease folders by itself on my PC. I had to do mkdir WebKitBuild and mkdir WebKitBuildRelease before building.
    10. You may need to do a mkdir c: mp. The WebKit build relies on the existence of c: mp when building in Windows.
    11. Build the patched webkit (release mode): $perl ToolsScriptsuild-webkit --qt --release
    12. The webkit build takes forever, you can shorten it using the build-webkit's --no-svg or --minimal flags:
          $perl ToolsScriptsuild-webkit --qt --release --no-svg
          $perl ToolsScriptsuild-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工程设为启动项目,然后编译即可。
       
  • 相关阅读:
    如何提高游戏中的打击感?
    javascript !!作用
    cocos2d-x图片变灰或者变亮
    cocos2d-x生成随机数
    javaScript 类型判断
    Cocos2dx游戏源码合集(BY懒骨头+持续更新+2014.02.21)
    (译)如何优化cocos2d程序的内存使用和程序大小:第二部分(完)
    (译)如何优化cocos2d程序的内存使用和程序大小:第一部分
    游戏中的心理学(一):认知失调有前提条件
    java定时任务
  • 原文地址:https://www.cnblogs.com/webapplee/p/3771937.html
Copyright © 2011-2022 走看看