mirror of
https://github.com/libretro/libretro-super
synced 2024-12-26 09:22:00 +00:00
Make retroarch-build.sh work outside of libretro-super.
This commit is contained in:
parent
1de23cf6f9
commit
830b522753
@ -1,30 +1,21 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
# vim: set ts=3 sw=3 noet ft=sh : bash
|
# vim: set ts=3 sw=3 noet ft=sh : bash
|
||||||
|
|
||||||
. ./libretro-config.sh
|
SCRIPT="${0#./}"
|
||||||
|
BASE_DIR="${SCRIPT%/*}"
|
||||||
|
WORKDIR="$PWD"
|
||||||
|
|
||||||
# BSDs don't have readlink -f
|
if [ "$BASE_DIR" = "$SCRIPT" ]; then
|
||||||
read_link()
|
BASE_DIR="$WORKDIR"
|
||||||
{
|
else
|
||||||
TARGET_FILE="$1"
|
if [[ "$0" != /* ]]; then
|
||||||
cd $(dirname "$TARGET_FILE")
|
# Make the path absolute
|
||||||
TARGET_FILE=$(basename "$TARGET_FILE")
|
BASE_DIR="$WORKDIR/$BASE_DIR"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
while [ -L "$TARGET_FILE" ]
|
. "$BASE_DIR/libretro-config.sh"
|
||||||
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")
|
|
||||||
if [ -z "$RARCH_DIST_DIR" ]; then
|
if [ -z "$RARCH_DIST_DIR" ]; then
|
||||||
RARCH_DIR="$BASE_DIR/dist"
|
RARCH_DIR="$BASE_DIR/dist"
|
||||||
RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR"
|
RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR"
|
||||||
|
Loading…
Reference in New Issue
Block a user