From 77bcc73ebbc562d8e8173832b710bfbfa4327b13 Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Tue, 9 Apr 2024 00:39:41 +0800 Subject: [PATCH] Makefile: correctly handle version suffixes on macOS On macOS, the version suffix of a shared library comes before the `.dylib` suffix, which is different from the convention on other systems. Currently, the Makefile only overrides `DYLIB_MINOR_NAME` for macOS, but does not handle the other similar variables, namely `DYLIB_MAJOR_NAME`, `SSL_DYLIB_MINOR_NAME`, and `SSL_DYLIB_MAJOR_NAME`. This commit fixes the issue by overriding all these variables for macOS. Signed-off-by: Ruoyu Zhong --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 56e3d59..a9e7844 100644 --- a/Makefile +++ b/Makefile @@ -141,7 +141,10 @@ endif ifeq ($(uname_S),Darwin) DYLIBSUFFIX=dylib DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDIS_SONAME).$(DYLIBSUFFIX) + DYLIB_MAJOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(DYLIBSUFFIX) DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS) + SSL_DYLIB_MINOR_NAME=$(SSL_LIBNAME).$(HIREDIS_SONAME).$(DYLIBSUFFIX) + SSL_DYLIB_MAJOR_NAME=$(SSL_LIBNAME).$(HIREDIS_MAJOR).$(DYLIBSUFFIX) SSL_DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(SSL_DYLIB_MINOR_NAME) -o $(SSL_DYLIBNAME) $(LDFLAGS) $(SSL_LDFLAGS) DYLIB_PLUGIN=-Wl,-undefined -Wl,dynamic_lookup endif