- compile both debug and release builds,
- have the release build optimized with link time code generation (LTCG),
- include OpenSSL support,
- include PostgreSQL support.
My setup is a VMware Fusion VM with 32 bit Windows XP.
First of all, LTCG requires plenty of memory, and linking/code generation for WebKit will fail on 32 bit windows unless you do the following:
- set the VM to have at least 2G of memory,
- boot with the /3g option in boot.ini -- to do that go to System Properties, Advanced, Startup and Recovery.Settings, Edit the startup options file, and duplicate the existing entry in [operating systems] section, adding /3gb switch before /fastdetect, and change the name of the new entry.
- save boot.ini, reboot the VM, bootloader will ask you to select the OS, choose the entry you just created.
Since we don't want to retype all the configuration settings each time you run configure, create a file configure_config.cache in your %QTDIR% (say C:\Qt\4.7.3). The file should have contents as follows:
Then you have to download the PostgreSQL source code. Decompress it into the folder that matches the entry from your config cache above. To compile libpq, follow directions in psql documentation chapter 16.2, namely go to C:\-opensource-debug-and-release-ltcg-plugin-sql-psql-openssl-no-qt3support-qt-libpng-qt-libjpeg-fast-D_BIND_TO_CURRENT_CRT_VERSION=1-IC:\OpenSSL-Win32\include-IC:\Postgresql-9.0.4\src\interfaces\libpq-IC:\postgresql-9.0.4\src\include-LC:\OpenSSL-Win32\lib-LC:\Postgresql-9.0.4\src\interfaces\libpq\Release
The next step is to download and decompress the OpenSSL-WIN32 binaries provided by Shining Light Productions. Again, decompress it into a folder that must match the entry in the config cache. I wasn't brave enough to attempt recompilation from the source.
The last step is to fire up the Qt build proper. Make sure that nothing else is running in your VM besides the Explorer shell. Turn off virus protection. Then start up Qt Command Prompt -- it is available from the start menu folder created by the Qt installer. Then issue following commands:
configure -loadconfig config
nmakeThis is all it takes to build Qt. Note that if the argument to -loadconfig is foo, then your config cache file in %QTDIR% must be named configure_foo.cache .