]> icculus.org git repositories - btb/d2x.git/blob - arch/win64/build-prereqs.sh
use generic SDL_config.h
[btb/d2x.git] / arch / win64 / build-prereqs.sh
1 #!/bin/sh
2
3 set -e
4
5 prefix="`pwd`"
6 host=x86_64-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_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 cp include/SDL_config.h.default "$prefix/include/SDL/SDL_config.h"
25 cp include/SDL_config_win32.h "$prefix/include/SDL/"
26 $host-strip $prefix/bin/SDL.dll
27
28 cd "$prefix"
29 hg clone -r SDL-1.2 http://hg.libsdl.org/SDL_mixer || true
30 cd SDL_mixer
31 hg up
32 ./autogen.sh
33 ./configure --host=$host --with-sdl-prefix="$prefix" --prefix="$prefix" --disable-static
34 make install-hdrs install-lib
35 $host-strip $prefix/bin/SDL_mixer.dll
36
37 cd "$prefix"
38
39 for file in bin/sdl-config lib/pkgconfig/sdl.pc lib/pkgconfig/SDL_mixer.pc; do \
40   sed -i "" 's/^prefix=.*/prefix=arch\/win64/' $file; \
41 done