Skip to content

Commit

Permalink
On OS X, when the default gcc available is llvm-gcc, switch to either…
Browse files Browse the repository at this point in the history
… gcc-4.2 or disable all optimizations (should allow the build to complete as well)
  • Loading branch information
Yurii Rashkovskii committed Jul 26, 2011
1 parent f2c9fd6 commit 3a70568
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kerl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3a70568

Please sign in to comment.