2016-04-04 21:31:49 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# go-bootstrap
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2021-06-22 03:41:17 +02:00
|
|
|
# Use last C-based Go compiler: v1.4.x
|
|
|
|
# See https://golang.org/doc/install/source#bootstrapFromSource
|
|
|
|
GO_BOOTSTRAP_VERSION = 1.4-bootstrap-20171003
|
|
|
|
GO_BOOTSTRAP_SITE = https://dl.google.com/go
|
|
|
|
GO_BOOTSTRAP_SOURCE = go$(GO_BOOTSTRAP_VERSION).tar.gz
|
2016-04-04 21:31:49 +02:00
|
|
|
|
2017-03-30 15:43:38 +02:00
|
|
|
GO_BOOTSTRAP_LICENSE = BSD-3-Clause
|
2016-04-04 21:31:49 +02:00
|
|
|
GO_BOOTSTRAP_LICENSE_FILES = LICENSE
|
|
|
|
|
2016-05-12 02:08:46 +02:00
|
|
|
# To build programs that need cgo support the toolchain needs to be
|
|
|
|
# available, so the toolchain is not needed to build host-go-bootstrap
|
|
|
|
# itself, but needed by other packages that depend on
|
|
|
|
# host-go-bootstrap.
|
|
|
|
HOST_GO_BOOTSTRAP_DEPENDENCIES = toolchain
|
|
|
|
|
2017-07-05 13:14:21 +02:00
|
|
|
HOST_GO_BOOTSTRAP_ROOT = $(HOST_DIR)/lib/go-$(GO_BOOTSTRAP_VERSION)
|
2016-04-04 21:31:49 +02:00
|
|
|
|
2016-05-20 00:33:25 +02:00
|
|
|
# The go build system is not compatable with ccache, so use HOSTCC_NOCCACHE
|
|
|
|
# here. See https://github.com/golang/go/issues/11685.
|
2016-04-04 21:31:49 +02:00
|
|
|
HOST_GO_BOOTSTRAP_MAKE_ENV = \
|
|
|
|
GOOS=linux \
|
|
|
|
GOROOT_FINAL="$(HOST_GO_BOOTSTRAP_ROOT)" \
|
|
|
|
GOROOT="$(@D)" \
|
2016-05-12 02:08:46 +02:00
|
|
|
GOBIN="$(@D)/bin" \
|
2016-05-20 00:33:25 +02:00
|
|
|
CC=$(HOSTCC_NOCCACHE) \
|
2016-05-12 02:08:46 +02:00
|
|
|
CGO_ENABLED=0
|
2016-04-04 21:31:49 +02:00
|
|
|
|
|
|
|
define HOST_GO_BOOTSTRAP_BUILD_CMDS
|
|
|
|
cd $(@D)/src && $(HOST_GO_BOOTSTRAP_MAKE_ENV) ./make.bash
|
|
|
|
endef
|
|
|
|
|
|
|
|
define HOST_GO_BOOTSTRAP_INSTALL_CMDS
|
|
|
|
$(INSTALL) -D -m 0755 $(@D)/bin/go $(HOST_GO_BOOTSTRAP_ROOT)/bin/go
|
|
|
|
$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(HOST_GO_BOOTSTRAP_ROOT)/bin/gofmt
|
|
|
|
|
|
|
|
cp -a $(@D)/lib $(HOST_GO_BOOTSTRAP_ROOT)/
|
|
|
|
cp -a $(@D)/pkg $(HOST_GO_BOOTSTRAP_ROOT)/
|
|
|
|
|
|
|
|
# There is a known issue which requires the go sources to be installed
|
|
|
|
# https://golang.org/issue/2775
|
|
|
|
cp -a $(@D)/src $(HOST_GO_BOOTSTRAP_ROOT)/
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(host-generic-package))
|