Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | require go-${PV}.inc |
| 2 | require go-runtime.inc |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 3 | |
| 4 | export GO_TARGET_INSTALL = "std" |
| 5 | export CC_FOR_TARGET = "${CC}" |
| 6 | export CXX_FOR_TARGET = "${CXX}" |
| 7 | |
| 8 | do_compile() { |
| 9 | export GOBIN="${B}/bin" |
| 10 | export TMPDIR="$GOTMPDIR" |
| 11 | export CC=$BUILD_CC |
| 12 | |
| 13 | cd src |
| 14 | CGO_CFLAGS="${BUILD_CFLAGS}" CGO_LDFLAGS="${BUILD_LDFLAGS}" ./make.bash --host-only |
| 15 | cp ${B}/pkg/tool/${BUILD_GOTUPLE}/go_bootstrap ${B} |
| 16 | rm -rf ${B}/pkg/${TARGET_GOTUPLE} |
| 17 | ./make.bash --target-only |
| 18 | if [ -n "${GO_DYNLINK}" ]; then |
| 19 | cp ${B}/go_bootstrap ${B}/pkg/tool/${BUILD_GOTUPLE} |
| 20 | GO_FLAGS="-buildmode=shared" GO_LDFLAGS="-extldflags \"${LDFLAGS}\"" ./make.bash --target-only |
| 21 | fi |
| 22 | cd ${B} |
| 23 | } |