From c69290fb0ca68ef9a1b21f7a014827cfb0053a00 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Fri, 10 Jul 2020 00:00:36 +0300 Subject: [PATCH] macos: support arbitrary configure --libdir Previously, after installation, only ../lib relative to the binary was supported for finding libtcc.dylib, now any custom libdir. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 71c751bd..4718f8c6 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,10 @@ else ifndef CONFIG_OSX LINK_LIBTCC += -Wl,-rpath,"$(libdir)" else - LINK_LIBTCC += -Wl,-rpath,"@executable_path/$(TOP)" -Wl,-rpath,"@executable_path/$(TOP)/../lib" + # macOS doesn't support env-vars libdir out of the box - which we need for + # `make test' when libtcc.dylib is used (configure --disable-static), so + # we bake a relative path into the binary. $libdir is used after install. + LINK_LIBTCC += -Wl,-rpath,"@executable_path/$(TOP)" -Wl,-rpath,"$(libdir)" DYLIBVER += -current_version $(VERSION) DYLIBVER += -compatibility_version $(VERSION) endif