summaryrefslogtreecommitdiffstats
path: root/make.sh
diff options
context:
space:
mode:
Diffstat (limited to 'make.sh')
-rwxr-xr-xmake.sh20
1 files 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