From cd35ba9e30a5b90e88fc728d8740b02d1dd15c5a Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 8 Feb 2015 20:35:13 -0800 Subject: [PATCH] Fix compile using newer Xcode SDK or gcc on Linux. --- make.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/make.sh b/make.sh index 03f1b72..6a3f530 100755 --- a/make.sh +++ b/make.sh @@ -2,18 +2,16 @@ set -e -flags=() +if which xcrun &>/dev/null; then + flags=(xcrun -sdk macosx g++) + flags+=(-mmacosx-version-min=10.4) -sdk=/Developer/SDKs/MacOSX10.4u.sdk -if [[ -e $sdk ]]; then - flags+=(-mmacosx-version-min=10.4 -isysroot "$sdk") -fi - -for arch in i386 x86_64; do - if g++ -arch "${arch}" --version &>/dev/null; then + for arch in i386 x86_64; do flags+=(-arch "${arch}") - fi -done + done +else + flags=(g++) +fi set -x -g++ "${flags[@]}" -o ldid ldid.cpp -I. -x c lookup2.c sha1.c +"${flags[@]}" -o ldid ldid.cpp -I. -x c lookup2.c -x c sha1.c -- 2.45.2