macos: support arbitrary configure --libdir

Previously, after installation, only ../lib relative to the binary was
supported for finding libtcc.dylib, now any custom libdir.
This commit is contained in:
Avi Halachmi (:avih) 2020-07-10 00:00:36 +03:00
parent 6c94df6e2d
commit c69290fb0c

View File

@ -45,7 +45,10 @@ else
ifndef CONFIG_OSX ifndef CONFIG_OSX
LINK_LIBTCC += -Wl,-rpath,"$(libdir)" LINK_LIBTCC += -Wl,-rpath,"$(libdir)"
else 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 += -current_version $(VERSION)
DYLIBVER += -compatibility_version $(VERSION) DYLIBVER += -compatibility_version $(VERSION)
endif endif