From 5ac11b8af9f1aec7fd3d106954c595ac5c034d1f Mon Sep 17 00:00:00 2001 From: HalosGhost Date: Sun, 21 Jul 2013 14:54:23 -0500 Subject: [PATCH] Reduce redundant code in platform assignment --- libretro-config.sh | 55 ++++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 36 deletions(-) diff --git a/libretro-config.sh b/libretro-config.sh index 4c28a62c..31e7110b 100755 --- a/libretro-config.sh +++ b/libretro-config.sh @@ -17,42 +17,25 @@ esac echo "$ARCH CPU detected" # Platform Assignment -if [ "$platform" ]; then - case "$platform" in - win) - FORMAT_EXT='dll' - FORMAT_COMPILER_TARGET=win - DIST_DIR=win;; - osx) - FORMAT_EXT='dylib' - FORMAT_COMPILER_TARGET=osx - DIST_DIR=osx;; - *) - FORMAT_EXT='so' - FORMAT_COMPILER_TARGET=unix - DIST_DIR=unix;; - esac -else - UNAME="$(uname)" - case "$UNAME" in - *BSD*) - FORMAT_EXT='so' - FORMAT_COMPILER_TARGET=unix - DIST_DIR=bsd;; - *Darwin*) - FORMAT_EXT='dylib' - FORMAT_COMPILER_TARGET=osx - DIST_DIR=osx;; - *mingw*|*MINGW*) - FORMAT_EXT='dll' - FORMAT_COMPILER_TARGET=win - DIST_DIR=win;; - *) - FORMAT_EXT='so' - FORMAT_COMPILER_TARGET=unix - DISTT_DIR=unix;; - esac -fi +[ -z "$platform" ] && platform="$(uname)" +case "$platform" in + *BSD*) + FORMAT_EXT='so' + FORMAT_COMPILER_TARGET=unix + DIST_DIR=bsd;; + osx|*Darwin*) + FORMAT_EXT='dylib' + FORMAT_COMPILER_TARGET=osx + DIST_DIR=osx;; + win|*mingw*|*MINGW*) + FORMAT_EXT='dll' + FORMAT_COMPILER_TARGET=win + DIST_DIR=win;; + *) + FORMAT_EXT='so' + FORMAT_COMPILER_TARGET=unix + DIST_DIR=unix;; +esac export FORMAT_COMPILER_TARGET_ALT="$FORMAT_COMPILER_TARGET"