Replace readlink in libretro-build-android.sh - should hopefully

work on OSX now
This commit is contained in:
twinaphex 2013-07-12 17:31:12 +02:00
parent e63cf4f4dd
commit 4c09bdde3a

View File

@ -1,11 +1,34 @@
#!/bin/sh #!/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) BASE_DIR=$(dirname $SCRIPT)
RARCH_DIR=$BASE_DIR/dist RARCH_DIR=$BASE_DIR/dist
RARCH_DIST_DIR=$RARCH_DIR/android RARCH_DIST_DIR=$RARCH_DIR/android
FORMAT_EXT=so FORMAT_EXT=so
JOBS=7
if [ -z "$JOBS" ]; then
JOBS=4
fi
die() die()
{ {