]> icculus.org git repositories - btb/d2x.git/blob - arch/win32/build-prereqs.sh
add i586 mingw build
[btb/d2x.git] / arch / win32 / build-prereqs.sh
1 #!/bin/sh
2
3 set -e
4
5 prefix="`pwd`"
6 host=i686-w64-mingw32
7
8 cd "$prefix"
9 hg clone -r stable-2.0 http://hg.icculus.org/icculus/physfs/ || true
10 cd physfs
11 hg up
12 mkdir -p build
13 cd build
14 cmake -DCMAKE_SYSTEM_NAME=windows -DCMAKE_C_COMPILER=$(which $host-gcc) -DCMAKE_C_FLAGS=-Wno-pointer-to-int-cast -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$prefix" -DPHYSFS_BUILD_STATIC=OFF -DPHYSFS_BUILD_TEST=OFF ..
15 make install/strip
16
17 cd "$prefix"
18 hg clone -r SDL-1.2 http://hg.libsdl.org/SDL || true
19 cd SDL
20 hg up
21 ./autogen.sh
22 ./configure --host=$host --prefix="$prefix" --disable-static
23 make install
24 $host-strip $prefix/bin/SDL.dll
25
26 cd "$prefix"
27 hg clone -r SDL-1.2 http://hg.libsdl.org/SDL_mixer || true
28 cd SDL_mixer
29 hg up
30 ./autogen.sh
31 ./configure --host=$host --with-sdl-prefix="$prefix" --prefix="$prefix" --disable-static
32 make install-hdrs install-lib
33 $host-strip $prefix/bin/SDL_mixer.dll
34
35 cd "$prefix"
36
37 for file in bin/sdl-config lib/pkgconfig/sdl.pc lib/pkgconfig/SDL_mixer.pc; do \
38 sed -i "" 's/^prefix=.*/prefix=arch\/win32/' $file; \
39 done