提交 8bdf993b 编写于 作者: B bernard

[libc] Build correct SConscript file.

上级 444915d1
menu "libc"
config RT_USING_LIBC
bool "Enable libc APIs from toolchain"
default y
bool "Enable libc APIs from toolchain"
default y
config RT_USING_PTHREADS
bool "Enable pthreads APIs"
default y
bool "Enable pthreads APIs"
default n
if RT_USING_LIBC
config RT_USING_POSIX_STDIN
bool "Enable stdin"
select RT_USING_DFS
select RT_USING_DFS_DEVFS
default y
config RT_USING_POSIX_MMAP
bool "Enable mmap() api"
default n
config RT_USING_POSIX_TERMIOS
bool "Enable termios feature"
default n
endif
endmenu
# for libc component
import os
Import('rtconfig')
# RT-Thread building script for bridge
import os
from building import *
cwd = GetCurrentDir()
objs = []
cwd = GetCurrentDir()
if GetDepend('RT_USING_LIBC'):
if os.path.isfile(os.path.join(cwd, 'newlib/SConscript')) and rtconfig.PLATFORM == 'gcc':
objs = objs + SConscript('newlib/SConscript')
elif os.path.isfile(os.path.join(cwd, 'armlibc/SConscript')) and rtconfig.PLATFORM == 'armcc':
objs = objs + SConscript('armlibc/SConscript')
elif os.path.isfile(os.path.join(cwd, 'dlib/SConscript')) and rtconfig.PLATFORM == 'iar':
objs = objs + SConscript('dlib/SConscript')
else:
if os.path.isfile(os.path.join(cwd, 'minilibc/SConscript')) and rtconfig.PLATFORM == 'gcc' and rtconfig.ARCH != 'sim':
objs = objs + SConscript('minilibc/SConscript')
if GetDepend('RT_USING_LIBC') and GetDepend('RT_USING_PTHREADS'):
objs = objs + SConscript('pthreads/SConscript')
list = os.listdir(cwd)
if GetDepend('RT_USING_MODULE') and GetDepend('RT_USING_LIBDL'):
objs = objs + SConscript('libdl/SConscript')
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
Return('objs')
# RT-Thread building script for bridge
import os
from building import *
cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
Return('objs')
from building import *
Import('rtconfig')
src = Glob('*.c')
cwd = GetCurrentDir()
src = Glob('*.c') + Glob('*.cpp')
cwd = GetCurrentDir()
group = []
CPPPATH = [cwd]
CPPDEFINES = ['RT_USING_ARM_LIBC']
group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
if rtconfig.PLATFORM == 'armcc':
group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
Return('group')
from building import *
import rtconfig
Import('rtconfig')
src = Glob('*.c')
cwd = GetCurrentDir()
src = Glob('*.c')
cwd = GetCurrentDir()
group = []
CPPPATH = [cwd]
......
Import('RTT_ROOT')
from building import *
Import('rtconfig')
src = Glob('*.c')
src = Glob('*.c') + Glob('*.cpp')
cwd = GetCurrentDir()
group = []
CPPPATH = [cwd]
CPPDEFINES = ['RT_USING_MINILIBC']
group = DefineGroup('libc', src, depend = ['RT_USING_MINILIBC'],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
if rtconfig.PLATFORM == 'gcc' and not GetDepend('RT_USING_LIBC'):
group = DefineGroup('libc', src, depend = [''],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
Return('group')
from building import *
Import('rtconfig')
src = Glob('*.c')
src = Glob('*.c')
cwd = GetCurrentDir()
group = []
CPPPATH = [cwd]
CPPDEFINES = ['RT_USING_NEWLIB']
......@@ -12,7 +14,8 @@ CPPDEFINES = ['RT_USING_NEWLIB']
# been referenced. So setting this won't result in bigger text size.
LIBS = ['c', 'm']
group = DefineGroup('newlib', src, depend = ['RT_USING_LIBC'],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
if rtconfig.PLATFORM == 'gcc':
group = DefineGroup('newlib', src, depend = ['RT_USING_LIBC'],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
Return('group')
from building import *
Import('rtconfig')
src = Glob('*.c')
src = Glob('*.c') + Glob('*.cpp')
cwd = GetCurrentDir()
group = []
CPPPATH = [cwd]
group = DefineGroup('libdl', src, depend = ['RT_USING_MODULE', 'RT_USING_LIBDL'], CPPPATH = CPPPATH)
if rtconfig.PLATFORM == 'gcc':
group = DefineGroup('libc', src,
depend = ['RT_USING_MODULE', 'RT_USING_LIBDL'],
CPPPATH = CPPPATH)
Return('group')
......@@ -4,6 +4,7 @@ cwd = GetCurrentDir()
src = Glob('*.c')
CPPPATH = [cwd]
group = DefineGroup('pthreads', src, depend = ['RT_USING_PTHREADS', 'RT_USING_LIBC'], CPPPATH = CPPPATH)
group = DefineGroup('pthreads', src,
depend = ['RT_USING_PTHREADS', 'RT_USING_LIBC'], CPPPATH = CPPPATH)
Return('group')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册