Tuesday, October 07, 2008

Firebird 2.1.x Mingw build successfully

Firebird 2.1.x Mingw build successfully

First some screnshots with the proof that it works and i will continue with the Howto



Here are the binaries that resulted from the build , You must put the icu dll in system folder




How it was done ? and why

Is painful for an open source project to require an proprietary compiler
I think all these projects could donate time and money to speed up an
good compiler and improve an common c++ IDE but this will be a future goal

Another issues is that IBM, Intel and others they sell c++ compilers
too so they are not so interested to invest too much in g++
maybe google have some interest in it who knows (to make it better)

But many other projects that they realy use mingw for their windows ports
From my head vlc inkscape and thousands of others
http://wiki.inkscape.org/wiki/index.php/Win32Port
http://wiki.videolan.org/Win32Compile

Milan B. told me that is possible to build firebird with mingw compiler so you
have the choice to build firebird binaries with that and release them

The official Firebird minGW build has been supported and updated many times and it started
several years ago (Blas Rodriguez, Dmitry Sibiryakov, etc). It's not
maintained as often as the official build files for Windows, but it's not
abandoned.[ED: so there is still hope]

Here is my starting point with mingw
I Downloaded mingw and msys
http://heanet.dl.sourceforge.net/sourceforge/mingw/MinGW-5.1.4.exe
http://voxel.dl.sourceforge.net/sourceforge/mingw/MSYS-1.0.10.exe

At mingw installer i choose G++

I started cmd.exe and then from the

c:\msys\1.0
I started msys.bat

I have added mingw binaries to the path

PATH=$PATH:/c/mingw/bin

check it with echo $PATH

I downloaded Firebird 2.1.x Source Code

http://sourceforge.net/projects/firebird/files/firebird/2.1.4-Release/Firebird-2.1.4.18393-0.tar.bz2/download


and unziped it in c/msys/1.0/home/mariuz$

tar -jxvf Firebird-2.1.*

now run ./configure and i waited a lot :)

I run this under wine but the steps should be the same on windows
xp for example

./configure part is [OK]
and it runs the compiling part


It stopped at the icu testing
I tried even with g++ 4.3.0 and still got some crashes with building icu
even with ones from ibm 3.8.1

here is the crash log with icu 3.8.1
http://mapopa.blogspot.com/2008/10/i-killed-mingw-compiler-with-icu-3.html

Alex Told me to use the --with-system-icu option in configure

I saw that perl6/parrot is using system icu with mingw when compiling

I downloaded ICU 3.8.1 (similar to the one used in ubuntu/debian)
http://www.icu-project.org/download/3.8.html#ICU4C

run cmd.exe then
mkdir c:\usr\lib

unziped the icu downloaded from here

http://download.icu-project.org/files/icu4c/3.8.1/icu4c-3_8_1-Win32-msvc8.zip

in c:\usr\lib

export PATH=$PATH:/c/usr/lib/icu/bin:
/c/usr/lib/icu/lib:/c/usr/lib/icu
export CPPFLAGS="$CPPFLAGS -I /c/usr/lib/icu/unicode"


run ./configure --with-system-icu --enable-superserver

it compiles but seems to ignore the CPPFLAGS

-c ../src/jrd/unicode_util.cpp -o ../temp/boot/jrd/unicode_util.o
../src/jrd/unicode_util.cpp:39:29: unicode/ustring.h: No such file or directory



quick hack was to modify after configure

make.rules in gen dir and to add to cppflags -I /c/usr/lib/icu/include
and now compilation goes on

i moved the icu/libs into /mingw/lib/

seems that is how msys expects
http://archives.free.net.ph/message/20060609.163929.d99106c3.en.html

and continues until the linking

c:\mingw\bin\..\lib\gcc\
mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
cannot find -licudata

I modified in
make.defaults

ICU_LIBS = -licuuc -licudt -licuin
and seems that compiling continues

And is this part is DONE you saw the screenshots

Here is the full thread on firebird-devel mailing list


What is next ?
I should do some QA with python
and next finish Linux-> Windows cross compiling (seems that is faster to build on linux)
make an install using scripts from builds/win32 dir

Test Cross Compiling from ubuntu with codeblocks/eclipse
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks#Ubuntu
http://article.gmane.org/gmane.comp.gnu.mingw.user/27671

No comments: