diff --git a/libretro-build.sh b/libretro-build.sh index a832b7d6..5826ba44 100755 --- a/libretro-build.sh +++ b/libretro-build.sh @@ -47,17 +47,22 @@ if [ "$HOST_CC" ]; then fi if [ -z "$MAKE" ]; then - if [ "$(expr substr $(uname -s) 1 7)" = "MINGW32" ]; then + if uname -s | grep -i MINGW32 > /dev/null 2>&1; then MAKE=mingw32-make else - MAKE=make + if type gmake > /dev/null 2>&1; then + MAKE=gmake + else + MAKE=make + fi fi fi + if [ -z "$CC" ]; then - if [ $FORMAT_COMPILER_TARGET = "osx" ]; then - CC=clang - elif [ "$(expr substr $(uname -s) 1 7)" = "MINGW32" ]; then + if [ $FORMAT_COMPILER_TARGET = "osx" ]; then + CC=clang + elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then CC=mingw32-gcc else CC=gcc @@ -65,16 +70,16 @@ if [ -z "$CC" ]; then fi if [ -z "$CXX" ]; then - if [ $FORMAT_COMPILER_TARGET = "osx" ]; then - CXX=c++ - CXX11="clang++ -std=c++11 -stdlib=libc++" - elif [ "$(expr substr $(uname -s) 1 7)" = "MINGW32" ]; then - CXX=mingw32-g++ - CXX11=mingw32-g++ - else - CXX=g++ - CXX11=g++ - fi + if [ $FORMAT_COMPILER_TARGET = "osx" ]; then + CXX=c++ + CXX11="clang++ -std=c++11 -stdlib=libc++" + elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then + CXX=mingw32-g++ + CXX11=mingw32-g++ + else + CXX=g++ + CXX11=g++ + fi fi FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET