summaryrefslogtreecommitdiff
path: root/components/libc/newlib
diff options
context:
space:
mode:
authorArda <[email protected]>2014-11-24 11:57:31 +0800
committerArda <[email protected]>2014-11-24 11:57:31 +0800
commit143d3b82244b977735649e7d7c201d2affe67460 (patch)
tree61503d3a150cef8d8184c858efc139b146b50cf6 /components/libc/newlib
parentbc2a890ab08d163ccea323f7e719c4fdf53050cd (diff)
parent9ecd18411fc1344e3d080d844b60c7070c3fb4d8 (diff)
Merge pull request #2 from RT-Thread/master
update from official source
Diffstat (limited to 'components/libc/newlib')
-rw-r--r--components/libc/newlib/SConscript15
-rw-r--r--components/libc/newlib/syscalls.c8
2 files changed, 13 insertions, 10 deletions
diff --git a/components/libc/newlib/SConscript b/components/libc/newlib/SConscript
index ae8e8756e1..574c2a8d1f 100644
--- a/components/libc/newlib/SConscript
+++ b/components/libc/newlib/SConscript
@@ -1,15 +1,10 @@
-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
@@ -17,7 +12,7 @@ CPPPATH = [cwd]
# 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')
diff --git a/components/libc/newlib/syscalls.c b/components/libc/newlib/syscalls.c
index 5b829f4753..388d240c94 100644
--- a/components/libc/newlib/syscalls.c
+++ b/components/libc/newlib/syscalls.c
@@ -3,6 +3,14 @@
#include <sys/time.h>
#include <rtthread.h>
+#ifdef RT_USING_DFS
+#include <dfs_posix.h>
+#endif
+
+#ifdef RT_USING_PTHREADS
+#include <pthread.h>
+#endif
+
/* Reentrant versions of system calls. */
int