RubyPDF Blog tutorial,Ubuntu Build MinGW Cross Compiling Environment under Debian Lenny

Build MinGW Cross Compiling Environment under Debian Lenny

My environment is 32-bit Debian 5.0.5(2.6.26-2-686), a guest installed on VirtualBox.
The job refers to the tutorial of MinGW cross compiling environment.

1. Prepare Requirements,

aptitude install -R autoconf automake bash bison bzip2 \
cmake flex g++ intltool make sed \
libtool libltdl-dev openssl libssl-dev \
libxml-parser-perl patch perl \
pkg-config scons unzip wget \
xz-utils yasm

but I can not find xz-utils, so I compile and install it from source code,

wget http://tukaani.org/xz/xz-5.0.1.tar.gz
tar zxf xz-5.0.1.tar.gz
cd xz-5.0.1
./configure --prefix /usr
make
make install

2. Download and Unpack
wget https://bitbucket.org/vog/mingw-cross-env/downloads/mingw-cross-env-2.19.tar.gz
tar zxf mingw-cross-env-2.19.tar.gz
3.System-wide Installation
mv mingw-cross-env-2.19 /opt/mingw
cd /opt/mingw

4.Build mingw-cross-env
I got some error when do the building job,

1>, Autoconf need 2.62, but the version I installed is 2.61, so I have to install autoconf from source code.

wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2
tar jxf autoconf-2.68.tar.bz2
cd autoconf-2.68
./configure --prefix=/usr
make
make install

2> when compile glib, I got the following error,

./configure: line 10181: syntax error near unexpected token `2.2′
./configure: line 10181: `LT_PREREQ(2.2)’
make[1]: *** [build-only-glib] Error 2

after searched, I got the version of Libtool needs at least 2.2, but the version what I have installed is 1.5.26-4, I had to install it from source


wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.tar.gz
tar zxf libtool-2.4.tar.gz
cd libtool-2.4
./configure --prefix=/usr
make
make install

can not access http://www.libgd.org/

[download] gd

Wrong checksum of package gd!
————————————————————
–2011-03-22 22:04:43– http://www.libgd.org/releases/gd-2.0.35.tar.bz2
Resolving www.libgd.org… 213.251.181.15
Connecting to www.libgd.org|213.251.181.15|:80… failed: Connection refused.
–2011-03-22 22:04:43– http://www.libgd.org/releases/oldreleases/gd-2.0.35.tar.bz2
Resolving www.libgd.org… 213.251.181.15
Connecting to www.libgd.org|213.251.181.15|:80… failed: Connection refused.
————————————————————
[log] /opt/mingw/log/gd-download

make: *** [/opt/mingw/usr/installed/gd] Error 1

After search, I got another download location, so I downloaded it and saved it in the pkg folder

wget http://jaist.dl.sourceforge.net/project/buluoos/0.1/src/gd-2.0.35.tar.bz2 -O /opt/mingw/pkg/gd-2.0.35.tar.bz2

then continue the make

Failed to build package openal!
————————————————————
make[3]: *** [CMakeFiles/openal-info.dir/all] Error 2
make[3]: Leaving directory `/opt/mingw/tmp-openal/openal-soft-1.13/build’
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/mingw/tmp-openal/openal-soft-1.13/build’
make[1]: *** [build-only-openal] Error 2
make[1]: Leaving directory `/opt/mingw’
real 0m27.641s
user 0m10.549s
sys 0m16.785s
————————————————————
[log] /opt/mingw/log/openal

make: *** [/opt/mingw/usr/installed/openal] Error 1

After manually build OpenAL32, I got the following error,

[ 96%] Built target OpenAL32
Linking C executable openal-info.exe
libOpenAL32.a(dsound.obj):dsound.c:(.text+0x9e0): undefined reference to `_GUID_NULL’
libOpenAL32.a(dsound.obj):dsound.c:(.text+0xa00): undefined reference to `_GUID_NULL’
libOpenAL32.a(dsound.obj):dsound.c:(.text+0xa09): undefined reference to `_GUID_NULL’
libOpenAL32.a(dsound.obj):dsound.c:(.text+0xa12): undefined reference to `_GUID_NULL’
collect2: ld returned 1 exit status
make[2]: *** [openal-info.exe] Error 1
make[1]: *** [CMakeFiles/openal-info.dir/all] Error 2
make: *** [all] Error 2

need modify tmp-openal/openal-soft-1.13/build/CMakeFiles/openal-info.dir/link.txt and add -luuid (seems it is bug, I noticed it patched openal-1-luuid-pkg-config.patch, but no use.).

In fact, if you just want a MinGW cross compile environment, please do not directly execute make, because it has 169 packages, and most of them maybe you do not need at all.
finally, I compiled all 169 packages, and the usr folder is about 2.2G, after the created tar also 580.76M(I use tar cjf i686-pc-mingw32.tar.bz2 usr)

2 thoughts on “Build MinGW Cross Compiling Environment under Debian Lenny”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.