From 724dcd36e9880a83cd4e2ea9e4a47e750ad59161 Mon Sep 17 00:00:00 2001 From: Le Philousophe Date: Thu, 11 Nov 2021 11:33:44 +0100 Subject: [PATCH] OPENDINGUX: Rework build_odbeta.sh to avoid environment variables --- backends/platform/sdl/opendingux/README.BUILD | 4 +-- .../platform/sdl/opendingux/build_odbeta.sh | 27 ++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/backends/platform/sdl/opendingux/README.BUILD b/backends/platform/sdl/opendingux/README.BUILD index 241803e394e..69db3db279f 100644 --- a/backends/platform/sdl/opendingux/README.BUILD +++ b/backends/platform/sdl/opendingux/README.BUILD @@ -6,12 +6,12 @@ Running Linux on an x86/amd64 machine: 2. git clone the ScummVM repository -3. Run 'target=x backends/platform/sdl/opendingux/build_odbeta.sh' +3. Run 'backends/platform/sdl/opendingux/build_odbeta.sh x' where x=gcw0|lepus|rg99 Or if you want a dual opk with one launcher capable of starting games directly for e.g. simplemenu integration : - 'target=x dualopk=yes backends/platform/sdl/opendingux/build_odbeta.s' + 'backends/platform/sdl/opendingux/build_odbeta.sh x dualopk' 4. Copy the resulting file scummvm_$(target).opk or scummvm_$(target)_dual.opk to your device diff --git a/backends/platform/sdl/opendingux/build_odbeta.sh b/backends/platform/sdl/opendingux/build_odbeta.sh index e639690b5df..5b026508302 100755 --- a/backends/platform/sdl/opendingux/build_odbeta.sh +++ b/backends/platform/sdl/opendingux/build_odbeta.sh @@ -1,37 +1,46 @@ #!/bin/bash -CONFIG="./configure --host=opendingux-$target --enable-release --disable-detection-full" +set -e + +target=$1 +if [ "$2" = "dualopk" ]; then + dualopk="dualopk=yes" +else + dualopk= +fi case $target in gcw0) target2=$target + libc=uclibc ;; lepus) target2=$target + libc=musl ;; rg99) target2=rs90 + libc=musl ;; *) echo "please provide a valid target for the build: gcw0, lepus or rg99" - exit 0 + exit 1 ;; esac TOOLCHAIN=/opt/$target2-toolchain - -if [ $target == "gcw0" ]; then - SYSROOT=$TOOLCHAIN/mipsel-$target2-linux-uclibc -else - SYSROOT=$TOOLCHAIN/mipsel-$target2-linux-musl -fi +SYSROOT=$TOOLCHAIN/mipsel-$target2-linux-$libc export PATH=$TOOLCHAIN/usr/bin:$SYSROOT/usr/include:$TOOLCHAIN/bin:$PATH export CXX=mipsel-linux-g++ export CXXFLAGS="-funsigned-char" # workaround for a scummvm tolower() bug when adding games -$CONFIG && make -j12 od-make-opk && ls -lh scummvm_$target*.opk +./configure --host=opendingux-$target --enable-release --disable-detection-full + +make -j12 od-make-opk $dualopk + +ls -lh scummvm_$target*.opk