From 895c7bc850091af1d5526a75e07e2763c7479b47 Mon Sep 17 00:00:00 2001 From: Alex Petty Date: Wed, 20 May 2020 19:30:52 -0500 Subject: [PATCH 1/2] Enable rpath with Mac OS linker --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index be727417..b41cc1aa 100755 --- a/Makefile +++ b/Makefile @@ -426,9 +426,13 @@ release/quake2 : LDFLAGS += -lexecinfo endif ifeq ($(WITH_RPATH),yes) +ifeq ($(YQ2_OSTYPE), Darwin) +release/quake2 : LDFLAGS += -Wl,-rpath,'$$ORIGIN/lib' +else release/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='$$ORIGIN/lib' endif endif +endif # ---------- From a2d6cc9cdcbee4a06d8501558c5de733b9605cdd Mon Sep 17 00:00:00 2001 From: Alex Petty Date: Wed, 20 May 2020 19:39:09 -0500 Subject: [PATCH 2/2] Mac OS uses @executable_path not for rpath --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b41cc1aa..44cff701 100755 --- a/Makefile +++ b/Makefile @@ -335,6 +335,7 @@ config: @echo "WITH_OPENAL = $(WITH_OPENAL)" @echo "WITH_SYSTEMWIDE = $(WITH_SYSTEMWIDE)" @echo "WITH_SYSTEMDIR = $(WITH_SYSTEMDIR)" + @echo "WITH_RPATH = $(WITH_RPATH)" @echo "============================" @echo "" @@ -427,7 +428,7 @@ endif ifeq ($(WITH_RPATH),yes) ifeq ($(YQ2_OSTYPE), Darwin) -release/quake2 : LDFLAGS += -Wl,-rpath,'$$ORIGIN/lib' +release/quake2 : LDFLAGS += -Wl,-rpath,'@executable_path/lib' else release/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='$$ORIGIN/lib' endif