Skip to content

Commit 62cba1c

Browse files
committed
extmod.mk: Allow prebuilt MBEDTLS.
Some systems might have MBEDTLS ported, this allows using that instead of submodule. Signed-off-by: Yanfeng Liu <[email protected]>
1 parent 2762fe6 commit 62cba1c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

extmod/extmod.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,11 @@ SRC_THIRDPARTY_C += $(addprefix $(AXTLS_DIR)/,\
242242
crypto/sha1.c \
243243
)
244244
else ifeq ($(MICROPY_SSL_MBEDTLS),1)
245+
ifeq (${MBEDTLS_PREBUILT},1) # Use prebuilt mbedtls
246+
MBEDTLS_CONFIG_FILE ?= \"mbedtls/mbedtls_config_port.h\"
247+
CFLAGS_EXTMOD += -DMICROPY_SSL_MBEDTLS=1
248+
CFLAGS_EXTMOD += -DMBEDTLS_CONFIG_FILE=$(MBEDTLS_CONFIG_FILE)
249+
else # Use mbedtls submodule
245250
MBEDTLS_DIR = lib/mbedtls
246251
MBEDTLS_CONFIG_FILE ?= \"mbedtls/mbedtls_config_port.h\"
247252
GIT_SUBMODULES += $(MBEDTLS_DIR)
@@ -329,6 +334,7 @@ SRC_THIRDPARTY_C += $(addprefix $(MBEDTLS_DIR)/library/,\
329334
)
330335
endif
331336
endif
337+
endif
332338

333339
################################################################################
334340
# lwip

0 commit comments

Comments
 (0)