X-Git-Url: https://git.saurik.com/ldid.git/blobdiff_plain/6579543ef65c8bce6e9d26b1aea7851ce070056d..4374152f9caeb53be3e89388effce42be36e62f1:/make.sh?ds=sidebyside diff --git a/make.sh b/make.sh index c8f4672..cbbfbb0 100755 --- a/make.sh +++ b/make.sh @@ -1,10 +1,20 @@ #!/bin/bash -flags=() +set -e -sdk=/Developer/SDKs/MacOSX10.4u.sdk -if [[ -e $sdk ]]; then - flags+=(-mmacosx-version-min=10.4 -isysroot "$sdk") +if which xcrun &>/dev/null; then + flags=(xcrun -sdk macosx g++) + flags+=(-mmacosx-version-min=10.4) + + 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