Lines 44-50
Link Here
|
44 |
# command |
44 |
# command |
45 |
# |
45 |
# |
46 |
# GO_BUILDFLAGS |
46 |
# GO_BUILDFLAGS |
47 |
# Additional build arguments to be passed to the `go install` command |
47 |
# Additional build arguments to be passed to the `go build` command |
48 |
# |
48 |
# |
49 |
# GO_PORT |
49 |
# GO_PORT |
50 |
# The Go port to use. By default this is lang/go but can be set |
50 |
# The Go port to use. By default this is lang/go but can be set |
Lines 62-67
Link Here
|
62 |
.endif |
62 |
.endif |
63 |
|
63 |
|
64 |
# Settable variables |
64 |
# Settable variables |
|
|
65 |
|
65 |
.if empty(GO_PKGNAME) |
66 |
.if empty(GO_PKGNAME) |
66 |
. if !empty(GH_SUBDIR) |
67 |
. if !empty(GH_SUBDIR) |
67 |
GO_PKGNAME= ${GH_SUBDIR:S|^src/||} |
68 |
GO_PKGNAME= ${GH_SUBDIR:S|^src/||} |
Lines 72-89
Link Here
|
72 |
. endif |
73 |
. endif |
73 |
.endif |
74 |
.endif |
74 |
GO_TARGET?= ${GO_PKGNAME} |
75 |
GO_TARGET?= ${GO_PKGNAME} |
|
|
76 |
|
75 |
GO_BUILDFLAGS+= -v -buildmode=exe |
77 |
GO_BUILDFLAGS+= -v -buildmode=exe |
|
|
78 |
.if !defined(WITH_DEBUG) && empty(GO_BUILDFLAGS:M-ldflags*) |
79 |
GO_BUILDFLAGS+= -ldflags=-s |
80 |
.endif |
81 |
|
76 |
CGO_ENABLED?= 1 |
82 |
CGO_ENABLED?= 1 |
77 |
CGO_CFLAGS+= -I${LOCALBASE}/include |
83 |
CGO_CFLAGS+= -I${LOCALBASE}/include |
78 |
CGO_LDFLAGS+= -L${LOCALBASE}/lib |
84 |
CGO_LDFLAGS+= -L${LOCALBASE}/lib |
|
|
85 |
|
79 |
.if ${ARCH} == armv6 || ${ARCH} == armv7 |
86 |
.if ${ARCH} == armv6 || ${ARCH} == armv7 |
80 |
GOARM?= ${ARCH:C/armv//} |
87 |
GOARM?= ${ARCH:C/armv//} |
81 |
.endif |
88 |
.endif |
82 |
|
89 |
|
83 |
# Read-only variables |
90 |
# Read-only variables |
|
|
91 |
|
84 |
GO_CMD= ${LOCALBASE}/bin/go |
92 |
GO_CMD= ${LOCALBASE}/bin/go |
85 |
GO_WRKDIR_BIN= ${WRKDIR}/bin |
93 |
GO_WRKDIR_BIN= ${WRKDIR}/bin |
86 |
|
|
|
87 |
GO_ENV+= CGO_ENABLED=${CGO_ENABLED} \ |
94 |
GO_ENV+= CGO_ENABLED=${CGO_ENABLED} \ |
88 |
CGO_CFLAGS="${CGO_CFLAGS}" \ |
95 |
CGO_CFLAGS="${CGO_CFLAGS}" \ |
89 |
CGO_LDFLAGS="${CGO_LDFLAGS}" \ |
96 |
CGO_LDFLAGS="${CGO_LDFLAGS}" \ |