Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite3aebc3

Browse files
committed
trying to fix macOS port with mbedtls
1 parent232daff commite3aebc3

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

‎builder/macOS.py‎

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@
1515
from .importunix
1616
from .importspawn
1717

18-
unix.unix_cmd= [
19-
'make',
20-
'',
21-
'',
22-
'-C',
23-
]
18+
from .importread_file,write_file
19+
2420

2521
unix.REAL_PORT='macOS'
2622

@@ -33,8 +29,6 @@ def parse_args(extra_args, lv_cflags, board):
3329

3430

3531
defbuild_commands(not_sure,extra_args,script_dir,lv_cflags,board):
36-
37-
3832
return_build_commands(not_sure,extra_args,script_dir,lv_cflags,board)
3933

4034

@@ -98,6 +92,9 @@ def is_homebrew_arm(cmd):
9892
returnFalse,cmd[0][0]
9993

10094

95+
EXTMOD_MK_PATH='lib/micropython/extmod/extmod.mk'
96+
97+
10198
defsubmodules():
10299
is_arm,brew_path=is_homebrew_arm([['brew','config']])
103100

@@ -150,8 +147,35 @@ def submodules():
150147
ifreturn_code!=0:
151148
sys.exit(return_code)
152149

150+
mbedtls=os.path.abspath('lib/micropython/lib/mbedtls/README.md')
151+
152+
ifnotos.path.exists(mbedtls):
153+
return_code,_=unix.spawn(unix.submodules_cmd)
154+
155+
ifreturn_code!=0:
156+
sys.exit(return_code)
153157

154158
defcompile(*args):# NOQA
159+
data=read_file('macOS',EXTMOD_MK_PATH)
160+
data=data.replace(
161+
'CFLAGS_EXTMOD += -DMICROPY_SSL_MBEDTLS=1 -I$(TOP)/$(MBEDTLS_DIR)/include',
162+
'CFLAGS_EXTMOD += -DMICROPY_SSL_MBEDTLS=1'
163+
)
164+
code= [
165+
'SRC_THIRDPARTY_C += lib/mbedtls_errors/mp_mbedtls_errors.c',
166+
'SRC_THIRDPARTY_C += $(wildcard\\',
167+
' $(MBEDTLS_DIR)/include/*/*.h\\',
168+
' $(MBEDTLS_DIR)/library/*.h\\',
169+
')'
170+
]
171+
172+
data=data.replace(
173+
'SRC_THIRDPARTY_C += lib/mbedtls_errors/mp_mbedtls_errors.c',
174+
'\n'.join(code)
175+
)
176+
177+
write_file(EXTMOD_MK_PATH,data)
178+
155179
_compile(*args)
156180

157181

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp