Skip to content

Commit 51d5930

Browse files
authored
Merge pull request #5244 from mysterywolf/libccc
[libc][posix] move libc.c/.h to posix folder
2 parents 7bb5826 + 7b43cf9 commit 51d5930

File tree

18 files changed

+82
-302
lines changed

18 files changed

+82
-302
lines changed
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
from building import *
22
Import('rtconfig')
33

4-
src = Glob('*.c') + Glob('*.cpp')
5-
cwd = GetCurrentDir()
4+
src = Glob('*.c')
65
group = []
76

8-
CPPPATH = [cwd]
97
CPPDEFINES = ['RT_USING_ARM_LIBC']
108

11-
if GetDepend('RT_USING_MODULE') == False:
12-
SrcRemove(src, ['libc_syms.c'])
13-
149
if rtconfig.PLATFORM == 'armcc' or rtconfig.PLATFORM == 'armclang':
15-
group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'],
16-
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
10+
group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'], CPPDEFINES = CPPDEFINES)
1711

1812
Return('group')

components/libc/compilers/armlibc/libc.c

Lines changed: 0 additions & 35 deletions
This file was deleted.

components/libc/compilers/armlibc/stdio.c

Lines changed: 0 additions & 52 deletions
This file was deleted.

components/libc/compilers/armlibc/syscalls.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@
1414
* 2020-02-13 Meco Man re-implement exit() and abort()
1515
* 2020-02-14 Meco Man implement _sys_tmpnam()
1616
*/
17-
#include <string.h>
18-
#include <rt_sys.h>
1917

18+
#include <rt_sys.h>
2019
#include <rtthread.h>
21-
#include "libc.h"
22-
20+
#include <string.h>
2321
#include <fcntl.h>
2422
#include <unistd.h>
2523
#include <sys/stat.h>
24+
#ifdef RT_USING_POSIX
25+
#include "libc.h"
26+
#endif
2627

2728
#define DBG_TAG "armlibc.syscalls"
2829
#define DBG_LVL DBG_INFO

components/libc/compilers/common/SConscript

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ group = []
88
CPPPATH = [cwd]
99
CPPDEFINES = []
1010

11+
if rtconfig.CROSS_TOOL == 'keil':
12+
CPPDEFINES += ['__CLK_TCK=RT_TICK_PER_SECOND']
13+
1114
if GetDepend('RT_USING_LIBC'):
1215
src += Glob('*.c')
1316
elif GetDepend('RT_LIBC_USING_TIME'):
1417
src += ['time.c']
1518

16-
if rtconfig.CROSS_TOOL == 'keil':
17-
CPPDEFINES += ['__CLK_TCK=RT_TICK_PER_SECOND']
18-
1919
group = DefineGroup('libc', src, depend = [], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
2020

2121
list = os.listdir(cwd)
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
from building import *
2-
32
Import('rtconfig')
43

54
src = Glob('*.c')
6-
cwd = GetCurrentDir()
75
group = []
86

9-
CPPPATH = [cwd]
107
CPPDEFINES = ['RT_USING_DLIBC']
118

129
if rtconfig.PLATFORM == 'iar':
13-
1410
if GetDepend('RT_USING_POSIX'):
1511
from distutils.version import LooseVersion
1612
from iar import IARVersion
1713

1814
CPPDEFINES = CPPDEFINES + ['_DLIB_FILE_DESCRIPTOR']
19-
2015
if LooseVersion(IARVersion()) < LooseVersion("8.20.1"):
2116
CPPDEFINES = CPPDEFINES + ['_DLIB_THREAD_SUPPORT']
2217

23-
group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
18+
group = DefineGroup('libc', src, depend = ['RT_USING_LIBC'], CPPDEFINES = CPPDEFINES)
2419

2520
Return('group')

components/libc/compilers/dlib/libc.c

Lines changed: 0 additions & 35 deletions
This file was deleted.

components/libc/compilers/dlib/libc.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

components/libc/compilers/dlib/stdio.c

Lines changed: 0 additions & 49 deletions
This file was deleted.

components/libc/compilers/dlib/syscall_read.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
#include <rtthread.h>
1212
#include <yfuns.h>
1313
#include <unistd.h>
14+
#ifdef RT_USING_POSIX
1415
#include "libc.h"
16+
#endif
1517

1618
#define DBG_TAG "dlib.syscall_read"
1719
#define DBG_LVL DBG_INFO

0 commit comments

Comments
 (0)