| 41 | |
| 42 | == A 'Works For Me' Step-by-Step Guide to Building QtWebKit on Windows == |
| 43 | |
| 44 | 1. The following external GNU tools are needed from the GnuWin32 Project: |
| 45 | * [http://gnuwin32.sourceforge.net/downlinks/bison.php Download Bison] |
| 46 | * [http://gnuwin32.sourceforge.net/downlinks/gperf.php Download GPerf] |
| 47 | * [http://gnuwin32.sourceforge.net/downlinks/flex.php Download Flex] |
| 48 | * [http://gnuwin32.sourceforge.net/downlinks/libiconv.php LibIconv] |
| 49 | * [http://gnuwin32.sourceforge.net/downlinks/make.php Make] |
| 50 | * It is safest to install the gnuwin32 tools to `C:\GnuWin32` rather than `C:\Program Files\GnuWin32`. This is because, depending on your luck with the webkit build, the space in `Program Files` can prevent the windows shell from locating the binaries correctly. The error message below is what you will see if you get this problem. |
| 51 | {{{ |
| 52 | make[2]: Entering directory `C:/Users/robert/Development/webkit/WebKitBuild/Release/WebCore' |
| 53 | bison -d -p jscyy ..\..\..\JavaScriptCore\parser\Grammar.y -o Grammar.tab.c && move Grammar.tab.c tmp\Grammar.cpp && move Grammar.tab.h tmp/Grammar.h |
| 54 | m4: cannot open `Files\GnuWin32/share/bison': No such file or directory |
| 55 | m4: cannot open `C:\Program': No such file or directory |
| 56 | m4: cannot open `Files\GnuWin32/share/bison/m4sugar/m4sugar.m4': No such file or directory |
| 57 | bison: I/O error |
| 58 | }}} |
| 59 | 2. [http://www.qtsoftware.com/downloads/sdk-windows-cpp Download QT SDK (and QT Creator)] |
| 60 | 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. |
| 61 | 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%`. |
| 62 | 5. You also need to have %QTDIR% set and have %QTDIR%\bin in your PATH. |
| 63 | 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: |
| 64 | {{{ |
| 65 | set Path=C:\Program Files\GnuWin32\bin;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;C\\Program Files\SlikSvn\bin\ |
| 66 | }}} |
| 67 | * Note that `c:\Qt\2009.01\qt` above will vary depending on the QT SDK that you downloaded. You should modify it appropriately. |
| 68 | 7. Change into the WebKit source tree: `cd c:\location\of\webkit` |
| 69 | 8. 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. |
| 70 | 9. You may need to do a `mkdir c:\tmp`. The WebKit build relies on the existence of `c:\tmp` when building in Windows. |
| 71 | 10. Build the patched webkit (release mode): |
| 72 | `$perl WebKitTools\Scripts\build-webkit --qt --release` |
| 73 | 11. The webkit build takes forever, so if you have more than one CPU on your machine you should use `--makeargs=j4` (for 4 CPUs). This will speed up the build no end. Other recommendations are `--no-svg`. There is even a `--minimal` flag available in recent webkit versions: |
| 74 | {{{ |
| 75 | $perl WebKitTools\Scripts\build-webkit --qt --release --makeargs=j4 |
| 76 | $perl WebKitTools\Scripts\build-webkit --qt --release --no-svg |
| 77 | $perl WebKitTools\Scripts\build-webkit --qt --release --minimal |
| 78 | }}} |