Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bsp/at91sam9260/rtconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

/* SECTION: the runtime libc library */
/* the runtime libc library */
#define RT_USING_NEWLIB
#define RT_USING_LIBC
#define RT_USING_PTHREADS

/* Using Module System */
Expand Down
4 changes: 2 additions & 2 deletions bsp/mini2440/rtconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
// </section>

// <section name="LIBC" description="C Runtime library setting" default="always" >
// <bool name="RT_USING_NEWLIB" description="Using newlib library, only available under GNU GCC" default="true" />
#define RT_USING_NEWLIB
// <bool name="RT_USING_LIBC" description="Using C library" default="true" />
#define RT_USING_LIBC
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
#define RT_USING_PTHREADS
// </section>
Expand Down
15 changes: 1 addition & 14 deletions bsp/stm32f0x/rtconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,7 @@
#define FINSH_USING_DESCRIPTION

/* SECTION: libc management */
#ifdef __CC_ARM
/* #define RT_USING_MINILIBC */
/* #define RT_USING_NEWLIB */
#endif

#ifdef __ICCARM__
/* #define RT_USING_MINILIBC */
/* #define RT_USING_NEWLIB */
#endif

#ifdef __GNUC__
/* #define RT_USING_MINILIBC */
#define RT_USING_NEWLIB
#endif
#define RT_USING_LIBC

/* SECTION: device filesystem */
/* #define RT_USING_DFS */
Expand Down
4 changes: 2 additions & 2 deletions bsp/zynq7000/rtconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
// </section>

// <section name="LIBC" description="C Runtime library setting" default="always" >
// <bool name="RT_USING_NEWLIB" description="Using newlib library, only available under GNU GCC" default="true" />
#define RT_USING_NEWLIB
// <bool name="RT_USING_LIBC" description="Using C library" default="true" />
#define RT_USING_LIBC
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
#define RT_USING_PTHREADS
// </section>
Expand Down
17 changes: 11 additions & 6 deletions components/libc/SConscript
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# for libc component
import os
Import('RTT_ROOT')
Import('rtconfig')

from building import *

objs = []
list = os.listdir(os.path.join(RTT_ROOT, 'components', 'libc'))

for d in list:
path = os.path.join(RTT_ROOT, 'components', 'libc', d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
if GetDepend('RT_USING_LIBC'):
if rtconfig.PLATFORM == 'gcc':
objs = objs + SConscript('newlib/SConscript')
elif rtconfig.PLATFORM == 'armcc':
objs = objs + SConscript('armlibc/SConscript')
else:
if rtconfig.PLATFORM == 'gcc':
objs = objs + SConscript('minilibc/SConscript')

Return('objs')
14 changes: 5 additions & 9 deletions components/libc/armlibc/SConscript
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
Import('rtconfig')
from building import *

if GetDepend('RT_USING_ARM_LIBC') and rtconfig.CROSS_TOOL != 'keil':
print '================ERROR=============================='
print 'Please use ARM CC compiler if using ARM C library'
print '==================================================='
exit(0)

cwd = GetCurrentDir()
src = Glob('*.c')
cwd = GetCurrentDir()

CPPPATH = [cwd]
CPPDEFINES = ['RT_USING_ARM_LIBC']

group = DefineGroup('libc', src, depend = ['RT_USING_ARM_LIBC'], CPPPATH = CPPPATH)
group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)

Return('group')
12 changes: 6 additions & 6 deletions components/libc/minilibc/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ Import('RTT_ROOT')
from building import *

src = Glob('*.c')
CPPPATH = [RTT_ROOT + '/components/libc/minilibc']
cwd = GetCurrentDir()

CPPPATH = [cwd]
CPPDEFINES = ['RT_USING_MINILIBC']
group = DefineGroup('minilibc', src,
depend = ['RT_USING_MINILIBC'],
CPPPATH = CPPPATH,
CPPDEFINES = CPPDEFINES
)

group = DefineGroup('libc', src, depend = ['RT_USING_MINILIBC'],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)

Return('group')
15 changes: 5 additions & 10 deletions components/libc/newlib/SConscript
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
Import('rtconfig')
from building import *

if GetDepend('RT_USING_NEWLIB') and rtconfig.CROSS_TOOL != 'gcc':
print '================ERROR============================'
print 'Please use GNU GCC compiler if using newlib'
print '================================================='
exit(0)

src = Glob('*.c')
cwd = GetCurrentDir()
src = Glob('*.c')

CPPPATH = [cwd]
CPPDEFINES = ['RT_USING_NEWLIB']

# link with libc and libm:
# libm is a frequently used lib. Newlib is compiled with -ffunction-sections in
# recent GCC tool chains. The linker would just link in the functions that have
# been referenced. So setting this won't result in bigger text size.
LIBS = ['c', 'm']

group = DefineGroup('newlib', src, depend = ['RT_USING_NEWLIB'],
CPPPATH = CPPPATH, LIBS = LIBS)
group = DefineGroup('newlib', src, depend = ['RT_USING_LIBC'],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)

Return('group')