From 6a8673092f162f0164f674249cff47fb4a79aa41 Mon Sep 17 00:00:00 2001 From: Mansour Moufid Date: Wed, 29 Jun 2022 17:28:03 -0400 Subject: [PATCH] Allow non-versioned library soname. Signed-off-by: Mansour Moufid --- library/Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/library/Makefile b/library/Makefile index 3c4c7ea5e..2f58f6698 100644 --- a/library/Makefile +++ b/library/Makefile @@ -47,9 +47,9 @@ LOCAL_CFLAGS += -fPIC -fpic endif endif -SOEXT_TLS=so.18 -SOEXT_X509=so.4 -SOEXT_CRYPTO=so.12 +SOEXT_TLS?=so.18 +SOEXT_X509?=so.4 +SOEXT_CRYPTO?=so.12 # Set AR_DASH= (empty string) to use an ar implementation that does not accept # the - prefix for command line options (e.g. llvm-ar) @@ -219,9 +219,11 @@ libmbedtls.$(SOEXT_TLS): $(OBJS_TLS) libmbedx509.so echo " LD $@" $(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_TLS) -L. -lmbedx509 -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS) +ifneq ($(SOEXT_TLS),so) libmbedtls.so: libmbedtls.$(SOEXT_TLS) echo " LN $@ -> $<" ln -sf $< $@ +endif libmbedtls.dylib: $(OBJS_TLS) libmbedx509.dylib echo " LD $@" @@ -246,9 +248,11 @@ libmbedx509.$(SOEXT_X509): $(OBJS_X509) libmbedcrypto.so echo " LD $@" $(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_X509) -L. -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS) +ifneq ($(SOEXT_X509),so) libmbedx509.so: libmbedx509.$(SOEXT_X509) echo " LN $@ -> $<" ln -sf $< $@ +endif libmbedx509.dylib: $(OBJS_X509) libmbedcrypto.dylib echo " LD $@" @@ -273,9 +277,11 @@ libmbedcrypto.$(SOEXT_CRYPTO): $(OBJS_CRYPTO) echo " LD $@" $(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_CRYPTO) $(LOCAL_LDFLAGS) $(LDFLAGS) +ifneq ($(SOEXT_CRYPTO),so) libmbedcrypto.so: libmbedcrypto.$(SOEXT_CRYPTO) echo " LN $@ -> $<" ln -sf $< $@ +endif libmbedcrypto.dylib: $(OBJS_CRYPTO) echo " LD $@"