Skip to content

Commit

Permalink
Merge pull request #17 from extremenetworks/priv_alim_extr-1.21-teleg…
Browse files Browse the repository at this point in the history
…rafCrash

Set default GOARM type for GOARCH=arm
  • Loading branch information
arnelplim authored Sep 10, 2024
2 parents 25f7075 + 48513de commit 75c3b0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
HOSTGO := env -u GOOS -u GOARCH -u GOARM -- go

LDFLAGS := $(LDFLAGS) -X main.commit=$(commit) -X main.branch=$(branch) -X main.goos=$(GOOS) -X main.goarch=$(GOARCH)
LDFLAGS := $(LDFLAGS) -X main.commit=$(commit) -X main.branch=$(branch) -X main.goos=$(GOOS) -X main.goarch=$(GOARCH)
ifeq ($(GOARCH), arm)
LDFLAGS := $(LDFLAGS) -X main.goarm=$(GOARM)
endif
ifneq ($(tag),)
LDFLAGS += -X main.version=$(version)
else
Expand Down
6 changes: 4 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ set -e

export LDFLAGS="-w -s"

# Default ARM type for arm architecture
arm_type=5

usage()
{
echo "usage: $0 arch {build | upload}"
Expand All @@ -24,8 +27,7 @@ build()
{
make clean
rm -f ${target}
# make LDFLAGS="-w -s" CGO_ENABLED=0 GOOS=linux GOARCH=${bld_arch} GOPROXY=https://proxy.golang.org,direct GOSUMDB=sum.golang.org
make CGO_ENABLED=0 GOOS=linux GOARCH=${bld_arch} GOPROXY=https://proxy.golang.org,direct GOSUMDB=sum.golang.org
make CGO_ENABLED=0 GOOS=linux GOARCH=${bld_arch} GOARM=${arm_type} GOPROXY=https://proxy.golang.org,direct GOSUMDB=sum.golang.org
tar -cf ${target} telegraf MIT generic_MIT
rm -f telegraf
}
Expand Down

0 comments on commit 75c3b0c

Please sign in to comment.