[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r2508 - in /trunk/libc: ./ locale/ locale/programs/ misc/ posix/ stdlib/



Author: jimb
Date: Wed Jun 13 17:14:51 2007
New Revision: 2508

Log:
Add the OPTION_POSIX_REGEXP option group.

* option-groups.def (OPTION_POSIX_REGEXP): New entry.
* option-groups.defaults (OPTION_POSIX_REGEXP): Initialize.
* posix/Makefile: Include ../option-groups.mak.
(routines): Move 'regex' into the group.
* stdlib/Makefile: Put rpmatch in both the OPTION_POSIX_REGEXP and
OPTION_EGLIBC_LOCALE_CODE groups.
* misc/Makefile: Put regexp in the group.
* locale/Makefile (CFLAGS-ld-messages.c): Define
OPTION_POSIX_REGEXP as appropriate.
* locale/programs/ld-messages.c: Don't check the syntax of 'yes'
and 'no' regular expressions if the group isn't enabled.

Modified:
    trunk/libc/ChangeLog.eglibc
    trunk/libc/locale/Makefile
    trunk/libc/locale/programs/ld-messages.c
    trunk/libc/misc/Makefile
    trunk/libc/option-groups.def
    trunk/libc/option-groups.defaults
    trunk/libc/posix/Makefile
    trunk/libc/stdlib/Makefile

Modified: trunk/libc/ChangeLog.eglibc
==============================================================================
--- trunk/libc/ChangeLog.eglibc (original)
+++ trunk/libc/ChangeLog.eglibc Wed Jun 13 17:14:51 2007
@@ -1,14 +1,28 @@
-2007-06-13  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
-
-	* intl/plural.c: Regenerate.
-
 2007-06-13  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>
+
+	Add the OPTION_POSIX_REGEXP option group.
+
+	* option-groups.def (OPTION_POSIX_REGEXP): New entry.
+	* option-groups.defaults (OPTION_POSIX_REGEXP): Initialize.
+	* posix/Makefile: Include ../option-groups.mak.
+	(routines): Move 'regex' into the group.
+	* stdlib/Makefile: Put rpmatch in both the OPTION_POSIX_REGEXP and
+	OPTION_EGLIBC_LOCALE_CODE groups.
+	* misc/Makefile: Put regexp in the group.
+	* locale/Makefile (CFLAGS-ld-messages.c): Define
+	OPTION_POSIX_REGEXP as appropriate.
+	* locale/programs/ld-messages.c: Don't check the syntax of 'yes'
+	and 'no' regular expressions if the group isn't enabled.
 
 	* option-groups.def, option-groups.defaults: Alphabetize, since
 	the list is getting long.
 
 	* option-groups.def (OPTION_EGLIBC_CATGETS)
 	(OPTION_EGLIBC_LOCALE_CODE): Document interdependency.
+
+2007-06-13  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* intl/plural.c: Regenerate.
 
 2007-06-13  Nathan Sidwell  <nathan@xxxxxxxxxxxxxxxx>
 	    Mark Shinwell  <shinwell@xxxxxxxxxxxxxxxx>

Modified: trunk/libc/locale/Makefile
==============================================================================
--- trunk/libc/locale/Makefile (original)
+++ trunk/libc/locale/Makefile Wed Jun 13 17:14:51 2007
@@ -116,11 +116,14 @@
 
 OPTION_EGLIBC_LOCALE_CODE-CFLAGS-$(OPTION_EGLIBC_LOCALE_CODE) \
 	= -DOPTION_EGLIBC_LOCALE_CODE
+OPTION_POSIX_REGEXP-CFLAGS-$(OPTION_POSIX_REGEXP) \
+	= -DOPTION_POSIX_REGEXP
 
 CFLAGS-xlocale.c = $(OPTION_EGLIBC_LOCALE_CODE-CFLAGS-y)
 CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-charmap-dir.c = -Wno-write-strings
+CFLAGS-ld-messages.c = $(OPTION_POSIX_REGEXP-CFLAGS-y)
 
 # This makes sure -DNOT_IN_libc is passed for all these modules.
 cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \

Modified: trunk/libc/locale/programs/ld-messages.c
==============================================================================
--- trunk/libc/locale/programs/ld-messages.c (original)
+++ trunk/libc/locale/programs/ld-messages.c Wed Jun 13 17:14:51 2007
@@ -123,6 +123,7 @@
     }
   else
     {
+#ifdef OPTION_POSIX_REGEXP
       int result;
       regex_t re;
 
@@ -139,6 +140,7 @@
 	}
       else if (result != 0)
 	regfree (&re);
+#endif
     }
 
   if (messages->noexpr == NULL)
@@ -157,6 +159,7 @@
     }
   else
     {
+#ifdef OPTION_POSIX_REGEXP
       int result;
       regex_t re;
 
@@ -173,6 +176,7 @@
 	}
       else if (result != 0)
 	regfree (&re);
+#endif
     }
 }
 

Modified: trunk/libc/misc/Makefile
==============================================================================
--- trunk/libc/misc/Makefile (original)
+++ trunk/libc/misc/Makefile Wed Jun 13 17:14:51 2007
@@ -63,11 +63,13 @@
 	    efgcvt efgcvt_r qefgcvt qefgcvt_r \
 	    hsearch hsearch_r tsearch lsearch \
 	    err error ustat \
-	    getsysstats dirname regexp \
+	    getsysstats dirname \
 	    getloadavg getclktck \
 	    fgetxattr flistxattr fremovexattr fsetxattr getxattr \
 	    listxattr lgetxattr llistxattr lremovexattr lsetxattr \
 	    removexattr setxattr
+
+routines-$(OPTION_POSIX_REGEXP) += regexp
 
 distribute := device-nrs.h
 

Modified: trunk/libc/option-groups.def
==============================================================================
--- trunk/libc/option-groups.def (original)
+++ trunk/libc/option-groups.def Wed Jun 13 17:14:51 2007
@@ -288,3 +288,23 @@
        group; if you disable OPTION_EGLIBC_LOCALE_CODE, you must also
        disable OPTION_EGLIBC_CATGETS.
 
+config OPTION_POSIX_REGEXP
+    bool "Regular expressions"
+    help
+        This option group includes the POSIX regular expression
+        functions, and the associated non-POSIX extensions and
+        compatibility functions.
+
+        With OPTION_POSIX_REGEXP disabled, the following functions are
+        omitted from libc:
+
+          re_comp                 re_max_failures         regcomp
+          re_compile_fastmap      re_search               regerror
+          re_compile_pattern      re_search_2             regexec
+          re_exec                 re_set_registers        regfree
+          re_match                re_set_syntax           rpmatch
+          re_match_2              re_syntax_options
+
+        Furthermore, the compatibility regexp interface defined in the
+        <regexp.h> header file, 'compile', 'step', and 'advance', is
+        omitted.

Modified: trunk/libc/option-groups.defaults
==============================================================================
--- trunk/libc/option-groups.defaults (original)
+++ trunk/libc/option-groups.defaults Wed Jun 13 17:14:51 2007
@@ -14,3 +14,4 @@
 OPTION_EGLIBC_LIBM = y
 OPTION_EGLIBC_LOCALES = y
 OPTION_EGLIBC_LOCALE_CODE = y
+OPTION_POSIX_REGEXP = y

Modified: trunk/libc/posix/Makefile
==============================================================================
--- trunk/libc/posix/Makefile (original)
+++ trunk/libc/posix/Makefile Wed Jun 13 17:14:51 2007
@@ -52,7 +52,7 @@
 	getresuid getresgid setresuid setresgid				      \
 	getlogin getlogin_r setlogin					      \
 	pathconf sysconf fpathconf					      \
-	glob glob64 fnmatch regex					      \
+	glob glob64 fnmatch						      \
 	confstr								      \
 	getopt getopt1 getopt_init					      \
 	sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax  \
@@ -71,6 +71,7 @@
 	get_child_max sched_cpucount
 
 routines-$(OPTION_EGLIBC_INET) += getaddrinfo gai_strerror 
+routines-$(OPTION_POSIX_REGEXP) += regex
 
 include ../Makeconfig
 

Modified: trunk/libc/stdlib/Makefile
==============================================================================
--- trunk/libc/stdlib/Makefile (original)
+++ trunk/libc/stdlib/Makefile Wed Jun 13 17:14:51 2007
@@ -55,7 +55,10 @@
 	strtoimax strtoumax wcstoimax wcstoumax				      \
 	getcontext setcontext makecontext swapcontext
 routines-$(OPTION_EGLIBC_LOCALE_CODE) +=				      \
-	rpmatch strfmon strfmon_l
+	strfmon strfmon_l
+ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_POSIX_REGEXP))
+routines-y += rpmatch
+endif
 aux =	grouping groupingwc
 
 # These routines will be omitted from the libc shared object.