Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 45e789b

Browse files
authored
Merge pull request #3 from fluxcd/darwin-openssl-ldflags
Configure OPENSSL_LDFLAGS on Darwin
2 parents d616dea + 65d142b commit 45e789b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hack/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ ifeq ($(shell uname -s),Darwin)
2828
HAS_BREW := $(shell brew --version 2>/dev/null)
2929
ifdef HAS_BREW
3030
HAS_OPENSSL := $(shell brew --prefix openssl@1.1)
31+
# NB: the OPENSSL_LDFLAGS ensures the path is included in the libgit2.pc
32+
# file. As standard brew installation doesn't appear to be system wide
33+
# on most macOS instances, and you thus have to tell explicitly where
34+
# it can be found.
3135
ifdef HAS_OPENSSL
3236
PKG_CONFIG_PATH := $(PKG_CONFIG_PATH):$(HAS_OPENSSL)/lib/pkgconfig
37+
OS_FLAGS += -DOPENSSL_LDFLAGS:STRING=-L $(HAS_OPENSSL)/lib
3338
else
3439
$(warning "Failed to detect openssl@1.1 installation with brew. It can be installed with 'brew install openssl@1.1',")
3540
$(warning "or an alternative location can be provided using the PKG_CONFIG_PATH flag, for example:")

0 commit comments

Comments
 (0)