Qtwebkit development environment Configuration and compiling method-windows32bit

Source: Internet
Author: User
Tags svn client windows x64

Dependencies
  • First of all, need a version of Qt for Windows. If You is an open source developer so you can download the Open source Edition of Qt for Windows from the Nokia Website : Http://qt.nokia.com/downloads; Version for Windows32 bit is QT 5.0.1 for Windows 32-bit (VS., 481 MB)
  • Note that you need to enable ICU support for the Qt build (also see Http://doc-snapshot.qt-project.org/5.0/requirements-win . html)
    • Make sure, QT is configured with -openssl if you want HTTPS support in Qtwebkit. You'll need the Non-light version OfWin32 OpenSSL libraries.
  • Install ActiveState Perl
  • Install Python 2.x (and add the installation location to your PATH)
  • The following external GNU tools is needed from the GnuWin32 Project:
    • Bison
    • GPerf
    • Grep
    • Flex
    • LibIconv (needed for bison)
    • Make (not necessary if-want to build using MSVC)
  • Install Ruby

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

Make sure the GnuWin32 packages is in your PATH as well as Perl and Python. You also need to has%qtdir% set and has%qtdir%\bin in your PATH.
If you have Cygwin's Bin directory in your path, make sure the It comes after ActiveState Perl and GnuWin32. You might had to remove it completely from your PATH if you had problems with slashes and backslashes while building USI Ng MinGW. Mingw32-make and GnuWin32 s make would 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 this matches the version of Qt you downloaded and make Sure qmake is accessible in PATH.
        Note that building inside Cygwin or MSYS are 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 does not work for you might has to ctrl-c build-webkit' s execution and go in the webkitbuild\release\ directory a nd run:
      Mingw32-make-c javascriptcore-f makefile.release-j%number_of_processors% && mingw32-make-c webcore-f Makefil e.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 Comman D:set path=c:\gnuwin32\bin; c:\perl\bin;%path% provided that the GNUWIN32 packages is installed in C:\GnuWin32\bin and Perl inC:\Pe Rl\bin.
  • If you get a build errors in javascriptcore\bindings\np_jsobject.cpp or similar then "make sure that the Microsoft Pla Tform SDK is not in your%include% path because it conflicts with your MingW headers.
  • If you get the build errors after Makefile generation ("makefile:178: * Multiple target patterns. Stop. ") Then your ' 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 yet has been applied to Qt git, apply Manua lly 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'll be testing The build:)
    • the options:
      • Drangon: http://mingw-w64-dgn.googlecode.com/files down Load the mingw-w64-bin-x86_64-<date> package Download the make-w64-bin-x86_64-<date> package Extract them Both to C:\mingw64 so Mingw32-make.exe and G++.exe is present in the C:\mingw64\bin folder
      • Sezero:&nbs P;http://sourceforge.net/projects/mingw-w64/files/toolchains%20targetting%20win64/personal%20buildsdownload any of the mingw-w64-x86_64-mingw_<date> packages. The exp/new/old suffixes is not important this Extract the package to C:\mingw64 so, G++.exe is present in C:\mingw64 \ Rename included Gmake.exe to Mingw32-make.exe
  4. Set Up your environment:
    • Qt sources C:\Qt So, Configure.exe is present in the 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:\qtcd C:\Qtconfigure-qt-style-windowsxp-qt-style-windowsvista-phononmingw32-make
  5. Everything should has 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 are exactly the same, only then he mingw64 folder name should be mingw32.

A ' Works for Me ' Step-by-Step Guide to Building Qtwebkit on Windows using MinGW
  1. 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 does need to use Qt command Prompt for this rather than the normal Windows Command Prompt.
  4. Make sure the GnuWin32 packages is in your PATH as well as Perl (set Path=c:\program files\gnuwin32\bin; c:\perl\site\bin;%path%.
  5. You also need to has%qtdir% set and has%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 of this 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 would vary depending on the Qt SDK so you downloaded. You should modify it appropriately.
  7. Download WebKit from SVN (make sure "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 is unable to create the webkitbuild\release folders from itself on my PC. I had to do mkdir webkitbuild and mkdir webkitbuild\release before building.
  10. 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 is rather slow for repositories with a huge amount of the files on Windows. One-to-deal with-is-use-a sparse-checkout, to "ignore" certain files. The layouttests directory is certainly a good candidate, if you currently does not need these files. A sparse-checkout uses a config file (. git/info/sparse-checkout) to determine if a file should is checked out or Not. Files mentioned in the config file would be a part of the checkout. Files not mentioned in the config file would be ignored. There is also a syntax to invert this logic, but it's currently not working well with directories.

  1. Create a . git/info/sparse-checkout file that would 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
    Reference Compilation Method:
    1.QT official website Download latest Version: Http://qt-project.org/downloads
    2. Unzip the downloaded compressed package (for example, Path: F:/qtwebkit) and configure the relevant environment variables:
    -----Create two variable names, Qtdir (value f:/qtwebkit/qt-windows-open ...), Qmakespec (value is win32-msvc20xx; here xx, according to the version of VS, I use 2010 , so for win32-msvc2010)
    3. Compiling the source code
    -----Open vs Software, go to Visual Studio tools, Run command line, lock to QT source directory, run command: Configure.exe-webkit
    -----The GPL will be prompted during compilation, yes, the first step will generate Qmake
    -----then run the NMAKE command and compile it successfully
    4. Compile the application, same as above, execute the qmake and NMAKE commands once, and generate the executable file in the Debug directory
    The 5.QT installation environment contains WebKit source code and comes with a simple browser project
    6. Set the browser project as the startup project and compile it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.