From 67feda60b2f45f7e35bde63c47da35bc4b7faada Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 10 Feb 2017 10:04:56 -0600 Subject: [PATCH] libc/Kconfig: Use menus vs. comments to better organize the C library menus --- libc/dllfcn/Kconfig | 4 +- libc/hex2bin/Kconfig | 171 ------------------------------------------- libc/locale/Kconfig | 4 +- libc/machine/Kconfig | 4 +- libc/math/Kconfig | 4 +- libc/modlib/Kconfig | 2 - libc/net/Kconfig | 4 +- libc/netdb/Kconfig | 5 +- libc/stdio/Kconfig | 4 +- libc/stdlib/Kconfig | 7 +- libc/string/Kconfig | 7 +- libc/time/Kconfig | 4 +- libc/tls/Kconfig | 5 +- libc/unistd/Kconfig | 4 +- libc/wchar/Kconfig | 4 +- libc/wqueue/Kconfig | 3 +- 16 files changed, 42 insertions(+), 194 deletions(-) diff --git a/libc/dllfcn/Kconfig b/libc/dllfcn/Kconfig index 738251a4e1..33e017246a 100644 --- a/libc/dllfcn/Kconfig +++ b/libc/dllfcn/Kconfig @@ -3,7 +3,7 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Shared Library Support" +# menu "Shared Library Support" config LIBC_DLLFCN bool "Shared library support" @@ -16,3 +16,5 @@ config LIBC_DLLFCN Enabled support for user-space shared libraries. A work in progress, hence, marked EXPERIMENTAL + +# endmenu # Shared Library Support diff --git a/libc/hex2bin/Kconfig b/libc/hex2bin/Kconfig index 10eadd6bc9..82bb419727 100644 --- a/libc/hex2bin/Kconfig +++ b/libc/hex2bin/Kconfig @@ -3,177 +3,6 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Standard C Library Options" - -config STDIO_DISABLE_BUFFERING - bool "Disable STDIO Buffering" - default n - ---help--- - Tiny systems may need to disable all support for I/O buffering in - order to minimize the memory footprint. - - NOTE that even if STDIO buffering is enabled, you can still disable - buffering by setting CONFIG_STDIO_BUFFER_SIZE=0 or dynamically - through the setvbuf() interface. In this case, however, memory - used for buffering will be eliminated, of course, but there will be - no reduction in static code size. Only setting - CONFIG_STDIO_DISABLE_BUFFERING will reduce static code size. - - The setvbuf() interface is not available if - CONFIG_STDIO_DISABLE_BUFFERING is selected. - -if !STDIO_DISABLE_BUFFERING - -config STDIO_BUFFER_SIZE - int "STDIO buffer size" - default 64 - ---help--- - Size of buffers using within the C buffered I/O interfaces (printf, - putchar, fwrite, etc.). This function sets the initial I/O buffer - size. Zero disables I/O buffering initially. Any buffer size may - be subsequently modified using setvbuf(). - -config STDIO_LINEBUFFER - bool "STDIO line buffering" - default y - ---help--- - Sets the default behavior to flush buffered I/O whenever a newline - character is found in the output data stream. This setting just - sets the initial default behavior of all streams. The behavior of - an individual stream can be changed via setvbuf(). - -endif # !STDIO_DISABLE_BUFFERING - -config NUNGET_CHARS - int "Number unget() characters" - default 2 - ---help--- - Number of characters that can be buffered by ungetc() (Only if NFILE_STREAMS > 0) - -source libc/math/Kconfig -source libc/machine/Kconfig -source libc/stdlib/Kconfig -source libc/unistd/Kconfig -source libc/string/Kconfig -source libc/dllfcn/Kconfig -source libc/modlib/Kconfig - -config NOPRINTF_FIELDWIDTH - bool "Disable sprintf support fieldwidth" - default n - ---help--- - sprintf-related logic is a little smaller if we do not support field - widths. - -config LIBC_FLOATINGPOINT - bool "Enable floating point in printf" - default n - ---help--- - By default, floating point - support in printf, sscanf, etc. is disabled. - -config LIBC_LONG_LONG - bool "Enable long long support in printf" - default y if !DEFAULT_SMALL - default n if DEFAULT_SMALL - ---help--- - Enables support for long long formats in printf, sscanf, etc. is - enabled. This is enabled by default but if you are trying to - reduce the FLASH footprint, then disabling this feature is one - option. The FLASH saves comes not from disabling the long long - formats, but rather from omitting the large long long arithmetic - libraries that will be drawn into the build if long long support - is enabled. - -config LIBC_SCANSET - bool "Scanset support" - default n - ---help--- - Add scanset support to sscanf(). - -source libc/wchar/Kconfig -source libc/locale/Kconfig - -choice - prompt "Newline Options" - default EOL_IS_EITHER_CRLF - ---help--- - This selection determines the line terminating character that is used. - Some environments may return CR as end-of-line, others LF, and others - both. If not specified, the default is either CR or LF (but not both) - as the line terminating charactor. - -config EOL_IS_CR - bool "EOL is CR" - -config EOL_IS_LF - bool "EOL is LF" - -config EOL_IS_BOTH_CRLF - bool "EOL is CR and LF" - -config EOL_IS_EITHER_CRLF - bool "EOL is CR or LF" - -endchoice - -source libc/time/Kconfig - -config MEMCPY_VIK - bool "Vik memcpy()" - default n - depends on !LIBC_ARCH_MEMCPY - ---help--- - Select this option to use the optimized memcpy() function by Daniel Vik. - Select this option for improved performance at the expense of increased - size. See licensing information in the top-level COPYING file. - -if MEMCPY_VIK - -config MEMCPY_PRE_INC_PTRS - bool "Pre-increment pointers" - default n - ---help--- - Use pre-increment of pointers. Default is post increment of pointers. - -config MEMCPY_INDEXED_COPY - bool "Array indexing" - default y - ---help--- - Copying data using array indexing. Using this option, disables the - MEMCPY_PRE_INC_PTRS option. - -config MEMCPY_64BIT - bool "64-bit memcpy()" - default n - ---help--- - Compiles memcpy() for architectures that suppport 64-bit operations - efficiently. - -endif # MEMCPY_VIK - -config MEMSET_OPTSPEED - bool "Optimize memset() for speed" - default n - depends on !LIBC_ARCH_MEMSET - ---help--- - Select this option to use a version of memcpy() optimized for speed. - Default: memcpy() is optimized for size. - -config MEMSET_64BIT - bool "64-bit memset()" - default n - depends on MEMSET_OPTSPEED - ---help--- - Compiles memset() for architectures that suppport 64-bit operations - efficiently. - -source libc/tls/Kconfig -source libc/net/Kconfig -source libc/netdb/Kconfig -source libc/misc/Kconfig -source libc/wqueue/Kconfig - config LIB_HEX2BIN bool "Intel HEX to binary conversion library" default n diff --git a/libc/locale/Kconfig b/libc/locale/Kconfig index 74fd56f9fa..4e4f193120 100644 --- a/libc/locale/Kconfig +++ b/libc/locale/Kconfig @@ -3,10 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Locale Support" +#menu "Locale Support" config LIBC_LOCALE bool "Enable I18N (LOCALE) support" default n ---help--- By default, i18n (locale) support is disabled. + +#endmenu # Locale Support diff --git a/libc/machine/Kconfig b/libc/machine/Kconfig index 8d2be70beb..693ede6a7f 100644 --- a/libc/machine/Kconfig +++ b/libc/machine/Kconfig @@ -7,7 +7,7 @@ # specific implementations. Not all architectures support implementations # for every library function. -comment "Architecture-Specific Spport" +menu "Architecture-Specific Support" config ARCH_LOWPUTC bool "Low-level console output" @@ -163,3 +163,5 @@ endif if ARCH_X86 source libc/machine/x86/Kconfig endif + +endmenu # Architecture-Specific Spport diff --git a/libc/math/Kconfig b/libc/math/Kconfig index 8da47fdfb2..c7e5feb991 100644 --- a/libc/math/Kconfig +++ b/libc/math/Kconfig @@ -3,7 +3,7 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Math Library Support" +#menu "Math Library Support" config LIBM bool "Standard Math library" @@ -27,3 +27,5 @@ config LIBM math library built into NuttX. This math library comes from the Rhombus OS and was written by Nick Johnson. The Rhombus OS math library port was contributed by Darcy Gong. + +#endmenu # Math Library Support diff --git a/libc/modlib/Kconfig b/libc/modlib/Kconfig index 9980795f1b..eeb5d05dcc 100644 --- a/libc/modlib/Kconfig +++ b/libc/modlib/Kconfig @@ -3,8 +3,6 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Module Library Configuration" - config LIBC_MODLIB bool default n diff --git a/libc/net/Kconfig b/libc/net/Kconfig index 1fc85b7c5d..2e8bacc073 100644 --- a/libc/net/Kconfig +++ b/libc/net/Kconfig @@ -3,7 +3,7 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Standard C Library Options" +menu "Network-Related Options" config LIBC_IPv4_ADDRCONV bool "IPv4 address conversions" @@ -14,3 +14,5 @@ config LIBC_IPv6_ADDRCONV bool "IPv6 address conversions" default n depends on !NET_IPv6 + +endmenu # Network-Related Options diff --git a/libc/netdb/Kconfig b/libc/netdb/Kconfig index aed5b09f3c..a841ce14b7 100644 --- a/libc/netdb/Kconfig +++ b/libc/netdb/Kconfig @@ -3,12 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "NETDB Support" - config LIBC_NETDB bool default n +menu "NETDB Support" + menuconfig NETDB_HOSTFILE bool "Network host file support" default n @@ -250,3 +250,4 @@ config NETDB_DNSSERVER_IPv6ADDR_8 endif # NETDB_DNSSERVER_IPv6 endif # NETDB_DNSCLIENT +endmenu # NETDB Support diff --git a/libc/stdio/Kconfig b/libc/stdio/Kconfig index 7b897caa89..e65fc4cd86 100644 --- a/libc/stdio/Kconfig +++ b/libc/stdio/Kconfig @@ -3,7 +3,7 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Standard C I/O" +menu "Standard C I/O" config STDIO_DISABLE_BUFFERING bool "Disable STDIO Buffering" @@ -116,3 +116,5 @@ config MEMCPY_VIK Select this option to use the optimized memcpy() function by Daniel Vik. Select this option for improved performance at the expense of increased size. See licensing information in the top-level COPYING file. + +endmenu #Standard C I/O diff --git a/libc/stdlib/Kconfig b/libc/stdlib/Kconfig index 138022811b..2df878e44e 100644 --- a/libc/stdlib/Kconfig +++ b/libc/stdlib/Kconfig @@ -3,7 +3,7 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Random Number Generation" +menu "stdlib Options" config LIB_RAND_ORDER int "Order of the random number generate" @@ -13,8 +13,6 @@ config LIB_RAND_ORDER The order of the random number generator. 1=fast but very bad random numbers, 3=slow but very good random numbers. -comment "Environment Variables" - config LIB_HOMEDIR string "Home directory" default "/" @@ -22,8 +20,6 @@ config LIB_HOMEDIR ---help--- The home directory to use with operations like such as 'cd ~' -comment "Temporary Files" - config LIBC_TMPDIR string "Temporary file directory" default "/tmp" @@ -45,3 +41,4 @@ config LIBC_MAX_TMPFILE maximum size of that last filename. This size is the size of the full file path. +endmenu # stdlib Options diff --git a/libc/string/Kconfig b/libc/string/Kconfig index deb01c4988..2ab3f3e557 100644 --- a/libc/string/Kconfig +++ b/libc/string/Kconfig @@ -3,7 +3,7 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "errno Decode Support" +menu "errno Decode Support" config LIBC_STRERROR bool "Enable strerror" @@ -36,7 +36,9 @@ config LIBC_PERROR_STDOUT be defined, however, to provide perror() output that is serialized with other stdout messages. -comment "memcpy/memset Options" +endmenu # errno Decode Support + +menu "memcpy/memset Options" config MEMCPY_VIK bool "Vik memcpy()" @@ -87,3 +89,4 @@ config MEMSET_64BIT Compiles memset() for architectures that suppport 64-bit operations efficiently. +endmenu # memcpy/memset Options diff --git a/libc/time/Kconfig b/libc/time/Kconfig index c3d806bc00..a9acbb8766 100644 --- a/libc/time/Kconfig +++ b/libc/time/Kconfig @@ -3,7 +3,7 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Time/Time Zone Support" +menu "Time/Time Zone Support" config LIBC_LOCALTIME bool "localtime API call support" @@ -79,3 +79,5 @@ config TIME_EXTENDED that expect the tm struct to contain these members. Note: tm_isdst is always 0 + +endmenu # Time/Time Zone Support diff --git a/libc/tls/Kconfig b/libc/tls/Kconfig index b036adbcda..b54f098bf4 100644 --- a/libc/tls/Kconfig +++ b/libc/tls/Kconfig @@ -12,9 +12,9 @@ config ARCH_HAVE_TLS if ARCH_HAVE_TLS -comment "Thread Local Storage" +menu "Thread Local Storage (TLS)" -menuconfig TLS +config TLS bool "Thread Local Storage (TLS)" default n ---help--- @@ -48,4 +48,5 @@ config TLS_NELEM the user library functions tls_get_element() and tls_set_element(). endif # TLS +endmenu # Thread Local Storage (TLS) endif # ARCH_HAVE_TLS diff --git a/libc/unistd/Kconfig b/libc/unistd/Kconfig index 030e9cfb9d..966a338b36 100644 --- a/libc/unistd/Kconfig +++ b/libc/unistd/Kconfig @@ -3,7 +3,7 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Program Execution Options" +menu "Program Execution Options" config LIBC_EXECFUNCS bool "Enable exec[l|v] / posix_spawn() Support" @@ -86,3 +86,5 @@ config TASK_SPAWN_DEFAULT_STACKSIZE task_spawnattr_setstacksize(). This value specifies the default stack size to use if task_spawnattr_setstacksize() is not used. Default: 2048. + +endmenu # Program Execution Options diff --git a/libc/wchar/Kconfig b/libc/wchar/Kconfig index d65dbee449..853d80507b 100644 --- a/libc/wchar/Kconfig +++ b/libc/wchar/Kconfig @@ -3,10 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -comment "Wide character suppoort" +#menu "Wide character suppoort" config LIBC_WCHAR bool "Enable wide-characters (Unicode) support" default n ---help--- By default, wide-characters support is disabled. + +#endmenu # Wide character suppoort diff --git a/libc/wqueue/Kconfig b/libc/wqueue/Kconfig index 9d3b8a1474..1a9b40af7d 100644 --- a/libc/wqueue/Kconfig +++ b/libc/wqueue/Kconfig @@ -5,7 +5,7 @@ if BUILD_PROTECTED || BUILD_KERNEL -comment "User Work Queue Support" +menu "User Work Queue Support" config LIB_USRWORK bool "User mode worker thread" @@ -37,4 +37,5 @@ config LIB_USRWORKSTACKSIZE The stack size allocated for the lower priority worker thread. Default: 2K. endif # LIB_USRWORK +endmenu # User Work Queue Support endif # BUILD_PROTECTED || BUILD_KERNEL