summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2023-04-11 02:11:54 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2023-04-11 02:11:54 +0000
commit124ebdd255e6a391639e5f579de5c7d65be88b50 (patch)
tree443a78e6e123c66adc5761fc7c08fbca2f263747
parentadc7d993321f568a7726da4b7421b15c027e983c (diff)
parent80dce68581308fe72c0c02a8ff08e3d7131b5aa3 (diff)
downloadgitlab-shell-124ebdd255e6a391639e5f579de5c7d65be88b50.tar.gz
Merge branch 'brodock/fix-heimdal-homebrew' into 'main'
Fix CGO_CFLAGS to use output from `brew --prefix` Closes gitlab-development-kit#1790 See merge request https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/724 Merged-by: Ash McKenzie <amckenzie@gitlab.com> Approved-by: Ash McKenzie <amckenzie@gitlab.com> Approved-by: Alejandro Rodríguez <alejandro@gitlab.com> Co-authored-by: Gabriel Mazetto <gabriel@gitlab.com>
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index cfe9f11..e73f034 100644
--- a/Makefile
+++ b/Makefile
@@ -22,8 +22,10 @@ ifeq (${FIPS_MODE}, 1)
endif
ifeq (${OS}, Darwin) # Mac OS
+ BREW_PREFIX := $(shell brew --prefix 2>/dev/null || echo "/opt/homebrew")
+
# To be able to compile gssapi library
- export CGO_CFLAGS="-I/opt/homebrew/opt/heimdal/include"
+ export CGO_CFLAGS="-I$(BREW_PREFIX)/opt/heimdal/include"
endif
GOBUILD_FLAGS := -ldflags "-X main.Version=$(VERSION_STRING) -X main.BuildTime=$(BUILD_TIME)" -tags "$(BUILD_TAGS)" -mod=mod