From 4c09bdde3a8dedcf87aca8e609ae7593663e84c8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 12 Jul 2013 17:31:12 +0200 Subject: [PATCH] Replace readlink in libretro-build-android.sh - should hopefully work on OSX now --- libretro-build-android.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) 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() {