Make it easier to link against libunicorn on macOS (#1195)

Adding @rpath to the install name to make it possible to link against
the library without modifying it with install_name_tool. Copying both
the versioned and unversioned dylibs simplifies linking.
This commit is contained in:
Saagar Jha
2020-02-11 22:16:34 -08:00
committed by GitHub
parent 901efc4bd4
commit d69ebfa55c
2 changed files with 7 additions and 2 deletions

View File

@@ -112,7 +112,7 @@ API_MAJOR=$(shell echo `grep -e UC_API_MAJOR include/unicorn/unicorn.h | grep -v
ifeq ($(UNAME_S),Darwin)
EXT = dylib
VERSION_EXT = $(API_MAJOR).$(EXT)
$(LIBNAME)_LDFLAGS += -dynamiclib -install_name lib$(LIBNAME).$(VERSION_EXT) -current_version $(PKG_MAJOR).$(PKG_MINOR).$(PKG_EXTRA) -compatibility_version $(PKG_MAJOR).$(PKG_MINOR)
$(LIBNAME)_LDFLAGS += -dynamiclib -install_name @rpath/lib$(LIBNAME).$(VERSION_EXT) -current_version $(PKG_MAJOR).$(PKG_MINOR).$(PKG_EXTRA) -compatibility_version $(PKG_MAJOR).$(PKG_MINOR)
AR_EXT = a
UNICORN_CFLAGS += -fvisibility=hidden