X-Git-Url: https://git.saurik.com/ldid.git/blobdiff_plain/5525a5a7136af1b5cfbf80acfee879144d4cc74b..4374152f9caeb53be3e89388effce42be36e62f1:/make.sh diff --git a/make.sh b/make.sh index 3928373..cbbfbb0 100755 --- a/make.sh +++ b/make.sh @@ -1,2 +1,20 @@ #!/bin/bash -g++ -arch ppc -arch i386 -arch x86_64 -o ldid ldid.cpp -I. -x c lookup2.c sha1.c + +set -e + +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 + +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