add porting codes of rt-thread (#494)
This commit is contained in:
31
core/iwasm/aot/SConscript
Normal file
31
core/iwasm/aot/SConscript
Normal file
@ -0,0 +1,31 @@
|
||||
#
|
||||
# Copyright (c) 2021, RT-Thread Development Team
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
|
||||
from building import *
|
||||
import re
|
||||
Import('rtconfig')
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
src = Split('''
|
||||
aot_loader.c
|
||||
aot_runtime.c
|
||||
''')
|
||||
|
||||
if rtconfig.ARCH == 'arm':
|
||||
if re.match('^cortex-m.*', rtconfig.CPU):
|
||||
src += ['arch/aot_reloc_thumb.c']
|
||||
elif re.match('^cortex-a.*', rtconfig.CPU):
|
||||
src += ['arch/aot_reloc_arm.c']
|
||||
|
||||
|
||||
CPPPATH = [cwd, cwd + '/../include']
|
||||
|
||||
CPPDEFINES = ['WASM_ENABLE_AOT=1']
|
||||
|
||||
group = DefineGroup('iwasm_aot', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
26
core/iwasm/common/SConscript
Normal file
26
core/iwasm/common/SConscript
Normal file
@ -0,0 +1,26 @@
|
||||
#
|
||||
# Copyright (c) 2021, RT-Thread Development Team
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
|
||||
from building import *
|
||||
import re
|
||||
|
||||
Import('rtconfig')
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
src = Glob('*.c')
|
||||
|
||||
if rtconfig.ARCH == 'arm':
|
||||
if re.match('^cortex-m.*', rtconfig.CPU):
|
||||
src += ['arch/invokeNative_thumb.s']
|
||||
elif re.match('^cortex-a.*', rtconfig.CPU):
|
||||
src += ['arch/invokeNative_arm.s']
|
||||
|
||||
CPPPATH = [cwd, cwd + '/../include']
|
||||
|
||||
group = DefineGroup('iwasm_common', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
30
core/iwasm/interpreter/SConscript
Normal file
30
core/iwasm/interpreter/SConscript
Normal file
@ -0,0 +1,30 @@
|
||||
#
|
||||
# Copyright (c) 2021, RT-Thread Development Team
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
src = Split('''
|
||||
wasm_runtime.c
|
||||
''')
|
||||
|
||||
if GetDepend(['WAMR_BUILD_FAST_INTERP']):
|
||||
src += ["wasm_interp_fast.c"]
|
||||
else:
|
||||
src += ["wasm_interp_classic.c"]
|
||||
|
||||
if GetDepend(['WAMR_BUILD_MINI_LOADER']):
|
||||
src += ["wasm_mini_loader.c"]
|
||||
else:
|
||||
src += ["wasm_loader.c"]
|
||||
|
||||
|
||||
CPPPATH = [cwd]
|
||||
|
||||
group = DefineGroup('iwasm_interpreter', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
20
core/iwasm/libraries/lib-pthread/SConscript
Normal file
20
core/iwasm/libraries/lib-pthread/SConscript
Normal file
@ -0,0 +1,20 @@
|
||||
#
|
||||
# Copyright (c) 2021, RT-Thread Development Team
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
src = Split('''
|
||||
libc_pthread_wrapper.c
|
||||
''')
|
||||
|
||||
CPPPATH = [cwd]
|
||||
|
||||
|
||||
group = DefineGroup('iwasm_libc_pthread', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
24
core/iwasm/libraries/libc-builtin/SConscript
Normal file
24
core/iwasm/libraries/libc-builtin/SConscript
Normal file
@ -0,0 +1,24 @@
|
||||
#
|
||||
# Copyright (c) 2021, RT-Thread Development Team
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
#src = Split('''
|
||||
#libc_builtin_wrapper.c
|
||||
#''')
|
||||
|
||||
src = Glob('*.c')
|
||||
|
||||
CPPDEFINES = ['WASM_ENABLE_LIBC_BUILTIN=1']
|
||||
|
||||
CPPPATH = [cwd]
|
||||
|
||||
|
||||
group = DefineGroup('iwasm_libc_builtin', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
19
core/iwasm/libraries/libc-emcc/SConscript
Normal file
19
core/iwasm/libraries/libc-emcc/SConscript
Normal file
@ -0,0 +1,19 @@
|
||||
#
|
||||
# Copyright (c) 2021, RT-Thread Development Team
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
src = Split('''
|
||||
libc_emcc_wrapper.c
|
||||
''')
|
||||
|
||||
CPPPATH = [cwd]
|
||||
|
||||
group = DefineGroup('iwasm_libc_emcc', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
34
core/iwasm/libraries/libc-wasi/SConscript
Normal file
34
core/iwasm/libraries/libc-wasi/SConscript
Normal file
@ -0,0 +1,34 @@
|
||||
#
|
||||
# Copyright (c) 2021, RT-Thread Development Team
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
src = Split('''
|
||||
''')
|
||||
|
||||
CPPPATH = [cwd,
|
||||
cwd+'/sandboxed-system-primitives/include',
|
||||
cwd+'/sandboxed-system-primitives/src']
|
||||
|
||||
def addSrcFiles(arr, path):
|
||||
for f in os.listdir(path):
|
||||
fpath = os.path.join(path, f);
|
||||
if os.path.isfile(fpath):
|
||||
ext = os.path.splitext(fpath)[-1]
|
||||
if ext == '.c' or ext == '.cpp':
|
||||
arr += [fpath]
|
||||
elif os.path.isdir(fpath):
|
||||
addSrcFiles(arr, fpath)
|
||||
|
||||
|
||||
addSrcFiles(src, cwd)
|
||||
|
||||
group = DefineGroup('iwasm_libc_wasi', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
19
core/iwasm/libraries/thread-mgr/SConscript
Normal file
19
core/iwasm/libraries/thread-mgr/SConscript
Normal file
@ -0,0 +1,19 @@
|
||||
#
|
||||
# Copyright (c) 2021, RT-Thread Development Team
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
src = Split('''
|
||||
thread_manager.c
|
||||
''')
|
||||
|
||||
CPPPATH = [cwd]
|
||||
|
||||
group = DefineGroup('iwasm_lib_thread_mgr', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
Reference in New Issue
Block a user