From fd3850c048f7a69db2f066d267797fbc3680d9a0 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Tue, 14 Mar 2017 18:36:38 +0100 Subject: [PATCH] Makefile: set install_name on macos install_name on Mach-O is similar to SONAME on ELF, except that it needs a full path instead of just the basename. Fixes: https://github.com/nodejs/http-parser/issues/356 PR-URL: https://github.com/nodejs/http-parser/pull/358 Reviewed-By: Ben Noordhuis --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 04ec3d3..925cdc0 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,9 @@ PREFIX ?= $(DESTDIR)/usr/local LIBDIR = $(PREFIX)/lib INCLUDEDIR = $(PREFIX)/include -ifneq (darwin,$(PLATFORM)) +ifeq (darwin,$(PLATFORM)) +LDFLAGS_LIB += -Wl,-install_name,$(LIBDIR)/$(SONAME) +else # TODO(bnoordhuis) The native SunOS linker expects -h rather than -soname... LDFLAGS_LIB += -Wl,-soname=$(SONAME) endif