aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYurii Rashkovskii <[email protected]>2011-07-25 18:42:35 -0700
committerYurii Rashkovskii <[email protected]>2011-07-25 18:42:35 -0700
commit3a7056839f498e53c6173145478b8a1677c34f76 (patch)
treec6fc4f93fc4771adeef555668da445b8b655ffe0
parentf2c9fd68276597c3cf6dd3cd5fd469c36f126d1e (diff)
downloadkerl-3a7056839f498e53c6173145478b8a1677c34f76.tar.gz
kerl-3a7056839f498e53c6173145478b8a1677c34f76.tar.bz2
kerl-3a7056839f498e53c6173145478b8a1677c34f76.zip
On OS X, when the default gcc available is llvm-gcc, switch to either gcc-4.2 or disable all optimizations (should allow the build to complete as well)
-rwxr-xr-xkerl10
1 files changed, 10 insertions, 0 deletions
diff --git a/kerl b/kerl
index d1f569a..9aff059 100755
--- a/kerl
+++ b/kerl
@@ -1,5 +1,6 @@
#! /bin/sh
+# Copyright (c) 2011 Spawngrid, Inc
# Copyright (c) 2011 Evax Software <contact(at)evax(dot)org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -67,6 +68,15 @@ case "$KERL_SYSTEM" in
MD5SUM="openssl md5"
MD5SUM_FIELD=2
SED_OPT=-E
+ if [ `gcc --version | grep llvm | wc -l` = "1" ]; then
+ if [ -x `which gcc-4.2` ]; then
+ echo "Adjust compiler settings for OS X: using gcc-4.2"
+ KERL_CONFIGURE_OPTIONS="CC=gcc-4.2 $KERL_CONFIGURE_OPTIONS"
+ else
+ echo "Adjust compiler settings for OS X: using -O0"
+ KERL_CONFIGURE_OPTIONS="CFLAGS=-O0 $KERL_CONFIGURE_OPTIONS"
+ fi
+ fi
;;
*)
MD5SUM=md5sum