From 3a4d1a3769adff47c1ef4d73f6fa3137aa9cc680 Mon Sep 17 00:00:00 2001 From: TLINDEN Date: Wed, 25 Dec 2013 16:08:15 +0100 Subject: [PATCH] fixed freebsd errors --- libretro-build.sh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) 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