Fix some plugins not building for windows, also build plugins for raspberry pi

This commit is contained in:
UnknownShadow200 2020-03-08 13:04:11 +11:00
parent a13ddad39d
commit e15aa886e0
2 changed files with 31 additions and 16 deletions

View File

@ -24,8 +24,8 @@
# paths, change these as needed # paths, change these as needed
SOURCE_DIR=~/client SOURCE_DIR=~/client
WEB_CC=~/emscripten/emsdk/emscripten/tag-1.38.30/emcc WEB_CC=~/emscripten/emsdk/emscripten/tag-1.38.30/emcc
MAC32_CC=/usr/bin/clang/osx32 MAC32_CC=~/osx/target/bin/o32-clang
MAC64_CC=/usr/bin/clang/osx64 MAC64_CC=~/osx/target/bin/o64-clang
WIN32_CC=i686-w64-mingw32-gcc WIN32_CC=i686-w64-mingw32-gcc
WIN64_CC=x86_64-w64-mingw32-gcc WIN64_CC=x86_64-w64-mingw32-gcc

View File

@ -7,36 +7,51 @@ FLAGS="-shared -fPIC -O1 -s -std=c99"
NIX32_PATH="gcc -m32" NIX32_PATH="gcc -m32"
NIX64_PATH="gcc -m64" NIX64_PATH="gcc -m64"
MAC32_PATH="/home/buildbot/osx/target/bin/o32-clang" MAC32_PATH=~/osx/target/bin/o32-clang
MAC64_PATH="/home/buildbot/osx/target/bin/o64-clang" MAC64_PATH=~/osx/target/bin/o64-clang
WIN32_PATH="i686-w64-mingw32-gcc" WIN32_PATH=i686-w64-mingw32-gcc
WIN64_PATH="x86_64-w64-mingw32-gcc" WIN64_PATH=x86_64-w64-mingw32-gcc
RPI_PATH=~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc-4.8.3
echo $FILES echo $FILES
echo $INCLUDE_DIRS NIX_FLAGS="-nostartfiles -Wl,--entry=0"
MAC_FLAGS="-undefined dynamic_lookup"
echo "Compiling nix64" # TODO: Figure out why we sometimes need this with mingw
$NIX64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_nix64.so $FLAGS -nostartfiles -Wl,--entry=0 # If we don't include nostart files for some plugins, get a
# ertr000001.o:(.rdata+0x0): undefined reference to `_pei386_runtime_relocator'
# Seems to happen if you use exported variables from the game
if [ -z "$LITE_MODE" ]; then
WIN_FLAGS=""
else
WIN_FLAGS="-nostartfiles -Wl,--entry=0"
fi
echo "Compiling nix32" echo "Compiling nix32"
$NIX32_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_nix32.so $FLAGS -nostartfiles -Wl,--entry=0 $NIX32_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_nix32.so $FLAGS $NIX_FLAGS
echo "Compiling mac64" echo "Compiling nix64"
$MAC64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_osx64.so $FLAGS -undefined dynamic_lookup $NIX64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_nix64.so $FLAGS $NIX_FLAGS
echo "Compiling mac32" echo "Compiling mac32"
$MAC32_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_osx32.so $FLAGS -undefined dynamic_lookup $MAC32_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_osx32.so $FLAGS $MAC_FLAGS
echo "Compiling mac64"
$MAC64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_osx64.so $FLAGS $MAC_FLAGS
echo "Compiling win32" echo "Compiling win32"
rm ClassiCube.exe ClassiCube.def rm ClassiCube.exe ClassiCube.def
cp ~/client/src/cc-w32-d3d.exe ClassiCube.exe cp ~/client/src/cc-w32-d3d.exe ClassiCube.exe
gendef ClassiCube.exe gendef ClassiCube.exe
i686-w64-mingw32-dlltool -d ClassiCube.def -l libClassiCube.a -D ClassiCube.exe i686-w64-mingw32-dlltool -d ClassiCube.def -l libClassiCube.a -D ClassiCube.exe
$WIN32_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_win32.dll -nostartfiles -Wl,--entry=0 $FLAGS -L . -lClassiCube $WIN32_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_win32.dll $FLAGS $WIN_FLAGS -L . -lClassiCube
echo "Compiling win64" echo "Compiling win64"
rm ClassiCube.exe ClassiCube.def rm ClassiCube.exe ClassiCube.def
cp ~/client/src/cc-w64-d3d.exe ClassiCube.exe cp ~/client/src/cc-w64-d3d.exe ClassiCube.exe
gendef ClassiCube.exe gendef ClassiCube.exe
x86_64-w64-mingw32-dlltool -d ClassiCube.def -l libClassiCube.a -D ClassiCube.exe x86_64-w64-mingw32-dlltool -d ClassiCube.def -l libClassiCube.a -D ClassiCube.exe
$WIN64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_win64.dll -nostartfiles -Wl,--entry=0 $FLAGS -L . -lClassiCube $WIN64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_win64.dll $FLAGS $WIN_FLAGS -L . -lClassiCube
echo "Compiling rpi"
$RPI_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_rpi.so $FLAGS -nostartfiles -Wl,--entry=0