golang: Simplify bootstrap stage
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
parent
40bff64ad3
commit
4fb4ec963f
1 changed files with 13 additions and 13 deletions
|
@ -161,25 +161,25 @@ endef
|
||||||
|
|
||||||
# Bootstrap
|
# Bootstrap
|
||||||
|
|
||||||
EXTERNAL_BOOTSTRAP_DIR:=$(call qstrip,$(CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT))
|
BOOTSTRAP_ROOT_DIR:=$(call qstrip,$(CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT))
|
||||||
USE_DEFAULT_BOOTSTRAP:=$(if $(EXTERNAL_BOOTSTRAP_DIR),,1)
|
|
||||||
|
|
||||||
define Download/golang-bootstrap
|
ifeq ($(BOOTSTRAP_ROOT_DIR),)
|
||||||
FILE:=$(BOOTSTRAP_SOURCE)
|
BOOTSTRAP_ROOT_DIR:=$(BOOTSTRAP_BUILD_DIR)
|
||||||
URL:=$(BOOTSTRAP_SOURCE_URL)
|
|
||||||
HASH:=$(BOOTSTRAP_HASH)
|
|
||||||
endef
|
|
||||||
|
|
||||||
ifeq ($(USE_DEFAULT_BOOTSTRAP),1)
|
|
||||||
$(eval $(call GoCompiler/AddProfile,Bootstrap,$(BOOTSTRAP_BUILD_DIR),,bootstrap,$(GO_HOST_OS_ARCH)))
|
|
||||||
|
|
||||||
|
define Download/golang-bootstrap
|
||||||
|
FILE:=$(BOOTSTRAP_SOURCE)
|
||||||
|
URL:=$(BOOTSTRAP_SOURCE_URL)
|
||||||
|
HASH:=$(BOOTSTRAP_HASH)
|
||||||
|
endef
|
||||||
$(eval $(call Download,golang-bootstrap))
|
$(eval $(call Download,golang-bootstrap))
|
||||||
|
|
||||||
define Host/Prepare
|
define Bootstrap/Prepare
|
||||||
$(call Host/Prepare/Default)
|
|
||||||
mkdir -p $(BOOTSTRAP_BUILD_DIR)
|
mkdir -p $(BOOTSTRAP_BUILD_DIR)
|
||||||
$(BOOTSTRAP_UNPACK)
|
$(BOOTSTRAP_UNPACK)
|
||||||
endef
|
endef
|
||||||
|
Hooks/HostPrepare/Post+=Bootstrap/Prepare
|
||||||
|
|
||||||
|
$(eval $(call GoCompiler/AddProfile,Bootstrap,$(BOOTSTRAP_BUILD_DIR),,bootstrap,$(GO_HOST_OS_ARCH)))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ define Host/Compile
|
||||||
)
|
)
|
||||||
|
|
||||||
$(call GoCompiler/Host/Make, \
|
$(call GoCompiler/Host/Make, \
|
||||||
GOROOT_BOOTSTRAP=$(if $(USE_DEFAULT_BOOTSTRAP),$(BOOTSTRAP_BUILD_DIR),$(EXTERNAL_BOOTSTRAP_DIR)) \
|
GOROOT_BOOTSTRAP=$(BOOTSTRAP_ROOT_DIR) \
|
||||||
GOCACHE=$(GO_BUILD_CACHE_DIR) \
|
GOCACHE=$(GO_BUILD_CACHE_DIR) \
|
||||||
CC=$(HOSTCC_NOCACHE) \
|
CC=$(HOSTCC_NOCACHE) \
|
||||||
CXX=$(HOSTCXX_NOCACHE) \
|
CXX=$(HOSTCXX_NOCACHE) \
|
||||||
|
|
Loading…
Reference in a new issue