~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/make.bash

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
# GO_LDFLAGS: Additional 5l/6l/8l arguments to use when
24
24
# building the commands.
25
25
#
 
26
# GO_CCFLAGS: Additional 5c/6c/8c arguments to use when
 
27
# building.
 
28
#
26
29
# CGO_ENABLED: Controls cgo usage during the build. Set it to 1
27
30
# to include all cgo related files, .c and .go file with "cgo"
28
31
# build directive, in the build. Set it to 0 to ignore them.
 
32
#
 
33
# GO_EXTLINK_ENABLED: Set to 1 to invoke the host linker when building
 
34
# packages that use cgo.  Set to 0 to do all linking internally.  This
 
35
# controls the default behavior of the linker's -linkmode option.  The
 
36
# default value depends on the system.
 
37
#
 
38
# CC: Command line to run to get at host C compiler.
 
39
# Default is "gcc". Also supported: "clang".
29
40
 
30
41
set -e
31
42
if [ ! -f run.bash ]; then
77
88
        fi
78
89
done
79
90
 
 
91
# Test for debian/kFreeBSD.
 
92
# cmd/dist will detect kFreeBSD as freebsd/$GOARCH, but we need to
 
93
# disable cgo manually.
 
94
if [ "$(uname -s)" == "GNU/kFreeBSD" ]; then
 
95
        export CGO_ENABLED=0
 
96
fi
 
97
 
80
98
# Clean old generated file that will cause problems in the build.
81
99
rm -f ./pkg/runtime/runtime_defs.go
82
100
 
93
111
386) mflag=-m32;;
94
112
amd64) mflag=-m64;;
95
113
esac
96
 
gcc $mflag -O2 -Wall -Werror -ggdb -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
 
114
if [ "$(uname)" == "Darwin" ]; then
 
115
        # golang.org/issue/5261
 
116
        mflag="$mflag -mmacosx-version-min=10.6"
 
117
fi
 
118
${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
97
119
 
98
120
eval $(./cmd/dist/dist env -p)
99
121
echo
122
144
if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
123
145
        echo "# Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
124
146
        GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
125
 
                "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
 
147
                "$GOTOOLDIR"/go_bootstrap install -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
126
148
        echo
127
149
fi
128
150
 
129
151
echo "# Building packages and commands for $GOOS/$GOARCH."
130
 
"$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
 
152
"$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
131
153
echo
132
154
 
133
155
rm -f "$GOTOOLDIR"/go_bootstrap