• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/go/go.mk
Geoff LevandGeoff Levand committed 8e2bf3cb58f20 May 2016
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
################################################################################
2
#
3
# go
4
#
5
################################################################################
6
​
7
GO_VERSION = 1.6.2
8
GO_SITE = https://storage.googleapis.com/golang
9
GO_SOURCE = go$(GO_VERSION).src.tar.gz
10
​
11
GO_LICENSE = BSD-3c
12
GO_LICENSE_FILES = LICENSE
13
​
14
ifeq ($(BR2_arm),y)
15
GO_GOARCH = arm
16
ifeq ($(BR2_ARM_CPU_ARMV5),y)
17
GO_GOARM = 5
18
else ifeq ($(BR2_ARM_CPU_ARMV6),y)
19
GO_GOARM = 6
20
else ifeq ($(BR2_ARM_CPU_ARMV7A),y)
21
GO_GOARM = 7
22
endif
23
else ifeq ($(BR2_aarch64),y)
24
GO_GOARCH = arm64
25
else ifeq ($(BR2_i386),y)
26
GO_GOARCH = 386
27
else ifeq ($(BR2_x86_64),y)
28
GO_GOARCH = amd64
29
else ifeq ($(BR2_powerpc64),y)
30
GO_GOARCH = ppc64
31
else ifeq ($(BR2_powerpc64le),y)
32
GO_GOARCH = ppc64le
33
else ifeq ($(BR2_mips64),y)
34
GO_GOARCH = mips64
35
else ifeq ($(BR2_mips64el),y)
36
GO_GOARCH = mips64le
37
endif
38
​
39
HOST_GO_DEPENDENCIES = host-go-bootstrap
40
HOST_GO_ROOT = $(HOST_DIR)/usr/lib/go
41
​
42
# For the convienience of target packages.
43
HOST_GO_TOOLDIR = $(HOST_GO_ROOT)/pkg/tool/linux_$(GO_GOARCH)
44
HOST_GO_TARGET_ENV = \
45
    GOARCH=$(GO_GOARCH) \
46
    GOROOT="$(HOST_GO_ROOT)" \
47
    CC="$(TARGET_CC)" \
48
    CXX="$(TARGET_CXX)" \
49
    GOTOOLDIR="$(HOST_GO_TOOLDIR)"
50
​
51
# The go compiler's cgo support uses threads.  If BR2_TOOLCHAIN_HAS_THREADS is
52
# set, build in cgo support for any go programs that may need it.  Note that
53
# any target package needing cgo support must include
54
# 'depends on BR2_TOOLCHAIN_HAS_THREADS' in its config file.
55
ifeq (BR2_TOOLCHAIN_HAS_THREADS,y)
56
HOST_GO_CGO_ENABLED = 1
57
else
58
HOST_GO_CGO_ENABLED = 0
59
endif
60
​
61
# The go build system doesn't have the notion of cross compiling, but just the
62
# notion of architecture.  When the host and target architectures are different
63
# it expects to be given a target cross compiler in CC_FOR_TARGET.  When the
64
# architectures are the same it will use CC_FOR_TARGET for both host and target
65
# compilation.  To work around this limitation build and install a set of
66
# compiler and tool binaries built with CC_FOR_TARGET set to the host compiler.
67
# Also, the go build system is not compatible with ccache, so use
68
# HOSTCC_NOCCACHE.  See https://github.com/golang/go/issues/11685.
69
HOST_GO_MAKE_ENV = \
70
    GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_ROOT) \
71
    GOROOT_FINAL=$(HOST_GO_ROOT) \
72
    GOROOT="$(@D)" \
73
    GOBIN="$(@D)/bin" \
74
    GOARCH=$(GO_GOARCH) \
75
    $(if $(GO_GOARM),GOARM=$(GO_GOARM)) \
76
    GOOS=linux \
77
    CGO_ENABLED=$(HOST_GO_CGO_ENABLED) \
78
    CC=$(HOSTCC_NOCCACHE)
79
​
80
HOST_GO_TARGET_CC = \
81
    CC_FOR_TARGET="$(TARGET_CC)" \
82
    CXX_FOR_TARGET="$(TARGET_CXX)"
83
​
84
HOST_GO_HOST_CC = \
85
    CC_FOR_TARGET=$(HOSTCC_NOCCACHE) \
86
    CXX_FOR_TARGET=$(HOSTCC_NOCCACHE)
87
​
88
HOST_GO_TMP = $(@D)/host-go-tmp
89
​
90
define HOST_GO_BUILD_CMDS
91
    cd $(@D)/src && $(HOST_GO_MAKE_ENV) $(HOST_GO_HOST_CC) ./make.bash
92
    mkdir -p $(HOST_GO_TMP)
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.