Skip to content

Commit 20283ae

Browse files
committed
extmod/modussl_axtls: Further changes to allow alternative SSL modules.
Make variable MICROPY_SSL_AXTLS=1 should be defined to activate modussl_axtls and link with -laxtls.
1 parent e32d1e1 commit 20283ae

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

extmod/modussl_axtls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "py/runtime.h"
3333
#include "py/stream.h"
3434

35-
#if MICROPY_PY_USSL
35+
#if MICROPY_PY_USSL && MICROPY_SSL_AXTLS
3636

3737
#include "ssl.h"
3838

py/py.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ INC += -I../lib
2020
INC += -I../lib/netutils
2121

2222
ifeq ($(MICROPY_PY_USSL),1)
23-
CFLAGS_MOD += -DMICROPY_PY_USSL=1 -I../lib/axtls/ssl -I../lib/axtls/crypto -I../lib/axtls/config
23+
CFLAGS_MOD += -DMICROPY_PY_USSL=1
24+
ifeq ($(MICROPY_SSL_AXTLS),1)
25+
CFLAGS_MOD += -DMICROPY_SSL_AXTLS=1 -I../lib/axtls/ssl -I../lib/axtls/crypto -I../lib/axtls/config
2426
LDFLAGS_MOD += -L../lib/axtls/_stage -laxtls
2527
endif
28+
endif
2629

2730
#ifeq ($(MICROPY_PY_LWIP),1)
2831
#CFLAGS_MOD += -DMICROPY_PY_LWIP=1 -I../lib/lwip/src/include -I../lib/lwip/src/include/ipv4 -I../extmod/lwip-include

unix/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
#define MICROPY_PY_URE (1)
112112
#define MICROPY_PY_UHEAPQ (1)
113113
#define MICROPY_PY_UHASHLIB (1)
114-
#if MICROPY_PY_USSL
114+
#if MICROPY_PY_USSL && MICROPY_SSL_AXTLS
115115
#define MICROPY_PY_UHASHLIB_SHA1 (1)
116116
#endif
117117
#define MICROPY_PY_UBINASCII (1)

unix/mpconfigport.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ MICROPY_PY_FFI = 1
2828

2929
# ussl module requires axtls
3030
MICROPY_PY_USSL = 1
31+
MICROPY_SSL_AXTLS = 1
3132

3233
# jni module requires JVM/JNI
3334
MICROPY_PY_JNI = 0

0 commit comments

Comments
 (0)