From e15aa886e0d6faf170b03d8410b11be1bcd8e7b1 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 8 Mar 2020 13:04:11 +1100 Subject: [PATCH] Fix some plugins not building for windows, also build plugins for raspberry pi --- misc/buildbot.sh | 4 ++-- misc/buildbot_plugin.sh | 43 +++++++++++++++++++++++++++-------------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/misc/buildbot.sh b/misc/buildbot.sh index eef663bcf..bc0677acf 100644 --- a/misc/buildbot.sh +++ b/misc/buildbot.sh @@ -24,8 +24,8 @@ # paths, change these as needed SOURCE_DIR=~/client WEB_CC=~/emscripten/emsdk/emscripten/tag-1.38.30/emcc -MAC32_CC=/usr/bin/clang/osx32 -MAC64_CC=/usr/bin/clang/osx64 +MAC32_CC=~/osx/target/bin/o32-clang +MAC64_CC=~/osx/target/bin/o64-clang WIN32_CC=i686-w64-mingw32-gcc WIN64_CC=x86_64-w64-mingw32-gcc diff --git a/misc/buildbot_plugin.sh b/misc/buildbot_plugin.sh index 8f77603ca..0dbdcb61e 100644 --- a/misc/buildbot_plugin.sh +++ b/misc/buildbot_plugin.sh @@ -7,36 +7,51 @@ FLAGS="-shared -fPIC -O1 -s -std=c99" NIX32_PATH="gcc -m32" NIX64_PATH="gcc -m64" -MAC32_PATH="/home/buildbot/osx/target/bin/o32-clang" -MAC64_PATH="/home/buildbot/osx/target/bin/o64-clang" -WIN32_PATH="i686-w64-mingw32-gcc" -WIN64_PATH="x86_64-w64-mingw32-gcc" +MAC32_PATH=~/osx/target/bin/o32-clang +MAC64_PATH=~/osx/target/bin/o64-clang +WIN32_PATH=i686-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 $INCLUDE_DIRS - -echo "Compiling nix64" -$NIX64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_nix64.so $FLAGS -nostartfiles -Wl,--entry=0 +NIX_FLAGS="-nostartfiles -Wl,--entry=0" +MAC_FLAGS="-undefined dynamic_lookup" +# TODO: Figure out why we sometimes need this with mingw +# 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" -$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" -$MAC64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_osx64.so $FLAGS -undefined dynamic_lookup +echo "Compiling nix64" +$NIX64_PATH $FILES -I ~/client/src/ -I ./src/ -o ${PLUGIN}_nix64.so $FLAGS $NIX_FLAGS 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" rm ClassiCube.exe ClassiCube.def cp ~/client/src/cc-w32-d3d.exe ClassiCube.exe gendef 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" rm ClassiCube.exe ClassiCube.def cp ~/client/src/cc-w64-d3d.exe ClassiCube.exe gendef 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 +