Compile QT 4.8.0 with MinGW

OS: Windows 7 (x64, EN)

I use zip packages because I wanna know what has been done clearly.

 

MinGW

As recommended by the official site of MinGW, I use mingw-get-0.4-mingw32-alpha-1-bin.tar.xz for my installation.

1. Extract all files to D:ToolsMinGW.

2. "Control Pannel" ==> "System" ==> "Advanced System Settings" ==> "Environment Variables", Add "D:ToolsMinGWbin" to "PATH".

3. cmd.

copy D:ToolsMinGWvarlibmingw-getdatadefaults.xml D:ToolsMinGWvarlibmingw-getdataprofile.xml
mingw-get update
mingw-get install binutils gcc g++ gdb gmp libiconv mingw32-make mpfr pthreads-w32

Which will install the following packages to D:ToolsMinGW.

binutils-2.22-1-mingw32-bin.tar.lzma
binutils-2.22-1-mingw32-doc.tar.lzma
binutils-2.22-1-mingw32-lang.tar.lzma
gcc-4.6.2-1-mingw32-doc.tar.lzma
gcc-4.6.2-1-mingw32-lang.tar.lzma
gcc-4.6.2-1-mingw32-lic.tar.lzma
gcc-c++-4.6.2-1-mingw32-bin.tar.lzma
gcc-core-4.6.2-1-mingw32-bin.tar.lzma
gdb-7.3.1-1-mingw32-bin.tar.lzma
gdb-7.3.1-1-mingw32-doc.tar.lzma
gmp-5.0.1-1-mingw32-dev.tar.lzma
gmp-5.0.1-1-mingw32-doc.tar.lzma
gmp-5.0.1-1-mingw32-lic.tar.lzma
libexpat-2.0.1-1-mingw32-dll-1.tar.gz
libgcc-4.6.2-1-mingw32-dll-1.tar.lzma
libgmp-5.0.1-1-mingw32-dll-10.tar.lzma
libgmpxx-5.0.1-1-mingw32-dll-4.tar.lzma
libgomp-4.6.2-1-mingw32-dll-1.tar.lzma
libiconv-1.14-2-mingw32-bin.tar.lzma
libiconv-1.14-2-mingw32-dev.tar.lzma
libiconv-1.14-2-mingw32-dll-2.tar.lzma
libiconv-1.14-2-mingw32-doc.tar.lzma
libiconv-1.14-2-mingw32-lic.tar.lzma
libintl-0.18.1.1-2-mingw32-dll-8.tar.lzma
libmpc-0.8.1-1-mingw32-dll-2.tar.lzma
libmpfr-2.4.1-1-mingw32-dll-1.tar.lzma
libpthreadgc-2.9.0-mingw32-pre-20110507-2-dll-2.tar.lzma
libquadmath-4.6.2-1-mingw32-dll-0.tar.lzma
libssp-4.6.2-1-mingw32-dll-0.tar.lzma
libstdc++-4.6.2-1-mingw32-dll-6.tar.lzma
make-3.82-5-mingw32-bin.tar.lzma
make-3.82-5-mingw32-doc.tar.lzma
make-3.82-5-mingw32-lang.tar.lzma
mingwrt-3.20-mingw32-dev.tar.gz
mingwrt-3.20-mingw32-dll.tar.gz
mpfr-2.4.1-1-mingw32-dev.tar.lzma
mpfr-2.4.1-1-mingw32-doc.tar.lzma
mpfr-2.4.1-1-mingw32-lic.tar.lzma
pthreads-w32-2.9.0-mingw32-pre-20110507-2-dev.tar.lzma
pthreads-w32-2.9.0-mingw32-pre-20110507-2-doc.tar.lzma
pthreads-w32-2.9.0-mingw32-pre-20110507-2-lic.tar.lzma
w32api-3.17-2-mingw32-dev.tar.lzma

 

Perl

Also recommended by the official site, download: http://strawberryperl.com/download/5.12.3.0/strawberry-perl-5.12.3.0-64bit.zip

Extract to D:ToolsPerl.

Same as MinGW, expand "PATH Environment Variables" with "D:ToolsPerlperlbin;D:ToolsPerlperlsitebin".

 

QT

1. Download qt-everywhere-opensource-src-4.8.0.tar.gz and extract to "D:QTqt-4.8.0-gcc-4.6". NOTE: Don't use "g++" in the name, it will cause copy error.

2. Configure:

According to http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/, I wanna to reduce size of binary files.

Edit D:QTqt-4.8.0-gcc-4.6mkspecswin32-g++qmake.conf, with

QMAKE_CFLAGS_RELEASE = -Os -momit-leaf-frame-pointer

Open cmd, and configure:

cd D:QTqt-4.8.0-gcc-4.6
configure -release -opensource -developer-build -shared -ltcg -no-fast -exceptions -accessibility -stl -opengl desktop -no-openvg -platform win32-g++-4.6 -graphicssystem raster -qt-zlib -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -incredibuild-xge -plugin-manifests -qmake -process -rtti -mmx -3dnow -sse -sse2 -no-openssl -no-dbus -no-phonon -phonon-backend -multimedia -audio-backend -webkit -script -scripttools -declarative -declarative-debug -no-directwrite -arch windows -qt-style-windows -qt-style-windowsxp -qt-style-windowsvista -qt-style-plastique -qt-style-cleanlooks -qt-style-motif -qt-style-cde -qt-style-windowsce -qt-style-windowsmobile -qt-style-s60 -native-gestures -no-s60 -saveconfig 2012_01_02

NOTICE:

I disable database, ssl, directwrite, DirectX, etc. because they require header files or binary libraries out side of qt package. Also, there's a bug for OpenGL, so I disable OpenGL options. (https://bugreports.qt.nokia.com/browse/QTBUG-17997). In fact, OpenGL in the official QT SDK doesn't work on my box at all. 😦

And I use "-saveconfig 2012_01_02" to save my configuration.

This step requires perl installation which has been done before (syncqt).

3. Make:

Run and wait:

mingw32-make

Wish it works for you.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s