diff --git a/ChangeLog b/ChangeLog index 45e4b85bbc..dd04b1d639 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,11 @@ Changes * Improve the documentation of mbedtls_net_accept(). Contributed by Ivan Krylov. * Improve the documentation of mbedtls_ssl_write(). Suggested by Paul Sokolovsky in #1356. + * Add an option in the makefile to support ar utilities where the operation + letter must not be prefixed by '-', such as LLVM. Found and fixed by + Alex Hixon. + * Allow configuring the shared library extension by setting the DLEXT + environment variable when using the project makefiles. = mbed TLS 2.1.11 branch released 2018-03-16 diff --git a/library/Makefile b/library/Makefile index 8e651f54e4..9e2d7d6a74 100644 --- a/library/Makefile +++ b/library/Makefile @@ -35,9 +35,12 @@ SOEXT_TLS=so.10 SOEXT_X509=so.0 SOEXT_CRYPTO=so.0 -DLEXT=so -# OSX shared library extension: -# DLEXT=dylib +# Set DLEXT=dylib to compile as a shared library for Mac OS X +DLEXT ?= so + +# Set AR_DASH= (empty string) to use an ar implentation that does not accept +# the - prefix for command line options (e.g. llvm-ar) +AR_DASH ?= - # Windows shared library extension: ifdef WINDOWS_BUILD @@ -89,9 +92,9 @@ shared: libmbedcrypto.$(DLEXT) libmbedx509.$(DLEXT) libmbedtls.$(DLEXT) # tls libmbedtls.a: $(OBJS_TLS) echo " AR $@" - $(AR) -rc $@ $(OBJS_TLS) + $(AR) $(AR_DASH)rc $@ $(OBJS_TLS) echo " RL $@" - $(AR) -s $@ + $(AR) $(AR_DASH)s $@ libmbedtls.$(SOEXT_TLS): $(OBJS_TLS) libmbedx509.so echo " LD $@" @@ -112,9 +115,9 @@ libmbedtls.dll: $(OBJS_TLS) libmbedx509.dll # x509 libmbedx509.a: $(OBJS_X509) echo " AR $@" - $(AR) -rc $@ $(OBJS_X509) + $(AR) $(AR_DASH)rc $@ $(OBJS_X509) echo " RL $@" - $(AR) -s $@ + $(AR) $(AR_DASH)s $@ libmbedx509.$(SOEXT_X509): $(OBJS_X509) libmbedcrypto.so echo " LD $@" @@ -135,9 +138,9 @@ libmbedx509.dll: $(OBJS_X509) libmbedcrypto.dll # crypto libmbedcrypto.a: $(OBJS_CRYPTO) echo " AR $@" - $(AR) -rc $@ $(OBJS_CRYPTO) + $(AR) $(AR_DASH)rc $@ $(OBJS_CRYPTO) echo " RL $@" - $(AR) -s $@ + $(AR) $(AR_DASH)s $@ libmbedcrypto.$(SOEXT_CRYPTO): $(OBJS_CRYPTO) echo " LD $@" diff --git a/programs/Makefile b/programs/Makefile index 544a2d8f99..db85eee0bf 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -35,7 +35,7 @@ ifdef SHARED SHARED_SUFFIX=.$(DLEXT) endif else -DLEXT=so +DLEXT ?= so EXEXT= SHARED_SUFFIX= endif diff --git a/tests/Makefile b/tests/Makefile index e97887ae16..40e65fab09 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -35,7 +35,7 @@ ifdef SHARED SHARED_SUFFIX=.$(DLEXT) endif else -DLEXT=so +DLEXT ?= so EXEXT= SHARED_SUFFIX= endif diff --git a/tests/scripts/run-test-suites.pl b/tests/scripts/run-test-suites.pl index b91355d303..5b55faccd4 100644 --- a/tests/scripts/run-test-suites.pl +++ b/tests/scripts/run-test-suites.pl @@ -11,6 +11,7 @@ die "$0: no test suite found\n" unless @suites; # in case test suites are linked dynamically $ENV{'LD_LIBRARY_PATH'} = '../library'; +$ENV{'DYLD_LIBRARY_PATH'} = '../library'; my $prefix = $^O eq "MSWin32" ? '' : './';