On 01.01.2009 23:06 CE(S)T, Yves Goergen wrote:
> I'm trying the whole evening to build Merkaartor from source. I have
> downloaded and installed Qt 4.4.3 open source edition (including MinGW)
> and MSYS. I have downloaded and unpacked Merkaartor source 0.12.

> Does anybody know how this is supposed to work? Has anybody got a how-to
> of compiling Merkaartor on Windows?

Finally, I'm done. It's a rather complicated task and tricky to find
out. For those who are interested or know better, please see my attached
how-to. It lists all requirements, where you get them and what to do
with all that.

-- 
Yves Goergen "LonelyPixel" <nospam.l...@unclassified.de>
Visit my web laboratory at http://beta.unclassified.de
How to build Merkaartor from Source, with Qt 4.4, MinGW and Windows
===================================================================

The entire procedure will take about 1 to 2 hours, depending on your CPU speed, 
internet link and
wizardry skills.

Download:
    Qt for Open Source C++ development on Windows - with the MinGW compiler 
included (installer)
        http://trolltech.com/downloads/opensource/appdev/windows-cpp
        Tested with version 4.4.3
    MSYS Base System (installer)
        
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963
        Tested with version 1.0.10
    zlib (source)
        http://www.zlib.net/
        Tested with version 1.2.3
    libexpat (source)
        
http://sourceforge.net/project/showfiles.php?group_id=10127&package_id=10780
        Tested with version 2.0.1
    exiv2 library (source)
        http://www.exiv2.org/download.html
        Tested with version 0.18
    libxslt (binary DLL)
        http://www.zlatkovic.com/pub/libxml/
        File: libxslt-1.1.24.win32.zip
        File: libxml2-2.7.2.win32.zip
    Merkaartor (source)
        http://www.merkaartor.org/Download/
        Tested with version 0.12 and svn-20090102
    optionally: SVN command-line client (to download latest Merkaartor source)
        (source unknown, requires svn.exe and a bunch of DLLs)

Install:
    Qt
        Target directory for MinGW: C:\MinGW
    MSYS
        Target directory: C:\MSYS (I suggest you leave out the version number)
        Post installation configuration:
            MinGW directory: c:/mingw
            TODO: what else?

In this how-to, the development root directory is Z:\dev. Its MSYS equivalent 
is /z/dev. Whereever
you see them here, change them to your local paths.

Unpack downloaded archives:
    zlib -> z:\dev\zlib
    libexpat -> z:\dev\expat
    exiv2 -> z:\dev\exiv2
    libxml2 -> z:\dev\libxml2
    libxslt -> z:\dev\libxslt
    Merkaartor -> z:\dev\merkaartor
    SVN binaries -> z:\dev\svn (no subdirectory, put svn.exe right in here)

All lines beginning with a dollar sign ($) are meant to be typed into the MSYS 
shell (without the
$ sign).

Build zlib:
    $ cd /z/dev
    $ cd zlib
    $ ./configure
    $ make
    $ mkdir include lib
    $ cp z{lib,conf}.h include
    $ cp libz.a lib
    $ cd ..

Build libexpat:
    $ cd expat
    $ ./configure
    $ make
    $ mkdir include
    $ cp lib/expat{,_external}.h include
    $ cp .libs/libexpat.a lib/libexpat.a
    $ cd ..

Build exiv2:
    $ cd exiv2
    $ ./configure --with-zlib=/z/dev/zlib --with-expat=/z/dev/expat 
--disable-shared
    (This takes ~4 minutes)
    $ make
    (This takes ~25 minutes)
    $ mkdir include lib
    $ cp src/{exiv2,utils,types,version}.hpp include
    $ cp src/exv_conf.h include
    $ cp src/.libs/libexiv2.a lib
    $ cd ..

Copy exiv2 source into Merkaartor directory
    $ rm -r merkaartor/exiv2
    $ mkdir merkaartor/exiv2
    $ cp exiv2/src/*.{c,cpp,h,hpp} merkaartor/exiv2

All lines beginning with a greater-than sign (>) are meant to be typed at the 
Qt command prompt
(without the > sign).

Optionally download the latest SVN source of Merkaartor: (This will download 
all source files into
the merkaartor subdirectory. You better rename it if you already have one.)
    > cd /d z:\dev
    > svn\svn co http://svn.openstreetmap.org/applications/editors/merkaartor/

Be sure you have copied the exiv2 source files into the merkaartor directory 
(see above).

Build Merkaartor:
    > cd /d z:\dev
    > cd merkaartor
    To build a release version, use the following command:
    > qmake NODEBUG=1
    To build a debug version, use the following command instead: (You should 
think twice about
    building a debug version. You really cannot imagine how slow it will be!)
    > qmake
    Now edit files Makefile.Debug respectively Makefile.Release:
        Append to line DEFINES=...: -D__INTERLOCKED_DECLARED
        Append to line LIBS=...: -LZ:/dev/exiv2/lib -LZ:/dev/expat/lib -lexpat
    > make
    (This takes ~18 minutes)

Copy dependency files:
    If you need a translation, use the following command with your favourite 
language:
    > lrelease merkaartor_de.ts
    Now copy all translations, DLLs and the binary into a new directory:
    > mkdir output
    > copy binaries\...\bin\merkaartor.exe output
    (You'll need to find the correct path for "...".)
    > copy *.qm output
    > copy ..\libxslt\bin\libexslt.dll output
    > copy ..\libxslt\bin\libxslt.dll output
    > copy ..\libxml2\bin\libxml2.dll output
    > copy %QTDIR%\bin\mingwm10.dll output
    > mkdir output\imageformats
    > copy %QTDIR%\plugins\imageformats\qico4.dll output\imageformats
    > copy %QTDIR%\plugins\imageformats\qtiff4.dll output\imageformats\qtif4.dll
    > copy %QTDIR%\plugins\imageformats\qsvg4.dll output\imageformats
    > copy %QTDIR%\plugins\imageformats\qgif4.dll output\imageformats
    > copy %QTDIR%\plugins\imageformats\qjpeg4.dll output\imageformats
    If you've found your executable in a directory like "release", use these 
files:
    > copy %QTDIR%\bin\QtWebKit4.dll output
    > copy %QTDIR%\bin\QtSvg4.dll output
    > copy %QTDIR%\bin\QtGui4.dll output
    > copy %QTDIR%\bin\QtNetwork4.dll output
    > copy %QTDIR%\bin\QtXml4.dll output
    > copy %QTDIR%\bin\QtCore4.dll output
    If you've found your executable in a directory like "debug", use these 
files:
    > copy %QTDIR%\bin\QtWebKitd4.dll output
    > copy %QTDIR%\bin\QtSvgd4.dll output
    > copy %QTDIR%\bin\QtGuid4.dll output
    > copy %QTDIR%\bin\QtNetworkd4.dll output
    > copy %QTDIR%\bin\QtXmld4.dll output
    > copy %QTDIR%\bin\QtCored4.dll output

You can now execute Merkaartor.exe in the directory output.

_______________________________________________
Merkaartor mailing list
Merkaartor@openstreetmap.org
http://lists.openstreetmap.org/listinfo/merkaartor

Reply via email to