summaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/make.bash b/src/make.bash
index 2d83b6f4d..10696e765 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -30,6 +30,11 @@
# to include all cgo related files, .c and .go file with "cgo"
# build directive, in the build. Set it to 0 to ignore them.
#
+# GO_EXTLINK_ENABLED: Set to 1 to invoke the host linker when building
+# packages that use cgo. Set to 0 to do all linking internally. This
+# controls the default behavior of the linker's -linkmode option. The
+# default value depends on the system.
+#
# CC: Command line to run to get at host C compiler.
# Default is "gcc". Also supported: "clang".
@@ -106,6 +111,10 @@ case "$GOHOSTARCH" in
386) mflag=-m32;;
amd64) mflag=-m64;;
esac
+if [ "$(uname)" == "Darwin" ]; then
+ # golang.org/issue/5261
+ mflag="$mflag -mmacosx-version-min=10.6"
+fi
${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
eval $(./cmd/dist/dist env -p)