summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2023-11-21 09:39:42 -0500
committerMeco Man <[email protected]>2023-11-21 23:22:55 -0500
commit873fd76b2f180ec42b2d0e50b24cde07a1453975 (patch)
treeda2c288de7ed33ea13aff9845a1bea6265a23400 /components
parentd73fd165b0ee16800bef66c1190549639170a4a0 (diff)
[libc] add RT_USING_INTERNAL_LIBC_ONLY macro
This option is for RT-Thread Nano version. If select this option, it will not compile components/libc folder and only use tool chain internal libc. Normally, the tool chain internal is only cover ISO standard (e.g. armcc), but some tool chains' internal libc will cover more than ISO standard (e.g. newlib).
Diffstat (limited to 'components')
-rw-r--r--components/libc/Kconfig24
-rw-r--r--components/libc/compilers/SConscript9
2 files changed, 25 insertions, 8 deletions
diff --git a/components/libc/Kconfig b/components/libc/Kconfig
index 47b484744e..9939dbdc4e 100644
--- a/components/libc/Kconfig
+++ b/components/libc/Kconfig
@@ -1,11 +1,27 @@
menu "C/C++ and POSIX layer"
-# This is for external libc(e.g. mlib),
-# and NOT for newlib or picolibc which are inherent in the toolchains.
-# Usually, the external libc should be a software package and select
-# RT_USING_EXTERNAL_LIBC in software package's Kconfig
+config RT_USING_INTERNAL_LIBC_ONLY
+ bool "Only use tool chain internal libc"
+ default n
+ help
+ This option is for RT-Thread Nano version.
+ If select this option, it will not compile components/libc
+ folder and only use tool chain internal libc. Normally, the
+ tool chain internal is only cover ISO standard (e.g. armcc),
+ but some tool chains' internal libc will cover more than
+ ISO standard (e.g. newlib). However, no matter the cover level
+ it is, the rt-thread libc leveling layer will not be involved
+ at all if select this option.
+
config RT_USING_EXTERNAL_LIBC
+ depends on !RT_USING_INTERNAL_LIBC_ONLY
bool
+ help
+ This is for external libc(e.g. mlib),
+ and NOT for newlib or picolibc which are inherent in the toolchains.
+ Usually, the external libc should be a software package and select
+ RT_USING_EXTERNAL_LIBC in software package's Kconfig
+ This option is not available for users to select.
source "$RTT_DIR/components/libc/compilers/common/Kconfig"
source "$RTT_DIR/components/libc/posix/Kconfig"
diff --git a/components/libc/compilers/SConscript b/components/libc/compilers/SConscript
index 4c815c49b8..772229b18d 100644
--- a/components/libc/compilers/SConscript
+++ b/components/libc/compilers/SConscript
@@ -7,9 +7,10 @@ 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'))
+if not GetDepend('RT_USING_INTERNAL_LIBC_ONLY'):
+ 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')