Differences between revisions 8 and 9
Revision 8 as of 2008-07-18 19:13:40
Size: 5237
Editor: quadir
Comment: bob rosi hint on apr-util
Revision 9 as of 2009-09-20 23:45:58
Size: 5243
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[#mingw Command line build using MinGW and autotools] [[BR]]
[#ant Command line build using ant] [[BR]]
[#msdev MS Developer Studio build] [[BR]]
[[#mingw|Command line build using MinGW and autotools]] <<BR>>
[[#ant|Command line build using ant]] <<BR>>
[[#msdev|MS Developer Studio build]] <<BR>>
Line 5: Line 5:
[[Anchor(mingw)]] <<Anchor(mingw)>>
Line 101: Line 101:
Build cppunit as a static library.[[BR]] Build cppunit as a static library.<<BR>>
Line 116: Line 116:
Build libiconv library.[[BR]] Build libiconv library.<<BR>>
Line 124: Line 124:
Build APR library.[[BR]] Build APR library.<<BR>>
Line 133: Line 133:
Build APR-util library:[[BR]] Build APR-util library:<<BR>>
Line 142: Line 142:
Build Log4cxx library.[[BR]] Build Log4cxx library.<<BR>>
Line 155: Line 155:
[[Anchor(ant)]] <<Anchor(ant)>>
Line 159: Line 159:
[[Anchor(msdev)]] <<Anchor(msdev)>>

Command line build using MinGW and autotools
Command line build using ant
MS Developer Studio build

Command line build using MinGW and autotools


You need to install the compiler and a minimal system environment:

  • MinGW
  • MSYS
  • msysDTK
  • Python
  • libtool (optionnal)

and all sources needed to build Log4cxx:

  • cppunit (optionnal)
  • expat
  • libiconv
  • apr
  • apr-util
  • log4cxx

MingGW installation

Download latest MinGW installer: http://prdownloads.sf.net/mingw/MinGW-5.1.3.exe

Download and install MinGW with the installer.

Install MinGW candidate package.

Select the type of install:

  • MinGW base tools
  • g++ compiler
  • MinGW Make

After installation finished, you have MinGW installed with:

  • binutils-2.17.50-20060824-1.tar.gz
  • gcc-core-3.4.5-20060117-1.tar.gz
  • gcc-g++-3.4.5-20060117-1.tar.gz
  • mingw32-make-3.81-2.tar.gz
  • mingw-runtime-3.12.tar.gz
  • w32api-3.9.tar.gz

MSYS and msysDTK installation

Download latest MSYS installer: http://prdownloads.sf.net/mingw/MSYS-1.0.11-2004.04.30-1.exe

Download latest msysDTK installer: http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe

MSYS installer asks for MinGW path (default is C:\MinGW), set the path properly to bindmount the directory to /mingw: c:/MinGW

Python installation

Download latest python installer, you need python later for APR buildconf script: http://www.python.org/ftp/python/2.5/python-2.5.msi

Sources installation

Optionally, you can update libtool using mingwPORT and this nice tutorial: http://www.mingw.org/MinGWiki/index.php/mingwPORT

Edit user environment variable PATH and append (this is a convenient way for command line access): C:\MinGW\bin;C:\Python25

Download all needed sources and put them into C:\msys\1.0\src\ (create it if needed):

For APR, APR-util and Log4cxx, you need to download a subversion client. I suggest to use TortoiseSVN http://tortoisesvn.net

Create 3 directories:

  • C:\msys\1.0\src\apr
  • C:\msys\1.0\src\apr-util
  • C:\msys\1.0\src\log4cxx

Download sources inside created directories using your subversion client and these URLs:

The final step: build everything

Now, log in msys and bring all needed stuff in your home:

$ tar zxf /usr/src/cppunit-1.12.0.tar.gz
$ tar zxf /usr/src/expat-2.0.0.tar.gz
$ tar zxf /usr/src/libiconv-1.11.tar.gz
$ cp -rf /usr/src/apr .
$ cp -rf /usr/src/apr-util .
$ cp -rf /usr/src/log4cxx .

Build cppunit as a static library.
It failed to build as a shared library. I used mingPORT style flags except -O3 optimization (can produce weird effect), replaced by -O2:

$ cd cppunit-1.12.0
$ ./configure CFLAGS="-O2 -s -mms-bitfields -march=i686" CXXFLAGS="-O2 -s -mms-bitfields -march=i686" --disable-shared
$ make && make install
$ cd

Build expat library:

$ cd expat-2.0.0
$ ./configure CFLAGS="-O2 -s -mms-bitfields -march=i686" CXXFLAGS="-O2 -s -mms-bitfields -march=i686"
$ make && make install
$ cd

Build libiconv library.
I wasn't able to build APR-iconv with MinGW so libiconv is the natural alternative:

$ cd libiconv-1.11
$ ./configure CFLAGS="-O2 -s -mms-bitfields -march=i686" CXXFLAGS="-O2 -s -mms-bitfields -march=i686"
$ make && make install
$ cd

Build APR library.
It seems there's a mis-optimization at level greater than -O0 producing link time errors (undefined reference to libmsvcrt_a_iname and _nm_pctype):

$ cd apr
$ ./buildconf
$ ./configure CFLAGS="-O0 -s -mms-bitfields -march=i686" CXXFLAGS="-O0 -s -mms-bitfields -march=i686"
$ make && make install
$ cd

Build APR-util library:
Depending on your version of apr-util you may need to add --disable-shared --enable-static --disable-dbd-dso

$ cd apr-util
$ ./buildconf
$ ./configure CFLAGS="-O2 -s -mms-bitfields -march=i686" CXXFLAGS="-O2 -s -mms-bitfields -march=i686" --with-apr=/usr/local --with-expat=/usr/local --with-iconv=/usr/local
$ make && make install
$ cd

Build Log4cxx library.
Official MinGW g++-3.4.5 doesn't support wide string, we need to disable them with --disable-wchar_t. Some unofficial MinGW with wide string support can be found (ogre/g++-3.4.5 or develer/g++-4.1.2), but we avoid them until official MinGW GCC 4.2.0 release (soon):

$ cd log4cxx
$ ./autogen.sh
$ ./configure CFLAGS="-O2 -s -mms-bitfields -march=i686" CXXFLAGS="-O2 -s -mms-bitfields -march=i686" --disable-wchar_t --with-apr=/usr/local --with-apr-util=/usr/local
$ make && make install
$ cd

Command line build using ant

MS Developer Studio build

Some information can be found here: http://www.dreamcubes.com/blog/?itemid=43

MSWindowsBuildInstructions (last edited 2009-09-20 23:45:58 by localhost)