Optionally enabled dqlite in build scripts

pull/1034/head
Darren Shepherd 5 years ago
parent 16ec08d425
commit 1f9e92e91f

@ -24,10 +24,16 @@ LDFLAGS="
STATIC="
-extldflags '-static'
"
if [ "$DQLITE" = "true" ]; then
DQLITE_TAGS="dqlite"
DQLITE_STATIC_SQLITE="-luv -lraft -lco"
fi
STATIC_SQLITE="
-extldflags '-static -lm -ldl -lz -lpthread'
-extldflags '-static -lm -ldl -lz -lpthread $DQLITE_STATIC_SQLITE'
"
TAGS="ctrd apparmor seccomp no_btrfs netgo osusergo providerless"
TAGS="ctrd apparmor seccomp no_btrfs netgo osusergo providerless $DQLITE_TAGS"
if [ "$STATIC_BUILD" != "true" ]; then
STATIC="

@ -43,4 +43,7 @@ LDFLAGS="
-w -s
"
STATIC="-extldflags '-static'"
CGO_ENABLED=0 go build -ldflags "$LDFLAGS $STATIC" -o ${CMD_NAME} ./cmd/k3s/main.go
if [ "$DQLITE" = "true" ]; then
DQLITE_TAGS="dqlite"
fi
CGO_ENABLED=0 go build -tags "$DQLITE_TAGS" -ldflags "$LDFLAGS $STATIC" -o ${CMD_NAME} ./cmd/k3s/main.go

Loading…
Cancel
Save