This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 441b51b706 libc/regex: provide a separate kconfig for regex
441b51b706 is described below

commit 441b51b7060b3a8da7ecfaf6ef214bb0cd76cc48
Author: guoshichao <[email protected]>
AuthorDate: Thu Jun 1 17:26:10 2023 +0800

    libc/regex: provide a separate kconfig for regex
    
    in the initial impl, the regex is depends on ALLOW_MIT_COMPONENTS, and
    if other modules want to use regex, also needs to depends on
    ALLOW_MIT_COMPONENTS, which is ambiguity, so we provide a seperate
    kconfig option for regex: LIBC_REGEX, which is depends on
    ALLOW_MIT_COMPONENTS, but is enabled by default. Thus if
    ALLOW_MIT_COMPONENTS is enabled, then the LIBC_REGEX is also enabled
    either automatically, and this is more clear than controlled by
    ALLOW_MIT_COMPONENTS option only.
    
    Signed-off-by: guoshichao <[email protected]>
---
 libs/libc/Kconfig         |  1 +
 libs/libc/regex/Kconfig   | 11 +++++++++++
 libs/libc/regex/Make.defs |  2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/libs/libc/Kconfig b/libs/libc/Kconfig
index be6219caee..1e26b3ee38 100644
--- a/libs/libc/Kconfig
+++ b/libs/libc/Kconfig
@@ -29,3 +29,4 @@ source "libs/libc/userfs/Kconfig"
 source "libs/libc/builtin/Kconfig"
 source "libs/libc/symtab/Kconfig"
 source "libs/libc/stream/Kconfig"
+source "libs/libc/regex/Kconfig"
diff --git a/libs/libc/regex/Kconfig b/libs/libc/regex/Kconfig
new file mode 100644
index 0000000000..c211c34be8
--- /dev/null
+++ b/libs/libc/regex/Kconfig
@@ -0,0 +1,11 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config LIBC_REGEX
+       bool "Enable regex"
+       depends on ALLOW_MIT_COMPONENTS
+       default y
+       ---help---
+               provide the regex related func, include regcomp, regexec.
\ No newline at end of file
diff --git a/libs/libc/regex/Make.defs b/libs/libc/regex/Make.defs
index 2e97724c1c..8f46954f57 100644
--- a/libs/libc/regex/Make.defs
+++ b/libs/libc/regex/Make.defs
@@ -18,7 +18,7 @@
 #
 ############################################################################
 
-ifeq ($(CONFIG_ALLOW_MIT_COMPONENTS),y)
+ifeq ($(CONFIG_LIBC_REGEX),y)
 
 # Add the regex C files to the build
 CSRCS += regcomp.c regexec.c regerror.c tre-mem.c

Reply via email to