File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,17 @@ ifeq ($(HAS_GO), yes)
4848 CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
4949endif
5050
51+ CGO_ENABLED ?= 0
52+ ifneq (,$(findstring sqlite,$(TAGS ) ) )
53+ CGO_ENABLED = 1
54+ endif
55+
56+ STATIC ?=
57+ EXTLDFLAGS ?=
58+ ifneq ($(STATIC ) ,)
59+ EXTLDFLAGS = -extldflags "-static"
60+ endif
61+
5162ifeq ($(GOOS ) ,windows)
5263 IS_WINDOWS := yes
5364else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
@@ -746,7 +757,7 @@ security-check:
746757 go run $(GOVULNCHECK_PACKAGE ) -show color ./...
747758
748759$(EXECUTABLE ) : $(GO_SOURCES ) $(TAGS_PREREQ )
749- CGO_ENABLED=1 CGO_CFLAGS=" $( CGO_CFLAGS) " $(GO ) build $(GOFLAGS ) $(EXTRA_GOFLAGS ) -tags ' $(TAGS)' -ldflags ' -s -w -extldflags "-static" $(LDFLAGS)' -o $@
760+ CGO_ENABLED=" $( CGO_ENABLED ) " CGO_CFLAGS=" $( CGO_CFLAGS) " $(GO ) build $(GOFLAGS ) $(EXTRA_GOFLAGS ) -tags ' $(TAGS)' -ldflags ' -s -w $(EXTLDFLAGS) $(LDFLAGS)' -o $@
750761
751762.PHONY : release
752763release : frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-check
Original file line number Diff line number Diff line change 4848 GOROOT = "${ go } /share/go" ;
4949
5050 TAGS = "sqlite sqlite_unlock_notify" ;
51+ STATIC = "true" ;
5152 } ;
5253 }
5354 ) ;
You can’t perform that action at this time.
0 commit comments