diff --git a/libretro-build-android.sh b/libretro-build-android.sh index 811e75f7..31d5f8b7 100755 --- a/libretro-build-android.sh +++ b/libretro-build-android.sh @@ -1,11 +1,34 @@ #!/bin/sh -SCRIPT=$(readlink -f $0) +# BSDs don't have readlink -f +read_link() +{ + TARGET_FILE="$1" + cd $(dirname "$TARGET_FILE") + TARGET_FILE=$(basename "$TARGET_FILE") + + while [ -L "$TARGET_FILE" ] + do + TARGET_FILE=$(readlink "$TARGET_FILE") + cd $(dirname "$TARGET_FILE") + TARGET_FILE=$(basename "$TARGET_FILE") + done + + PHYS_DIR=$(pwd -P) + RESULT="$PHYS_DIR/$TARGET_FILE" + echo $RESULT +} + +SCRIPT=$(read_link "$0") +echo "Script: $SCRIPT" BASE_DIR=$(dirname $SCRIPT) RARCH_DIR=$BASE_DIR/dist RARCH_DIST_DIR=$RARCH_DIR/android FORMAT_EXT=so -JOBS=7 + +if [ -z "$JOBS" ]; then + JOBS=4 +fi die() {