Qt SDK LPGL for Windows

The SDK for Windows includes MinGW, that is gcc version 4.4.0 (currently), and make 3.81 (named mingw32-make), and many more goodies, like lupdate and lrelease, part of Linguist that can be used to make translations of the GUI available.

MinGW as you know is the port of the compiler suite and binutils and gdb to Windows.  But to build something like Transmission we need much more, all its dependencies, and the dependencies dependencies.

Some of what is needed has already been ported, in fact most things are, you just need a Unix-like development environment to build them.  That’s where MSYS comes in, it adds the needed shell (bash) and a few utilities that we need.

Some packages are even available as binaries that you don’t have to build, just install.  MinGW seems to have a new package installer, I haven’t used it… remember that the idea is to keep things compatible with Qt, so don’t mix things, I prefer to use the gcc that came with Qt than the latest gcc from MinGW.

Basics

Everything we’re going to do is in a terminal, I use rxvt, and it runs bash as shell.  No Qt command prompt.

Start -> All Programs -> MinGW -> MSYS -> MSYS (rxvt)

MSYS is configured to find the tools installed by the Qt SDK.  That means a few changes.

File /etc/fstab (the path depends on where you installed Qt):

C:/Qt/2010.05/mingw /mingw
C:/Qt/2010.05/qt /qt

File /etc/profile additions:

PKG_CONFIG_PATH="/mingw/lib/pkgconfig"
CVS_RSH=ssh
CFLAGS="-pipe -O3 -mms-bitfields -march=i686"
QMAKESPEC=win32-g++
QTDIR=/qt
PATH=$QTDIR/bin:$PATH
export HOME LOGNAME MSYSTEM HISTFILE CFLAGS PKG_CONFIG_PATH CVS_RSH
export QMAKESPEC QTDIR PATH

Then we are in business, we can start building packages with the usual:

./configure --prefix=/mingw
make
make check
make install

List of packages

autoconf
automake
libtool
openssl
zlib
curl
libidn
libiconv
libevent
pkg-config
gettext
glib
fontconfig
freetype
expat

And then… there is DBUS.  I wouldn’t build it the first time, Transmission-Qt doesn’t need it to run, just for file and magnet association.  Qt needs to be rebuilt to add DBUS support, and that takes a lot of time.

On to Transmission

The usual build sequence, no install necessary, followed by:

cd qt
qmake qtr.pro
make release

And if you want the GUI translation files:

lupdate -no-obsolete -locations relative qtr.pro
lrelease -compress qtr.pro

The resulting executable is in the release directory, and the translations are in the translations directory (the .qm files).