-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmsys2-build.sh
executable file
·89 lines (57 loc) · 2.96 KB
/
msys2-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh
# get all the stuff for building
pacman -S --noconfirm --needed base-devel msys2-devel
pacman -S --noconfirm --needed binutils make autoconf automake libtool
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-pkg-config
echo
which gcc && gcc --version
# get the dependencies
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-allegro
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-tinyxml2
echo
# change the Windows-specific direct.h to the POSIX-specific unistd.h inside the allegro headers
sed -i 's;direct\.h;unistd.h;' /ucrt64/include/allegro5/platform/almngw32.h
cat /ucrt64/include/allegro5/platform/almngw32.h | grep unistd\.h
[ -d ./m4 ] || mkdir m4
# autoreconf creates the configure script from configure.ac and Makefile.in from Makefile.am
[ -f ./configure ] || autoreconf -i -f
# the following fixes " implicit declaration of function '_spawnv'; did you mean 'spawnv'? "
# which comes from libtool
sed -i 's/_spawnv/spawnv/' ./ltmain.sh
export CPPFLAGS="-D_XOPEN_SOURCE=600" ; echo $CPPFLAGS
echo
# and then the configure script produces Makefile from Makefile.in
INSTALL_PREFIX=/hoh
DEPS_PREFIX=/ucrt64
./configure --prefix=${INSTALL_PREFIX} \
--with-allegro5 --with-allegro-prefix=${DEPS_PREFIX} \
--with-libpng-prefix=${DEPS_PREFIX} --with-ogg-prefix=${DEPS_PREFIX} --with-tinyxml2-prefix=${DEPS_PREFIX}
[ -f ./libtool ] && sed -i 's/_spawnv/spawnv/' ./libtool ; grep spawnv ./libtool
echo
# now make it
make && make install
# after installing copy all shared libraries used by the game binary
echo
cp -v /bin/msys-2.0.dll ${INSTALL_PREFIX}/bin/
cp -v /bin/msys-gcc_s-seh-1.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libgcc_s_seh-1.dll ${INSTALL_PREFIX}/bin/
cp -v /bin/msys-stdc++-6.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libstdc++-6.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libwinpthread-1.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libogg-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libvorbis-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libvorbisfile-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libopus-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libopusfile-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libFLAC.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libdumb.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libopenal-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libwebp-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libsharpyuv-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/allegro-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/allegro_acodec-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/allegro_audio-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/allegro_font-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/allegro_image-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/allegro_primitives-*.dll ${INSTALL_PREFIX}/bin/
cp -v ${DEPS_PREFIX}/bin/libtinyxml2.dll ${INSTALL_PREFIX}/bin/