From: Jay Freeman (saurik) Date: Mon, 9 Feb 2015 04:35:13 +0000 (-0800) Subject: Fix compile using newer Xcode SDK or gcc on Linux. X-Git-Tag: v1.2.0~8 X-Git-Url: https://git.saurik.com/ldid.git/commitdiff_plain/cd35ba9e30a5b90e88fc728d8740b02d1dd15c5a Fix compile using newer Xcode SDK or gcc on Linux. --- 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