From e8aab9ce04bccd890205174e7bd0a9a57f0e467c Mon Sep 17 00:00:00 2001 From: Vasco Guita Date: Thu, 16 Mar 2023 19:52:21 +0100 Subject: [PATCH] Add support for static linking (#3733) --- Makefile | 2 +- changelog/unreleased/enhancement-static.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/enhancement-static.md diff --git a/Makefile b/Makefile index c10d4f0f57d..2f577bf6c66 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ GIT_COMMIT ?= `git rev-parse --short HEAD` VERSION ?= `git describe --always` GO_VERSION ?= `go version | awk '{print $$3}'` BUILD_DATE = `date +%FT%T%z` -BUILD_FLAGS = "-X main.gitCommit=$(GIT_COMMIT) -X main.version=$(VERSION) -X main.goVersion=$(GO_VERSION) -X main.buildDate=$(BUILD_DATE)" +BUILD_FLAGS = "`[[ -z "$(STATIC)" ]] && echo "" || echo "-extldflags=-static"` -X main.gitCommit=$(GIT_COMMIT) -X main.version=$(VERSION) -X main.goVersion=$(GO_VERSION) -X main.buildDate=$(BUILD_DATE)" .PHONY: revad revad: diff --git a/changelog/unreleased/enhancement-static.md b/changelog/unreleased/enhancement-static.md new file mode 100644 index 00000000000..ecdb44eeead --- /dev/null +++ b/changelog/unreleased/enhancement-static.md @@ -0,0 +1,6 @@ +Enhancement: Add support for static linking + +We've added support for compiling reva with static linking enabled. +It's possible to do so with the `STATIC` flag: `make revad STATIC=true` + +https://github.com/cs3org/reva/pull/3733 \ No newline at end of file