diff options
author | Jhon Honce <jhonce@redhat.com> | 2021-10-14 10:03:26 -0700 |
---|---|---|
committer | Chris Hofstaedtler <chris.hofstaedtler@deduktiva.com> | 2021-11-17 11:51:33 +0100 |
commit | 25f35ac9e82865650cfe239f68d0c0bd80781bce (patch) | |
tree | 84c34e86b17f8aeeb29e19c2a1a5692ebe069477 | |
parent | 4808a63e5f1ad72d754c61c005c2c7c29ce48014 (diff) | |
download | podman-25f35ac9e82865650cfe239f68d0c0bd80781bce.tar.gz podman-25f35ac9e82865650cfe239f68d0c0bd80781bce.tar.bz2 podman-25f35ac9e82865650cfe239f68d0c0bd80781bce.zip |
Use CGO_ENABLED=1 when building natively on darwin
Need to use CGO for mDNS resolution, but cross builds need CGO disabled
See https://github.com/golang/go/issues/12524 for details
Note: Homebrew forumla will need to be updated to pick up this change
Fixes #10737
Signed-off-by: Jhon Honce <jhonce@redhat.com>
-rw-r--r-- | Makefile | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -173,6 +173,15 @@ define go-get $(GO) get -u ${1} endef +# Need to use CGO for mDNS resolution, but cross builds need CGO disabled +# See https://github.com/golang/go/issues/12524 for details +DARWIN_GCO := 0 +ifeq ($(NATIVE_GOOS),darwin) +ifdef HOMEBREW_PREFIX + DARWIN_GCO := 1 +endif +endif + ### ### Primary entry-point targets ### @@ -349,7 +358,7 @@ podman-remote-windows: ## Build podman-remote for Windows .PHONY: podman-remote-darwin podman-remote-darwin: ## Build podman-remote for macOS $(MAKE) \ - CGO_ENABLED=0 \ + CGO_ENABLED=$(DARWIN_GCO) \ GOOS=darwin \ bin/darwin/podman |