Archive

Archive for September, 2009

Windows developement environment, final part

September 13th, 2009 Comments off

In part 1, we installed the build tools. In part 2, we built Qt and the PostgreSQL libraries from source. In this part, let’s see how to use these to finally build the Manitou-Mail user interface.

The starting point is the set of sources as fetched from the SF.net subversion repository. The latest version can be checked out with for example, Tortoise SVN, as shown in this screenshot:

Source checkout with Tortoise

Source checkout with Tortoise

The difference between a source tarball and sources from the repository is mostly that the configure script and Makefile.in inside each directory are present in the tarball but not in the repository: these files are to be generated by autoconf and automake.

Here are the steps from the checkout of the source to getting the executable file:

  1. Make sure that Qt binaries are in the path:
    export PATH=/c/Qt/4.5.2/bin:$PATH

  2. Generate configure script and Makefile.in files:

    aclocal
    autoheader
    autoconf
    automake -a -c

  3. Configure:

    ./configure --with-pgsql-includes=/usr/local/pgsql/include --with-pgsql-libs=/usr/local/pgsql/lib

  4. Compile:

    make

The compilation produces the final executable, manitou.exe, in the src/ directory. While it’s possible to run ‘make install’ at this point as we would do in an Unix environment, personally I don’t use it. This is because I just want to package the executable along with libraries inside an installer that is targeted at Windows systems that generally don’t have MSYS with its Unix-like filiesystem layout.

To package the Manitou-Mail interface for Windows along with the required Qt, PostgreSQL and MingW libraries into a self-contained installer program, I currently use NSIS. The current NSIS script is available on the wiki.

Categories: Development Tags:

Windows developement environment, part 2

September 6th, 2009 Comments off

In part 1, we installed the tools that are required to build from source.
This post shows how to use them to compile Qt and the PostgreSQL libraries we need.

Qt-4.5.2

Qt is huge and building it from scratch takes a long time, typically several hours on a current desktop machine. Using pre-compiled binaries as available on the Qt site can be preferred, although it is only since quite recently (4.5.2?) that the pre-compiled version can be used to build manitou-mail (As I mentioned in this message to qt-interest, there was a problem with the pre-compiled qmake that precluded its use with autotools scripts launched in MSYS. But this appears to have been fixed).
If however a custom compilation is chosen, here are the steps to follow:

  1. Download Qt sources into c:\qt\4.5.2 or similar
  2. Open CMD.EXE and make sure g++ is in the PATH. Add it manually if necessary.
  3. Inside, c:\qt\4.5.2, run configure.exe -platform win32-g++.
  4. Run mingw32-make as told at the end of configure, and don’t expect the result before several hours :)

Beware: contrary to the Unix way of installing from source, no make install is necessary nor possible with Qt/Windows : the build must happen directly inside the destination directory.

PostgreSQL’s libpq

  1. Grab postgresql source tar archive and untar it. I’ve used version 8.4.0, the latest available at the time of this post.
  2. If /mingw/include/libz.h doesn’t exist, grab and unpack the zlib dev archive in /mingw.
  3. cd into postgresql source directory and run ./configure
  4. cd into src/interfaces/libpq
  5. run make && make install

Once this is done, the headers files to be found in /usr/local/pgsql/include and the libraries (.a and .dll) in /usr/local/pgsql/lib

Conclusion of part 2

Now that Qt and PostgreSQL are built, in the next and final part of this series we’ll compile the manitou-mail application itself for windows, with the toolchain that we installed in part 1.

Categories: Development Tags: