X-Git-Url: https://git.saurik.com/ldid.git/blobdiff_plain/1d58df4c83bbf5e105c65829ca3ff4d00e9de005..4374152f9caeb53be3e89388effce42be36e62f1:/make.sh diff --git a/make.sh b/make.sh index f1f2a81..cbbfbb0 100755 --- a/make.sh +++ b/make.sh @@ -1,12 +1,20 @@ #!/bin/bash -set -e -x +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") + for arch in i386 x86_64; do + flags+=(-arch "${arch}") + done +else + flags=(g++) fi -g++ -arch ppc -arch i386 -arch x86_64 "${flags[@]}" -o ldid ldid.cpp -I. -x c lookup2.c sha1.c +flags+=(-I.) + +set -x +"${flags[@]}" -c -std=c++11 -o ldid.o ldid.cpp +"${flags[@]}" -o ldid ldid.o -x c lookup2.c -x c sha1.c