[libc] Build correct SConscript file.
This commit is contained in:
parent
444915d1ea
commit
8bdf993bfc
@ -1,11 +1,27 @@
|
|||||||
menu "libc"
|
menu "libc"
|
||||||
|
|
||||||
config RT_USING_LIBC
|
config RT_USING_LIBC
|
||||||
bool "Enable libc APIs from toolchain"
|
bool "Enable libc APIs from toolchain"
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config RT_USING_PTHREADS
|
config RT_USING_PTHREADS
|
||||||
bool "Enable pthreads APIs"
|
bool "Enable pthreads APIs"
|
||||||
default y
|
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
|
endmenu
|
||||||
|
@ -1,27 +1,15 @@
|
|||||||
# for libc component
|
# RT-Thread building script for bridge
|
||||||
import os
|
|
||||||
Import('rtconfig')
|
|
||||||
|
|
||||||
|
import os
|
||||||
from building import *
|
from building import *
|
||||||
|
|
||||||
|
cwd = GetCurrentDir()
|
||||||
objs = []
|
objs = []
|
||||||
cwd = GetCurrentDir()
|
list = os.listdir(cwd)
|
||||||
|
|
||||||
if GetDepend('RT_USING_LIBC'):
|
for d in list:
|
||||||
if os.path.isfile(os.path.join(cwd, 'newlib/SConscript')) and rtconfig.PLATFORM == 'gcc':
|
path = os.path.join(cwd, d)
|
||||||
objs = objs + SConscript('newlib/SConscript')
|
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||||
elif os.path.isfile(os.path.join(cwd, 'armlibc/SConscript')) and rtconfig.PLATFORM == 'armcc':
|
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
||||||
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')
|
|
||||||
|
|
||||||
if GetDepend('RT_USING_MODULE') and GetDepend('RT_USING_LIBDL'):
|
|
||||||
objs = objs + SConscript('libdl/SConscript')
|
|
||||||
|
|
||||||
Return('objs')
|
Return('objs')
|
||||||
|
15
components/libc/compilers/SConscript
Normal file
15
components/libc/compilers/SConscript
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# 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')
|
@ -1,12 +1,15 @@
|
|||||||
from building import *
|
from building import *
|
||||||
|
Import('rtconfig')
|
||||||
|
|
||||||
src = Glob('*.c')
|
src = Glob('*.c') + Glob('*.cpp')
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
|
group = []
|
||||||
|
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
CPPDEFINES = ['RT_USING_ARM_LIBC']
|
CPPDEFINES = ['RT_USING_ARM_LIBC']
|
||||||
|
|
||||||
group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'],
|
if rtconfig.PLATFORM == 'armcc':
|
||||||
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'],
|
||||||
|
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
from building import *
|
from building import *
|
||||||
import rtconfig
|
Import('rtconfig')
|
||||||
|
|
||||||
src = Glob('*.c')
|
src = Glob('*.c')
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
group = []
|
group = []
|
||||||
|
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
Import('RTT_ROOT')
|
|
||||||
from building import *
|
from building import *
|
||||||
|
Import('rtconfig')
|
||||||
|
|
||||||
src = Glob('*.c')
|
src = Glob('*.c') + Glob('*.cpp')
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
|
group = []
|
||||||
|
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
CPPDEFINES = ['RT_USING_MINILIBC']
|
CPPDEFINES = ['RT_USING_MINILIBC']
|
||||||
|
|
||||||
group = DefineGroup('libc', src, depend = ['RT_USING_MINILIBC'],
|
if rtconfig.PLATFORM == 'gcc' and not GetDepend('RT_USING_LIBC'):
|
||||||
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
group = DefineGroup('libc', src, depend = [''],
|
||||||
|
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
from building import *
|
from building import *
|
||||||
|
Import('rtconfig')
|
||||||
|
|
||||||
src = Glob('*.c')
|
src = Glob('*.c')
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
|
group = []
|
||||||
|
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
CPPDEFINES = ['RT_USING_NEWLIB']
|
CPPDEFINES = ['RT_USING_NEWLIB']
|
||||||
@ -12,7 +14,8 @@ CPPDEFINES = ['RT_USING_NEWLIB']
|
|||||||
# been referenced. So setting this won't result in bigger text size.
|
# been referenced. So setting this won't result in bigger text size.
|
||||||
LIBS = ['c', 'm']
|
LIBS = ['c', 'm']
|
||||||
|
|
||||||
group = DefineGroup('newlib', src, depend = ['RT_USING_LIBC'],
|
if rtconfig.PLATFORM == 'gcc':
|
||||||
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
|
group = DefineGroup('newlib', src, depend = ['RT_USING_LIBC'],
|
||||||
|
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
from building import *
|
from building import *
|
||||||
|
Import('rtconfig')
|
||||||
|
|
||||||
src = Glob('*.c')
|
src = Glob('*.c') + Glob('*.cpp')
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
|
group = []
|
||||||
CPPPATH = [cwd]
|
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')
|
Return('group')
|
||||||
|
@ -4,6 +4,7 @@ cwd = GetCurrentDir()
|
|||||||
src = Glob('*.c')
|
src = Glob('*.c')
|
||||||
CPPPATH = [cwd]
|
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')
|
Return('group')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user