diff --git a/libretro-install.sh b/libretro-install.sh index b69b8949..39ca6403 100755 --- a/libretro-install.sh +++ b/libretro-install.sh @@ -1,5 +1,19 @@ #!/bin/sh +UNAME=$(uname) + +if [ $(echo $UNAME | grep Linux) ] || [ x"$platform" = x"unix" ]; then + DIST_DIR=unix +elif [ $(echo $UNAME | grep BSD) ]; then + DIST_DIR=bsd +elif [ $(echo $UNAME | grep Darwin) ] || [ x"$platform" = x"osx" ]; then + DIST_DIR=osx +elif [ $(echo $UNAME | grep -i MINGW) ] || [ x"$platform" = x"win" ]; then + DIST_DIR=win +else + DIST_DIR=unix +fi + # BSDs don't have readlink -f read_link() { @@ -22,7 +36,7 @@ read_link() SCRIPT=$(read_link "$0") BASE_DIR=$(dirname "$SCRIPT") RARCH_DIR="$BASE_DIR/dist" -RARCH_DIST_DIR="$RARCH_DIR/pc" +RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR" if [ -z "$1" ]; then LIBRETRO_DIR="/usr/local/lib/libretro"