summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMan, Jianting (Meco) <[email protected]>2023-04-30 00:19:57 -0400
committerGitHub <[email protected]>2023-04-30 12:19:57 +0800
commitd5800421459bec6cea97d5fc505ffa9b0c16b8e1 (patch)
tree13dfce5b5cb06abc89838b1bebda31e052b4332f /components
parent74719aafc8ed6ef6b9ea4ed90094b1663b6e8a26 (diff)
[libc] support external third pary libc software package (#7425)
Diffstat (limited to 'components')
-rw-r--r--components/libc/Kconfig3
-rw-r--r--components/libc/compilers/musl/SConscript6
-rw-r--r--components/libc/compilers/newlib/SConscript6
3 files changed, 9 insertions, 6 deletions
diff --git a/components/libc/Kconfig b/components/libc/Kconfig
index 3cdaba4bcf..ea6763007e 100644
--- a/components/libc/Kconfig
+++ b/components/libc/Kconfig
@@ -1,5 +1,8 @@
menu "C/C++ and POSIX layer"
+config RT_USING_EXTERNAL_LIBC
+ bool
+
config RT_LIBC_DEFAULT_TIMEZONE
int "Set the default time zone (UTC+)"
range -12 12
diff --git a/components/libc/compilers/musl/SConscript b/components/libc/compilers/musl/SConscript
index 9bc5696157..8c5d0448ae 100644
--- a/components/libc/compilers/musl/SConscript
+++ b/components/libc/compilers/musl/SConscript
@@ -5,10 +5,10 @@ Import('rtconfig')
group = []
-libc_name, libc_version = GetGCCLibcNameVersion(rtconfig)
+musllibc_version = GetMuslVersion(rtconfig)
-if libc_name == 'musl':
- print('Musl version: ' + libc_version)
+if musllibc_version:
+ print('Musl version: ' + musllibc_version)
cwd = GetCurrentDir()
src = Glob('*.c')
diff --git a/components/libc/compilers/newlib/SConscript b/components/libc/compilers/newlib/SConscript
index 14d3f737f5..518fee8775 100644
--- a/components/libc/compilers/newlib/SConscript
+++ b/components/libc/compilers/newlib/SConscript
@@ -5,10 +5,10 @@ Import('rtconfig')
group = []
-libc_name, libc_version = GetGCCLibcNameVersion(rtconfig)
+newlib_version = GetNewLibVersion(rtconfig)
-if libc_name == 'newlib':
- print('Newlib version: ' + libc_version)
+if newlib_version and not GetDepend('RT_USING_EXTERNAL_LIBC'):
+ print('Newlib version: ' + newlib_version)
cwd = GetCurrentDir()
src = Glob('*.c')