mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-03 01:20:39 +00:00
Merge pull request #5993 from eliteraspberries/android-soname
Allow non-versioned library soname.
This commit is contained in:
commit
7b1be55484
5
ChangeLog.d/nonversioned-library-soname.txt
Normal file
5
ChangeLog.d/nonversioned-library-soname.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Features
|
||||||
|
* make: enable building unversioned shared library, with e.g.:
|
||||||
|
"SHARED=1 SOEXT_TLS=so SOEXT_X509=so SOEXT_CRYPTO=so make lib"
|
||||||
|
resulting in library names like "libmbedtls.so" rather than
|
||||||
|
"libmbedcrypto.so.11".
|
@ -47,9 +47,9 @@ LOCAL_CFLAGS += -fPIC -fpic
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SOEXT_TLS=so.18
|
SOEXT_TLS?=so.18
|
||||||
SOEXT_X509=so.4
|
SOEXT_X509?=so.4
|
||||||
SOEXT_CRYPTO=so.12
|
SOEXT_CRYPTO?=so.12
|
||||||
|
|
||||||
# Set AR_DASH= (empty string) to use an ar implementation that does not accept
|
# Set AR_DASH= (empty string) to use an ar implementation that does not accept
|
||||||
# the - prefix for command line options (e.g. llvm-ar)
|
# the - prefix for command line options (e.g. llvm-ar)
|
||||||
@ -219,9 +219,11 @@ libmbedtls.$(SOEXT_TLS): $(OBJS_TLS) libmbedx509.so
|
|||||||
echo " LD $@"
|
echo " LD $@"
|
||||||
$(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_TLS) -L. -lmbedx509 -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS)
|
$(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_TLS) -L. -lmbedx509 -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS)
|
||||||
|
|
||||||
|
ifneq ($(SOEXT_TLS),so)
|
||||||
libmbedtls.so: libmbedtls.$(SOEXT_TLS)
|
libmbedtls.so: libmbedtls.$(SOEXT_TLS)
|
||||||
echo " LN $@ -> $<"
|
echo " LN $@ -> $<"
|
||||||
ln -sf $< $@
|
ln -sf $< $@
|
||||||
|
endif
|
||||||
|
|
||||||
libmbedtls.dylib: $(OBJS_TLS) libmbedx509.dylib
|
libmbedtls.dylib: $(OBJS_TLS) libmbedx509.dylib
|
||||||
echo " LD $@"
|
echo " LD $@"
|
||||||
@ -246,9 +248,11 @@ libmbedx509.$(SOEXT_X509): $(OBJS_X509) libmbedcrypto.so
|
|||||||
echo " LD $@"
|
echo " LD $@"
|
||||||
$(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_X509) -L. -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS)
|
$(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_X509) -L. -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS)
|
||||||
|
|
||||||
|
ifneq ($(SOEXT_X509),so)
|
||||||
libmbedx509.so: libmbedx509.$(SOEXT_X509)
|
libmbedx509.so: libmbedx509.$(SOEXT_X509)
|
||||||
echo " LN $@ -> $<"
|
echo " LN $@ -> $<"
|
||||||
ln -sf $< $@
|
ln -sf $< $@
|
||||||
|
endif
|
||||||
|
|
||||||
libmbedx509.dylib: $(OBJS_X509) libmbedcrypto.dylib
|
libmbedx509.dylib: $(OBJS_X509) libmbedcrypto.dylib
|
||||||
echo " LD $@"
|
echo " LD $@"
|
||||||
@ -273,9 +277,11 @@ libmbedcrypto.$(SOEXT_CRYPTO): $(OBJS_CRYPTO)
|
|||||||
echo " LD $@"
|
echo " LD $@"
|
||||||
$(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_CRYPTO) $(LOCAL_LDFLAGS) $(LDFLAGS)
|
$(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS_CRYPTO) $(LOCAL_LDFLAGS) $(LDFLAGS)
|
||||||
|
|
||||||
|
ifneq ($(SOEXT_CRYPTO),so)
|
||||||
libmbedcrypto.so: libmbedcrypto.$(SOEXT_CRYPTO)
|
libmbedcrypto.so: libmbedcrypto.$(SOEXT_CRYPTO)
|
||||||
echo " LN $@ -> $<"
|
echo " LN $@ -> $<"
|
||||||
ln -sf $< $@
|
ln -sf $< $@
|
||||||
|
endif
|
||||||
|
|
||||||
libmbedcrypto.dylib: $(OBJS_CRYPTO)
|
libmbedcrypto.dylib: $(OBJS_CRYPTO)
|
||||||
echo " LD $@"
|
echo " LD $@"
|
||||||
|
@ -96,7 +96,7 @@ then
|
|||||||
mv tmp library/CMakeLists.txt
|
mv tmp library/CMakeLists.txt
|
||||||
|
|
||||||
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedcrypto in library/Makefile"
|
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedcrypto in library/Makefile"
|
||||||
sed -e "s/SOEXT_CRYPTO=so.[0-9]\{1,\}/SOEXT_CRYPTO=so.$SO_CRYPTO/g" < library/Makefile > tmp
|
sed -e "s/SOEXT_CRYPTO?=so.[0-9]\{1,\}/SOEXT_CRYPTO?=so.$SO_CRYPTO/g" < library/Makefile > tmp
|
||||||
mv tmp library/Makefile
|
mv tmp library/Makefile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ then
|
|||||||
mv tmp library/CMakeLists.txt
|
mv tmp library/CMakeLists.txt
|
||||||
|
|
||||||
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedx509 in library/Makefile"
|
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedx509 in library/Makefile"
|
||||||
sed -e "s/SOEXT_X509=so.[0-9]\{1,\}/SOEXT_X509=so.$SO_X509/g" < library/Makefile > tmp
|
sed -e "s/SOEXT_X509?=so.[0-9]\{1,\}/SOEXT_X509?=so.$SO_X509/g" < library/Makefile > tmp
|
||||||
mv tmp library/Makefile
|
mv tmp library/Makefile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ then
|
|||||||
mv tmp library/CMakeLists.txt
|
mv tmp library/CMakeLists.txt
|
||||||
|
|
||||||
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedtls in library/Makefile"
|
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedtls in library/Makefile"
|
||||||
sed -e "s/SOEXT_TLS=so.[0-9]\{1,\}/SOEXT_TLS=so.$SO_TLS/g" < library/Makefile > tmp
|
sed -e "s/SOEXT_TLS?=so.[0-9]\{1,\}/SOEXT_TLS?=so.$SO_TLS/g" < library/Makefile > tmp
|
||||||
mv tmp library/Makefile
|
mv tmp library/Makefile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user