Ensure crosscompiling with make works in Mac OS X

This commit is contained in:
Andres Amaya Garcia 2018-06-19 17:25:34 +01:00
parent 1d9375919a
commit c51d613eac

View File

@ -37,27 +37,29 @@ SOEXT_TLS=so.10
SOEXT_X509=so.0 SOEXT_X509=so.0
SOEXT_CRYPTO=so.2 SOEXT_CRYPTO=so.2
DLEXT ?= so
# Set AR_DASH= (empty string) to use an ar implentation that does not accept # Set AR_DASH= (empty string) to use an ar implentation that does not accept
# the - prefix for command line options (e.g. llvm-ar) # the - prefix for command line options (e.g. llvm-ar)
AR_DASH ?= - AR_DASH ?= -
ARFLAGS = $(AR_DASH)src
ifdef APPLE_BUILD ifdef APPLE_BUILD
ifneq ($(APPLE_BUILD),0)
ARFLAGS = $(AR_DASH)Src ARFLAGS = $(AR_DASH)Src
RLFLAGS = -no_warning_for_no_symbols -c RLFLAGS = -no_warning_for_no_symbols -c
RL ?= ranlib RL ?= ranlib
else endif
ARFLAGS = $(AR_DASH)src
endif endif
DLEXT ?= so
ifdef WINDOWS_BUILD ifdef WINDOWS_BUILD
# Windows shared library extension: # Windows shared library extension:
DLEXT = dll DLEXT = dll
else ifdef APPLE_BUILD else ifdef APPLE_BUILD
ifneq ($(APPLE_BUILD),0)
# Mac OS X shared library extension: # Mac OS X shared library extension:
DLEXT = dylib DLEXT = dylib
endif endif
endif
OBJS_CRYPTO= aes.o aesni.o arc4.o \ OBJS_CRYPTO= aes.o aesni.o arc4.o \
asn1parse.o asn1write.o base64.o \ asn1parse.o asn1write.o base64.o \
@ -109,9 +111,11 @@ libmbedtls.a: $(OBJS_TLS)
echo " AR $@" echo " AR $@"
$(AR) $(ARFLAGS) $@ $(OBJS_TLS) $(AR) $(ARFLAGS) $@ $(OBJS_TLS)
ifdef APPLE_BUILD ifdef APPLE_BUILD
ifneq ($(APPLE_BUILD),0)
echo " RL $@" echo " RL $@"
$(RL) $(RLFLAGS) $@ $(RL) $(RLFLAGS) $@
endif endif
endif
libmbedtls.$(SOEXT_TLS): $(OBJS_TLS) libmbedx509.so libmbedtls.$(SOEXT_TLS): $(OBJS_TLS) libmbedx509.so
echo " LD $@" echo " LD $@"
@ -134,9 +138,11 @@ libmbedx509.a: $(OBJS_X509)
echo " AR $@" echo " AR $@"
$(AR) $(ARFLAGS) $@ $(OBJS_X509) $(AR) $(ARFLAGS) $@ $(OBJS_X509)
ifdef APPLE_BUILD ifdef APPLE_BUILD
ifneq ($(APPLE_BUILD),0)
echo " RL $@" echo " RL $@"
$(RL) $(RLFLAGS) $@ $(RL) $(RLFLAGS) $@
endif endif
endif
libmbedx509.$(SOEXT_X509): $(OBJS_X509) libmbedcrypto.so libmbedx509.$(SOEXT_X509): $(OBJS_X509) libmbedcrypto.so
echo " LD $@" echo " LD $@"
@ -159,9 +165,11 @@ libmbedcrypto.a: $(OBJS_CRYPTO)
echo " AR $@" echo " AR $@"
$(AR) $(ARFLAGS) $@ $(OBJS_CRYPTO) $(AR) $(ARFLAGS) $@ $(OBJS_CRYPTO)
ifdef APPLE_BUILD ifdef APPLE_BUILD
ifneq ($(APPLE_BUILD),0)
echo " RL $@" echo " RL $@"
$(RL) $(RLFLAGS) $@ $(RL) $(RLFLAGS) $@
endif endif
endif
libmbedcrypto.$(SOEXT_CRYPTO): $(OBJS_CRYPTO) libmbedcrypto.$(SOEXT_CRYPTO): $(OBJS_CRYPTO)
echo " LD $@" echo " LD $@"