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
commited24fa882008150da6bc9f92ea9d1e2548612808 (patch)
tree6abff5a6b152836398a4d6d08bd863edda030861 /src/make.bash
parent913ee5322724ceaa53ac050b3f8daeec706eb9f8 (diff)
downloadgo-ed24fa882008150da6bc9f92ea9d1e2548612808.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 issue 4713. R=iant, minux.ma CC=golang-dev https://codereview.appspot.com/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 6c78f93ce..2d83b6f4d 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