diff options
author | Shenghou Ma <minux.ma@gmail.com> | 2014-04-29 00:32:16 -0400 |
---|---|---|
committer | Shenghou Ma <minux.ma@gmail.com> | 2014-04-29 00:32:16 -0400 |
commit | 84f0efd06b5aec1d7892fb7a6065c27408e3b8e5 (patch) | |
tree | 4ae76a3a00fa02c551675cdda8a5877f8c014b91 | |
parent | 085253eca212149c0ac1314f41333df5f74a8bfe (diff) | |
download | go-84f0efd06b5aec1d7892fb7a6065c27408e3b8e5.tar.gz |
make.bash: if CC is not set, and gcc doesn't exist, try clang/clang++.
This should make Go build without setting CC and CXX on newer FreeBSDs.
LGTM=iant
R=golang-codereviews, dave, gobot, iant
CC=golang-codereviews
https://codereview.appspot.com/89230045
-rwxr-xr-x | src/make.bash | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/make.bash b/src/make.bash index bfcb5d58e..0b130b668 100755 --- a/src/make.bash +++ b/src/make.bash @@ -125,6 +125,10 @@ if [ "$(uname)" == "Darwin" ]; then # golang.org/issue/5261 mflag="$mflag -mmacosx-version-min=10.6" fi +# if gcc does not exist and $CC is not set, try clang if available. +if [ -z "$CC" -a -z "$(type -t gcc)" -a -n "$(type -t clang)" ]; then + export CC=clang CXX=clang++ +fi ${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c # -e doesn't propagate out of eval, so check success by hand. |