2011-11-02 15:27:23 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-05-19 09:20:33 +00:00
|
|
|
if [ "$platform" ]; then
|
|
|
|
if [ "$platform" = "win" ]; then
|
|
|
|
DIST_DIR=win
|
|
|
|
elif [ "$platform" = "osx" ]; then
|
|
|
|
DIST_DIR=osx
|
|
|
|
else
|
|
|
|
DIST_DIR=unix
|
|
|
|
fi
|
2013-05-19 09:17:25 +00:00
|
|
|
else
|
2013-05-19 09:20:33 +00:00
|
|
|
UNAME=$(uname)
|
|
|
|
|
|
|
|
if [ $(echo $UNAME | grep Linux) ]; then
|
|
|
|
DIST_DIR=unix
|
|
|
|
elif [ $(echo $UNAME | grep BSD) ]; then
|
|
|
|
DIST_DIR=bsd
|
|
|
|
elif [ $(echo $UNAME | grep Darwin) ]; then
|
|
|
|
DIST_DIR=osx
|
|
|
|
elif [ $(echo $UNAME | grep -i MINGW) ]; then
|
|
|
|
DIST_DIR=win
|
|
|
|
else
|
|
|
|
DIST_DIR=unix
|
|
|
|
fi
|
2013-05-19 09:17:25 +00:00
|
|
|
fi
|
|
|
|
|
2013-05-08 11:00:38 +00:00
|
|
|
# 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")
|
|
|
|
BASE_DIR=$(dirname "$SCRIPT")
|
|
|
|
RARCH_DIR="$BASE_DIR/dist"
|
2013-05-19 09:17:25 +00:00
|
|
|
RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR"
|
2013-05-03 09:32:01 +00:00
|
|
|
|
2011-11-02 15:27:23 +00:00
|
|
|
if [ -z "$1" ]; then
|
2012-04-16 17:33:18 +00:00
|
|
|
LIBRETRO_DIR="/usr/local/lib/libretro"
|
2011-11-02 15:27:23 +00:00
|
|
|
else
|
2012-04-16 17:33:18 +00:00
|
|
|
LIBRETRO_DIR="$1"
|
2011-11-02 15:27:23 +00:00
|
|
|
fi
|
|
|
|
|
2013-05-03 09:32:01 +00:00
|
|
|
for lib in "$RARCH_DIST_DIR"/*
|
2011-11-02 15:27:23 +00:00
|
|
|
do
|
2013-05-08 11:00:38 +00:00
|
|
|
if [ -f "$lib" ]; then
|
|
|
|
install -v -m644 "$lib" "$LIBRETRO_DIR"
|
2011-11-02 15:27:23 +00:00
|
|
|
else
|
|
|
|
echo "Library $lib not found, skipping ..."
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|