From a5ecbe62c25c7c9d6ddd0c9eb4d5ec3350642614 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sat, 23 Mar 2013 23:50:31 +0000 Subject: Add SLRE - Super Light Regular Expression library Downloaded from http://slre.sourceforge.net/ and adapted for U-Boot environment. Used to implement regex operations on environment variables. Code size is ~ 3.5 KiB on PPC. To enable this code, define the CONFIG_REGEX option in your board config file. Note: There are more recent versions of the SLRE library available at http://slre.googlecode.com ; unfortunately, the new code has a heavily reorked API which makes it less usable for our purposes: - the return code is strings, which are more difficult to process - we don't get any information any more which sub-string of the data was matched by the given regex - it is much more cumbersome to work with arbitrary expressions, where for example the number of substrings for capturing are not known at compile time Also, there does not seem to be any real changes or improvements of the functionality. Because of this, we deliberately stick with the older code. Note 2: the test code (built when SLRE_TEST is defined) was modified to allow for more extensive testing; now we can test the regexp matching on all lines on a text file (instead of the whole data in the file as a single block). Signed-off-by: Wolfgang Denk --- lib/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/Makefile') diff --git a/lib/Makefile b/lib/Makefile index e901cc7caf..a3131d873f 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -72,6 +72,7 @@ COBJS-y += crc32.o COBJS-y += ctype.o COBJS-y += div64.o COBJS-y += linux_string.o +COBJS-$(CONFIG_REGEX) += slre.o COBJS-y += string.o COBJS-y += time.o COBJS-$(CONFIG_BOOTP_PXE) += uuid.o -- cgit v1.2.1