diff --git a/helpers/SDL2.helper b/helpers/SDL2.helper index 3cd9aa1..6e07431 100644 --- a/helpers/SDL2.helper +++ b/helpers/SDL2.helper @@ -57,6 +57,7 @@ function buildSDL2() { mkdir -p build pushd build + ../SDL/autogen.sh ../SDL/configure \ --target=${TRIPLE} \ --host=${TRIPLE} \ diff --git a/joeybuild.sh b/joeybuild.sh index ecacb60..e3af126 100755 --- a/joeybuild.sh +++ b/joeybuild.sh @@ -124,6 +124,7 @@ function rebuildJoeyLib() { withTargets buildJoeyLib "Building JoeyLib" + mkdir -p dist cp -f ${G_SRC}/joey.h dist/. mkdir -p dist/3rdparty/memwatch cp -f ${G_SRC}/3rdparty/memwatch/* dist/3rdparty/memwatch/. @@ -220,9 +221,9 @@ function updateSystem() { tBoldBox tBLUE "Examining system..." - tSudo apt update - tSudo apt -y upgrade - tSudo apt -y dist-upgrade + tSudo apt-get update + tSudo apt-get -y upgrade + tSudo apt-get -y dist-upgrade # Shut Canonical up. tSudo pro config set apt_news=false @@ -305,4 +306,4 @@ function withTargets() { # At the very end so we can stream this script from a web server. -startup $@ +startup $@ # 2>&1 | tee lastrun.log diff --git a/targets/Linux.target b/targets/Linux.target index ec5302b..85df768 100644 --- a/targets/Linux.target +++ b/targets/Linux.target @@ -26,6 +26,9 @@ M_SDL2_TAG=97a5e744497ff7cc93edc5119d67cad3ee86dd57 M_TRIPLE="x86_64-linux-gnu" +source helpers/SDL2.helper + + function architectures() { echo "i386 x86_64" } @@ -43,7 +46,6 @@ function buildJoeyLib() { local ARCH=$1 local PASS=$2 - export CFLAGS="-Wall -static-libgcc -D_REENTRANT_ -I${G_INSTALLED}/include -c" export LDFLAGS="-lm -ldl -lpthread" @@ -55,16 +57,14 @@ function buildJoeyLib() { export CFLAGS="-DJOEY_DEBUG ${CFLAGS}" fi - source helpers/SDL2.helper + setCompiler buildJoeyLibSDL2 - - export LDFLAGS= - export CFLAGS= + unSetCompiler } function enabled() { - echo 0 + echo 1 } @@ -76,8 +76,26 @@ function install() { export CFLAGS="-m32" fi - source helpers/SDL2.helper + # Do not call setCompiler here! buildSDL2 ${M_SDL2_TAG} ${M_TRIPLE} +} + +function setCompiler() { + local ARCH=$1 + local PASS=$2 + + export CC=${M_TRIPLE}-gcc + export LD=${M_TRIPLE}-gcc + export AR=${M_TRIPLE}-ar +} + + +function unSetCompiler() { + export CC= + export LD= + export AR= + + export LDFLAGS= export CFLAGS= } diff --git a/targets/MacOS.target b/targets/MacOS.target index a12d54d..5eab820 100644 --- a/targets/MacOS.target +++ b/targets/MacOS.target @@ -25,6 +25,9 @@ M_TRIPLE= +source helpers/SDL2.helper + + function architectures() { echo "i386 x86_64 aarch64" } @@ -50,7 +53,6 @@ function buildJoeyLib() { fi setCompiler ${ARCH} ${PASS} - source helpers/SDL2.helper buildJoeyLibSDL2 unSetCompiler } @@ -86,7 +88,7 @@ function buildMacOSXToolchain() { function enabled() { - echo 1 + echo 0 } @@ -103,7 +105,6 @@ function install() { fi setCompiler ${ARCH} ${PASS} - source helpers/SDL2.helper buildSDL2 ${SDL2_TAG} ${M_TRIPLE} unSetCompiler } diff --git a/targets/Windows.target b/targets/Windows.target index 1240565..877ed02 100644 --- a/targets/Windows.target +++ b/targets/Windows.target @@ -26,6 +26,9 @@ M_SDL2_TAG=97a5e744497ff7cc93edc5119d67cad3ee86dd57 M_TRIPLE= +source helpers/SDL2.helper + + function architectures() { echo "i686 x86_64" } @@ -52,14 +55,13 @@ function buildJoeyLib() { fi setCompiler ${ARCH} ${PASS} - source helpers/SDL2.helper buildJoeyLibSDL2 ${M_TRIPLE} unSetCompiler } function enabled() { - echo 0 + echo 1 } @@ -67,10 +69,8 @@ function install() { local ARCH=$1 local PASS=$2 - setCompiler ${ARCH} ${PASS} - source helpers/SDL2.helper - buildSDL2 ${M_SDL2_TAG} ${M_TRIPLE} - unSetCompiler + # Do not call setCompiler here! + buildSDL2 ${M_SDL2_TAG} "${ARCH}-w64-mingw32" } @@ -93,7 +93,4 @@ function unSetCompiler() { export LDFLAGS= export CFLAGS= - - export LD_LIBRARY_PATH= - export PATH=${G_ORIGINAL_PATH} }