summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2023-01-27 16:51:28 +0000
committerStan Hu <stanhu@gmail.com>2023-01-27 16:51:28 +0000
commit1d46af77f95ba6eb92df3eec62b7527603f48ab4 (patch)
tree7b1400bedd154c23e0ebd96b3d1b19ee2955e95a
parent7750f56e0c42d619b2a6354d99601d4b4f311867 (diff)
parent892a770265bb9f4ecd8aed870228d238099a0afc (diff)
downloadgitlab-shell-1d46af77f95ba6eb92df3eec62b7527603f48ab4.tar.gz
Merge branch 'id-cgo-cflags' into 'main'
Specify CGO_CFLAGS in Makefile to compile gssapi lib See merge request https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/709 Merged-by: Stan Hu <stanhu@gmail.com> Co-authored-by: Igor Drozdov <idrozdov@gitlab.com>
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ca483fe..290a783 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
.PHONY: validate verify verify_ruby verify_golang test test_ruby test_golang coverage coverage_golang setup _script_install build compile check clean install
FIPS_MODE ?= 0
+OS := $(shell uname)
GO_SOURCES := $(shell find . -name '*.go')
VERSION_STRING := $(shell git describe --match v* 2>/dev/null || awk '$$0="v"$$0' VERSION 2>/dev/null || echo unknown)
BUILD_TIME := $(shell date -u +%Y%m%d.%H%M%S)
@@ -14,6 +15,11 @@ ifeq (${FIPS_MODE}, 1)
export CGO_ENABLED=1
endif
+ifeq (${OS}, Darwin) # Mac OS
+ # To be able to compile gssapi library
+ export CGO_CFLAGS="-I/opt/homebrew/opt/heimdal/include"
+endif
+
GOBUILD_FLAGS := -ldflags "-X main.Version=$(VERSION_STRING) -X main.BuildTime=$(BUILD_TIME)" -tags "$(BUILD_TAGS)" -mod=mod
PREFIX ?= /usr/local