summaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-02-15 13:37:43 -0800
committerRuss Cox <rsc@golang.org>2013-02-15 13:37:43 -0800
commit6d888f1e1b81bd2545e5da710d37a5a0ddce71d5 (patch)
tree12a2d9d61db5223aaeacf60243210a31ad0a6006 /src/make.bash
parent428c4cc8d4611c0ddbfe78416b63f77272dade56 (diff)
downloadgo-git-6d888f1e1b81bd2545e5da710d37a5a0ddce71d5.tar.gz
build: clang support
This works with at least one version of clang that existed at one moment in time. No guarantees about clangs past or future. To try: CC=clang all.bash It does not work with the Xcode clang, because that clang fails at printing a useful answer to: clang -print-libgcc-file-name The clang that works prints a full path name for that command, not just "libgcc.a". Fixes #4713. R=iant, minux.ma CC=golang-dev https://golang.org/cl/7323068
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/make.bash b/src/make.bash
index 6c78f93ce6..2d83b6f4d1 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -29,6 +29,9 @@
# CGO_ENABLED: Controls cgo usage during the build. Set it to 1
# to include all cgo related files, .c and .go file with "cgo"
# build directive, in the build. Set it to 0 to ignore them.
+#
+# CC: Command line to run to get at host C compiler.
+# Default is "gcc". Also supported: "clang".
set -e
if [ ! -f run.bash ]; then
@@ -103,7 +106,7 @@ case "$GOHOSTARCH" in
386) mflag=-m32;;
amd64) mflag=-m64;;
esac
-gcc $mflag -O2 -Wall -Werror -ggdb -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
+${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
eval $(./cmd/dist/dist env -p)
echo