diff --git a/components/libc/Kconfig b/components/libc/Kconfig index 9e1609000d44bf6d444345bc88c049577812cbb7..c988ada354f24ab2c37377f3cb0ce16a3d61049a 100644 --- a/components/libc/Kconfig +++ b/components/libc/Kconfig @@ -1,87 +1,92 @@ menu "POSIX layer and C standard library" - -config RT_USING_LIBC - bool "Enable libc APIs from toolchain" - default y - -if RT_USING_LIBC && RT_USING_LWP - choice - prompt "Select c standard library" - default RT_USING_MUSL - help - Select c standard library - - config RT_USING_NEWLIB - bool "Use libc: newlib" - - config RT_USING_MUSL - bool "Use libc: musl (libc.a/libm.a in RT-Thread)" - - endchoice -endif - -config RT_USING_PTHREADS - bool "Enable pthreads APIs" - default n - -if RT_USING_PTHREADS - config PTHREAD_NUM_MAX - int "Maximum number of pthreads" - default 8 -endif - -if RT_USING_LIBC && RT_USING_DFS - config RT_USING_POSIX - bool "Enable POSIX layer for poll/select, stdin etc" - select RT_USING_DFS_DEVFS - default y - - if RT_USING_POSIX - config RT_USING_POSIX_MMAP - bool "Enable mmap() API" - default n - - config RT_USING_POSIX_TERMIOS - bool "Enable termios APIs" - default n - - config RT_USING_POSIX_GETLINE - bool "Enable getline()/getdelim() APIs" - default n - - config RT_USING_POSIX_AIO - bool "Enable AIO" - default n - - config RT_POSIX_AIO_THREAD_STACK_SIZE - int "Set posix aio thread stack size" - default 2048 - depends on RT_USING_POSIX_AIO - - config RT_USING_POSIX_CLOCKTIME - bool "Enable POSIX clock_time APIs" - default n + config RT_USING_SELECT_LIBC + bool "select libc or mlibc" + default y + if RT_USING_SELECT_LIBC + choice + prompt "Select libc or mlibc" + default RT_USING_LIBC + help + Select libc or mlibc + + config RT_USING_LIBC + bool "Enable libc APIs from toolchain" + + config RT_USING_MLIBC + bool "Enable libc APIs from mlibc" + endchoice endif -endif + if RT_USING_LIBC && RT_USING_LWP + choice + prompt "Select c standard library" + default RT_USING_MUSL + help + Select c standard library -if RT_USING_LIBC - config RT_USING_MODULE - bool "Enable dynamic module with dlopen/dlsym/dlclose feature" - default n + config RT_USING_NEWLIB + bool "Use libc: newlib" - if RT_USING_MODULE - config RT_USING_CUSTOM_DLMODULE - bool "Enable load dynamic module by custom" - default n + config RT_USING_MUSL + bool "Use libc: musl (libc.a/libm.a in RT-Thread)" + endchoice + endif + if RT_USING_LIBC && RT_USING_DFS + config RT_USING_POSIX + bool "Enable POSIX layer for poll/select, stdin etc" + select RT_USING_DFS_DEVFS + default y + + if RT_USING_POSIX + config RT_USING_POSIX_MMAP + bool "Enable mmap() API" + default n + + config RT_USING_POSIX_TERMIOS + bool "Enable termios APIs" + default n + + config RT_USING_POSIX_GETLINE + bool "Enable getline()/getdelim() APIs" + default n + + config RT_USING_POSIX_AIO + bool "Enable AIO" + default n + + config RT_POSIX_AIO_THREAD_STACK_SIZE + int "Set posix aio thread stack size" + default 2048 + depends on RT_USING_POSIX_AIO + + config RT_USING_POSIX_CLOCKTIME + bool "Enable POSIX clock_time APIs" + default n + endif + endif + if RT_USING_LIBC + config RT_USING_MODULE + bool "Enable dynamic module with dlopen/dlsym/dlclose feature" + default n + + if RT_USING_MODULE + config RT_USING_CUSTOM_DLMODULE + bool "Enable load dynamic module by custom" + default n + endif + config RT_USING_PTHREADS + bool "Enable pthreads APIs" + default n + + if RT_USING_PTHREADS + config PTHREAD_NUM_MAX + int "Maximum number of pthreads" + default 8 + endif + endif + if RT_USING_LIBC != y + config RT_LIBC_USING_TIME + bool "Enable TIME FUNCTIONS WITHOUT COMPILER'S LIBC" + default y endif - -endif - -if RT_USING_LIBC != y - config RT_LIBC_USING_TIME - bool "Enable TIME FUNCTIONS WITHOUT COMPILER'S LIBC" - default y -endif - endmenu diff --git a/components/lwp/Kconfig b/components/lwp/Kconfig index da5ca2a1906ad0a6b73c559cdc7d33ca6d758d13..66d51f3b59ba362685705b71e5fd6411ae8e1bfc 100644 --- a/components/lwp/Kconfig +++ b/components/lwp/Kconfig @@ -1,7 +1,7 @@ config RT_USING_LWP bool "Using light-weight process" select RT_USING_DFS - select RT_USING_LIBC + select RT_USING_SELECT_LIBC select RT_USING_POSIX_CLOCKTIME depends on ARCH_ARM_CORTEX_M || ARCH_ARM_ARM9 || ARCH_ARM_CORTEX_A || ARCH_RISCV64 default n diff --git a/components/net/Kconfig b/components/net/Kconfig index 3a4f39ed49f4b7d86288d549646448cdb8172d65..8d27ceba536fc01c5891fb87c4935ec09d905b31 100644 --- a/components/net/Kconfig +++ b/components/net/Kconfig @@ -36,7 +36,7 @@ config RT_USING_SAL bool "Enable BSD socket operated by file system API" default n select RT_USING_DFS - select RT_USING_LIBC + select RT_USING_SELECT_LIBC select RT_USING_POSIX help Let BSD socket operated by file system API, such as read/write and involveed in select/poll POSIX APIs. diff --git a/include/rtdebug.h b/include/rtdebug.h index b66cd6fc694a864d8180b115d0ed895f6f0e88b7..6bee924934758fd4e3940616fda48ad335cd41d9 100644 --- a/include/rtdebug.h +++ b/include/rtdebug.h @@ -15,8 +15,8 @@ #error "POSIX poll/select, stdin need file system(RT_USING_DFS) and device file system(RT_USING_DFS_DEVFS)" #endif -#if !defined(RT_USING_LIBC) -#error "POSIX layer need standard C library(RT_USING_LIBC)" +#if !defined(RT_USING_LIBC) && !defined(RT_USING_MLIBC) +#error "POSIX layer need standard C library(RT_USING_LIBC OR RT_USING_MLIBC)" #endif #endif