Skip to content

Commit bf34b8f

Browse files
committed
Makefile: Set CGO_CFLAGS dynamically on Mac OS X
When Homebrew is available, gssapi header path can be generated automatically using `brew --prefix`. This handles all edge cases.
1 parent 173674e commit bf34b8f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ image-ocp-deployer: image-ocp-cli
7272
$(call build-image,ocp-recycler,$(IMAGE_REGISTRY)/ocp/4.2:recycler,./images/recycler/Dockerfile.rhel,.)
7373
image-ocp-recycler: image-ocp-cli
7474

75+
# macOS system GSSAPI headers lack RFC 5587 types (gss_const_name_t).
76+
# Use Homebrew's heimdal headers when available.
77+
ifeq ($(shell uname),Darwin)
78+
ifneq (,$(shell which brew 2>/dev/null))
79+
build: export CGO_CFLAGS += -I$(shell brew --prefix)/opt/heimdal/include
80+
endif
81+
endif
82+
7583
oc: GO_BUILD_PACKAGES :=./cmd/oc
7684
oc: build
7785
.PHONY: oc

0 commit comments

Comments
 (0)