diff --git a/sys/Kconfig b/sys/Kconfig index bcbc78ea48..b54a6c53b8 100644 --- a/sys/Kconfig +++ b/sys/Kconfig @@ -30,13 +30,34 @@ rsource "frac/Kconfig" rsource "hashes/Kconfig" rsource "iolist/Kconfig" rsource "isrpipe/Kconfig" + +menu "Libc" + +choice LIBC_IMPLEMENTATION + bool "Libc implementation" + depends on TEST_KCONFIG + +config MODULE_NEWLIB + bool "NewLib" + depends on HAS_NEWLIB + +config MODULE_PICOLIBC + bool "Picolibc" + depends on HAS_PICOLIBC + +endchoice + +rsource "Kconfig.newlib" +rsource "Kconfig.picolibc" + +endmenu # Libc + rsource "luid/Kconfig" rsource "malloc_thread_safe/Kconfig" rsource "matstat/Kconfig" rsource "memarray/Kconfig" rsource "mineplex/Kconfig" rsource "net/Kconfig" -rsource "Kconfig.newlib" rsource "Kconfig.stdio" rsource "od/Kconfig" rsource "posix/Kconfig" diff --git a/sys/Kconfig.newlib b/sys/Kconfig.newlib index a6caf90337..a1c286cab0 100644 --- a/sys/Kconfig.newlib +++ b/sys/Kconfig.newlib @@ -5,10 +5,6 @@ # directory for more details. # -menuconfig MODULE_NEWLIB - bool "NewLib" - depends on TEST_KCONFIG - if MODULE_NEWLIB config MODULE_NEWLIB_NANO @@ -18,9 +14,11 @@ config MODULE_NEWLIB_GNU_SOURCE bool "NewLib GNU source" config MODULE_NEWLIB_SYSCALLS_DEFAULT - bool "NewLib Syscalls default implementation" + bool default y depends on !HAVE_CUSTOM_NEWLIB_SYSCALLS + help + Default implementation of newlib system calls. endif # MODULE_NEWLIB diff --git a/sys/Kconfig.picolibc b/sys/Kconfig.picolibc new file mode 100644 index 0000000000..cabfc3d015 --- /dev/null +++ b/sys/Kconfig.picolibc @@ -0,0 +1,29 @@ +# Copyright (c) 2021 HAW Hamburg +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +if MODULE_PICOLIBC + +config PICOLIBC_STDOUT_BUFFERED + bool "Buffered standard output" + default USE_STDOUT_BUFFERED + help + Say y to use buffering in the standard output, usually good for modules that benefit from + sending out buffers in larger chunks. + +config MODULE_PICOLIBC_SYSCALLS_DEFAULT + bool + default y + depends on !HAVE_CUSTOM_PICOLIBC_SYSCALLS + help + Default implementation of picolibc system calls. + +endif # MODULE_PICOLIBC + +config HAVE_CUSTOM_PICOLIB_SYSCALLS + bool + help + Indicates that a custom picolibc syscalls implementation is present. diff --git a/sys/Kconfig.stdio b/sys/Kconfig.stdio index 5aec6f22e7..bbfc31979c 100644 --- a/sys/Kconfig.stdio +++ b/sys/Kconfig.stdio @@ -18,6 +18,7 @@ choice config MODULE_SLIPDEV_STDIO bool "SLIP network device" depends on MODULE_SLIPDEV + select USE_STDOUT_BUFFERED select MODULE_ISRPIPE config MODULE_STDIO_NULL @@ -50,4 +51,9 @@ config MODULE_STDIO_UART_RX config MODULE_PRINTF_FLOAT bool "Float support in printf" +config USE_STDOUT_BUFFERED + bool + help + Select this to prefer buffered standard output if provided by the implementation. + endmenu # Standard Input/Output (STDIO)