summaryrefslogtreecommitdiff
path: root/components/libc/compilers
diff options
context:
space:
mode:
authorbernard <[email protected]>2017-10-13 12:44:54 +0800
committerbernard <[email protected]>2017-10-13 12:44:54 +0800
commit8bdf993bfc38f9b652a7af60cb071c708ad7dea6 (patch)
treee9a17b508d1e348b4b5cfa0b18016a29514e3fc1 /components/libc/compilers
parent444915d1eac7eb1059a1a5b02eb8c0393ce4a79c (diff)
[libc] Build correct SConscript file.
Diffstat (limited to 'components/libc/compilers')
-rw-r--r--components/libc/compilers/SConscript15
-rw-r--r--components/libc/compilers/armlibc/SConscript11
-rw-r--r--components/libc/compilers/dlib/SConscript6
-rw-r--r--components/libc/compilers/minilibc/SConscript10
-rw-r--r--components/libc/compilers/newlib/SConscript9
5 files changed, 37 insertions, 14 deletions
diff --git a/components/libc/compilers/SConscript b/components/libc/compilers/SConscript
new file mode 100644
index 0000000000..4c815c49b8
--- /dev/null
+++ b/components/libc/compilers/SConscript
@@ -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')
diff --git a/components/libc/compilers/armlibc/SConscript b/components/libc/compilers/armlibc/SConscript
index 29f342a1c1..8968abaa82 100644
--- a/components/libc/compilers/armlibc/SConscript
+++ b/components/libc/compilers/armlibc/SConscript
@@ -1,12 +1,15 @@
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')
diff --git a/components/libc/compilers/dlib/SConscript b/components/libc/compilers/dlib/SConscript
index 44be106e03..8ae7484894 100644
--- a/components/libc/compilers/dlib/SConscript
+++ b/components/libc/compilers/dlib/SConscript
@@ -1,8 +1,8 @@
from building import *
-import rtconfig
+Import('rtconfig')
-src = Glob('*.c')
-cwd = GetCurrentDir()
+src = Glob('*.c')
+cwd = GetCurrentDir()
group = []
CPPPATH = [cwd]
diff --git a/components/libc/compilers/minilibc/SConscript b/components/libc/compilers/minilibc/SConscript
index b0c82a7125..da68881349 100644
--- a/components/libc/compilers/minilibc/SConscript
+++ b/components/libc/compilers/minilibc/SConscript
@@ -1,13 +1,15 @@
-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')
diff --git a/components/libc/compilers/newlib/SConscript b/components/libc/compilers/newlib/SConscript
index 574c2a8d1f..06e5faad09 100644
--- a/components/libc/compilers/newlib/SConscript
+++ b/components/libc/compilers/newlib/SConscript
@@ -1,7 +1,9 @@
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')