未验证 提交 055267f0 编写于 作者: mysterywolf's avatar mysterywolf 提交者: GitHub

[compiler] 增加SConscript依赖标志 AddDepend (#6534)

* [compiler] 增加SConscript依赖标志 AddDepend

* RT_USING_NEWLIB->RT_USING_NEWLIBC RT_USING_ARM_LIBC->RT_USING_ARMLIBC

* 删除过时的板载测试例程

* [gd32] 移除无用的反汇编文件

* [bsp]移除老旧bsp中对RT_USING_NEWLIBC的手动宏定义
上级 7bc744da
......@@ -26,14 +26,5 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT)
if GetDepend('RT_USING_WEBSERVER'):
objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
if GetDepend('RT_USING_RTGUI'):
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
# libc testsuite
#objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
# make a building
DoBuilding(TARGET, objs)
......@@ -26,14 +26,5 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT)
if GetDepend('RT_USING_WEBSERVER'):
objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
if GetDepend('RT_USING_RTGUI'):
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
# libc testsuite
objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
# make a building
DoBuilding(TARGET, objs)
......@@ -27,14 +27,5 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT)
if GetDepend('RT_USING_WEBSERVER'):
objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
if GetDepend('RT_USING_RTGUI'):
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
# libc testsuite
objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
# make a building
DoBuilding(TARGET, objs)
......@@ -85,7 +85,7 @@
/* SECTION: a runtime libc library */
/* a runtime libc library */
//#define RT_USING_NEWLIB
//#define RT_USING_NEWLIBC
//#define RT_USING_PTHREADS
/* SECTION: C++ support */
......@@ -232,7 +232,7 @@
* Note on FTK:
*
* FTK depends :
* #define RT_USING_NEWLIB
* #define RT_USING_NEWLIBC
* #define DFS_USING_WORKDIR
*
* And the maximal length must great than 64
......
......@@ -14,7 +14,7 @@
#define HAVE_SIGVAL
#define HAVE_SIGEVENT
#define HAVE_SIGINFO
#define RT_USING_NEWLIB
#define RT_USING_NEWLIBC
#define CY_USING_HAL
#define CY_APPNAME_mtb_example_psoc6_rtthread
#define CY_TARGET_DEVICE CY8C624ABZI_S2D44
......
......@@ -98,7 +98,7 @@ INCLUDES=$(RTT_ROOT_DIR)/include/ \
$(RTT_ROOT_DIR)/components/drivers/include/
# Add additional defines to the build process (without a leading -D).
DEFINES=HAVE_SIGVAL HAVE_SIGEVENT HAVE_SIGINFO RT_USING_NEWLIB
DEFINES=HAVE_SIGVAL HAVE_SIGEVENT HAVE_SIGINFO RT_USING_NEWLIBC
# Select softfp or hardfp floating point. Default is softfp.
VFP_SELECT=hardfp
......
......@@ -209,7 +209,6 @@
#endif
/* SECTION: Runtime library */
// #define RT_USING_NEWLIB
#define RT_LIBC_USING_TIME
/* SECTION: Console options */
......@@ -265,7 +264,7 @@
#endif
/* SECTION: device filesystem */
#if (defined(RT_USING_NEWLIB) || defined(EFM32_USING_SPISD))
#ifdef EFM32_USING_SPISD
#define RT_USING_DFS
/* the max number of mounted filesystem */
#define DFS_FILESYSTEMS_MAX (2)
......@@ -273,14 +272,12 @@
#define DFS_FD_MAX (4)
/* the max number of cached sector */
#define DFS_CACHE_MAX_NUM (4)
#endif /* defined(RT_USING_NEWLIB) || defined(EFM32_USING_SPISD) */
#endif /* EFM32_USING_SPISD */
#if defined(EFM32_USING_SPISD)
#define RT_USING_DFS_ELMFAT
#define DFS_ELMFAT_INTERFACE_EFM
#endif /* defined(EFM32_USING_SPISD) */
#if defined(RT_USING_NEWLIB)
#define RT_USING_DFS_DEVFS
#endif /* defined(RT_USING_NEWLIB) */
/* SECTION: lwip, a lighwight TCP/IP protocol stack */
#if defined(EFM32_USING_ETHERNET)
......
......@@ -133,9 +133,6 @@
#define FINSH_THREAD_STACK_SIZE 4096
// </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_PTHREADS" description="Using POSIX threads library" default="true" />
// #define RT_USING_PTHREADS
// </section>
......
......@@ -8,7 +8,7 @@
#define D45
#define HAVE_CCONFIG_H
#define HPM6750
#define RT_USING_NEWLIB
#define RT_USING_NEWLIBC
#define _POSIX_C_SOURCE 1
#define _REENT_SMALL
#define __RTTHREAD__
......
......@@ -8,7 +8,7 @@
#define D45
#define HAVE_CCONFIG_H
#define HPM6750
#define RT_USING_NEWLIB
#define RT_USING_NEWLIBC
#define _POSIX_C_SOURCE 1
#define _REENT_SMALL
#define __RTTHREAD__
......
......@@ -26,9 +26,6 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT)
if GetDepend('RT_USING_RTGUI'):
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
# make a building
DoBuilding(TARGET, objs)
......@@ -40,8 +40,5 @@ if GetDepend('RT_USING_FPU'):
env['CXXFLAGS'] = env['CXXFLAGS'].replace('-msoft-float', '-mhard-float')
env['LINKFLAGS'] = env['LINKFLAGS'].replace('-msoft-float', '-mhard-float')
if GetDepend('RT_USING_RTGUI'):
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
# make a building
DoBuilding(TARGET, objs)
......@@ -88,8 +88,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_NEWLIBC" description="Using newlib library, only available under GNU GCC" default="true" />
// #define RT_USING_NEWLIBC
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
// #define RT_USING_PTHREADS
// </section>
......
......@@ -116,9 +116,6 @@
//#define FINSH_USING_MSH
// </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_PTHREADS" description="Using POSIX threads library" default="true" />
//#define RT_USING_PTHREADS
// </section>
......
......@@ -115,9 +115,6 @@
//#define FINSH_USING_MSH
// </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_PTHREADS" description="Using POSIX threads library" default="true" />
//#define RT_USING_PTHREADS
// </section>
......
......@@ -90,9 +90,6 @@
#define FINSH_THREAD_STACK_SIZE 4096
// </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_PTHREADS" description="Using POSIX threads library" default="true" />
// #define RT_USING_PTHREADS
// </section>
......
......@@ -31,14 +31,5 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT)
if GetDepend('RT_USING_WEBSERVER'):
objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
if GetDepend('RT_USING_RTGUI'):
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
# libc testsuite
# objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
# make a building
DoBuilding(TARGET, objs)
......@@ -76,6 +76,4 @@
///#define FINSH_USING_SYMTAB
///#define FINSH_USING_DESCRIPTION
//#define RT_USING_NEWLIB
#endif
......@@ -91,7 +91,6 @@
/* SECTION: a runtime libc library */
/* a runtime libc library*/
/* #define RT_USING_NEWLIB */
/* SECTION: C++ support */
/* Using C++ support*/
......
......@@ -78,7 +78,6 @@
/* SECTION: a runtime libc library */
/* a runtime libc library */
/* #define RT_USING_NEWLIB */
/* SECTION: a mini libc */
......
......@@ -75,8 +75,6 @@
/* the buffer size of console*/
#define RT_CONSOLEBUF_SIZE 128
#define RT_USING_NEWLIB
/* SECTION: finsh, a C-Express shell */
#define RT_USING_FINSH
/* Using symbol table */
......
......@@ -71,8 +71,6 @@
/* the buffer size of console*/
#define RT_CONSOLEBUF_SIZE 128
//#define RT_USING_NEWLIB
/* SECTION: finsh, a C-Express shell */
#define RT_USING_FINSH
/* Using symbol table */
......
......@@ -103,7 +103,7 @@
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.100549972" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="HAVE_CCONFIG_H"/>
<listOptionValue builtIn="false" value="RT_USING_NEWLIB"/>
<listOptionValue builtIn="false" value="RT_USING_NEWLIBC"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.2133065240" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value="" valueType="string"/>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.992053063" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
......
......@@ -95,9 +95,6 @@
#define FINSH_THREAD_STACK_SIZE 4096
// </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_PTHREADS" description="Using POSIX threads library" default="true" />
// #define RT_USING_PTHREADS
// </section>
......
......@@ -27,9 +27,5 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT)
# kernel testsuite
#objs = objs + SConscript(RTT_ROOT + '/examples/kernel/SConscript', variant_dir='build/examples/kernel', duplicate=0)
# make a building
DoBuilding(TARGET, objs)
......@@ -88,7 +88,6 @@
/* SECTION: a runtime libc library */
/* a runtime libc library */
/* #define RT_USING_NEWLIB */
/* SECTION: a mini libc */
......
......@@ -6,7 +6,7 @@
/* RT-Thread pre-include file */
#define HAVE_CCONFIG_H
#define RT_USING_NEWLIB
#define RT_USING_NEWLIBC
#define STM32F746xx
#define USE_HAL_DRIVER
#define __RTTHREAD__
......
......@@ -114,9 +114,6 @@
//#define FINSH_USING_MSH
// </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_PTHREADS" description="Using POSIX threads library" default="true" />
//#define RT_USING_PTHREADS
// </section>
......
......@@ -114,9 +114,6 @@
//#define FINSH_USING_MSH
// </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_PTHREADS" description="Using POSIX threads library" default="true" />
//#define RT_USING_PTHREADS
// </section>
......
......@@ -4,9 +4,9 @@ Import('rtconfig')
src = Glob('*.c')
group = []
CPPDEFINES = ['RT_USING_ARM_LIBC', 'RT_USING_LIBC', '__STDC_LIMIT_MACROS']
if rtconfig.PLATFORM in ['armcc', 'armclang']:
CPPDEFINES = ['RT_USING_ARMLIBC', 'RT_USING_LIBC', '__STDC_LIMIT_MACROS']
AddDepend(['RT_USING_ARMLIBC', 'RT_USING_LIBC'])
group = DefineGroup('Compiler', src, depend = [''], CPPDEFINES = CPPDEFINES)
Return('group')
......@@ -4,9 +4,10 @@ Import('rtconfig')
src = Glob('*.c')
group = []
CPPDEFINES = ['RT_USING_DLIBC', 'RT_USING_LIBC', '_DLIB_ADD_EXTRA_SYMBOLS=0']
if rtconfig.PLATFORM in ['iccarm']:
CPPDEFINES = ['RT_USING_DLIBC', 'RT_USING_LIBC', '_DLIB_ADD_EXTRA_SYMBOLS=0']
AddDepend(['RT_USING_DLIBC', 'RT_USING_LIBC'])
if GetDepend('DFS_USING_POSIX'):
from distutils.version import LooseVersion
from iar import IARVersion
......
......@@ -17,11 +17,10 @@ if rtconfig.PLATFORM in ['gcc']:
print('Newlib version:' + GetNewLibVersion(rtconfig))
# identify this is Newlib, and only enable POSIX.1-1990
CPPDEFINES = ['RT_USING_NEWLIB', 'RT_USING_LIBC', '_POSIX_C_SOURCE=1']
CPPDEFINES = ['RT_USING_NEWLIBC', 'RT_USING_LIBC', '_POSIX_C_SOURCE=1']
AddDepend(['RT_USING_NEWLIBC', 'RT_USING_LIBC'])
group = DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
......
......@@ -33,7 +33,7 @@ int libc_system_init(void)
}
INIT_COMPONENT_EXPORT(libc_system_init);
#if defined(RT_USING_POSIX_STDIO) && defined(RT_USING_NEWLIB)
#if defined(RT_USING_POSIX_STDIO) && defined(RT_USING_NEWLIBC)
#define STDIO_DEVICE_NAME_MAX 32
static FILE* std_console = NULL;
int libc_stdio_set_console(const char* device_name, int mode)
......@@ -134,7 +134,7 @@ int libc_stdio_set_console(const char* device_name, int mode)
int libc_stdio_get_console(void) {
return std_fd;
}
#endif /* defined(RT_USING_POSIX_STDIO) && defined(RT_USING_NEWLIB) */
#endif /* defined(RT_USING_POSIX_STDIO) && defined(RT_USING_NEWLIBC) */
int isatty(int fd)
{
......
from building import *
src = Glob('*.c')
group = DefineGroup('UTest', src, depend = ['RT_USING_NEWLIB', 'RT_USING_PTHREADS'])
group = DefineGroup('UTest', src, depend = ['RT_USING_NEWLIBC', 'RT_USING_PTHREADS'])
Return('group')
......@@ -593,7 +593,7 @@ rt_err_t rt_get_errno(void);
void rt_set_errno(rt_err_t no);
int *_rt_errno(void);
const char *rt_strerror(rt_err_t error);
#if !defined(RT_USING_NEWLIB) && !defined(_WIN32)
#if !defined(RT_USING_NEWLIBC) && !defined(_WIN32)
#ifndef errno
#define errno *_rt_errno()
#endif
......
......@@ -467,7 +467,17 @@ def GetLocalDepend(options, depend):
return building
def AddDepend(option):
BuildOptions[option] = 1
if isinstance(option, str):
BuildOptions[option] = 1
elif isinstance(option, list):
for obj in option:
if isinstance(obj, str):
BuildOptions[obj] = 1
else:
print('AddDepend arguements are illegal!')
else:
print('AddDepend arguements are illegal!')
def MergeGroup(src_group, group):
src_group['src'] = src_group['src'] + group['src']
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册