Source-Changes-HG archive

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

[src/trunk]: src Add libc glue for libtre.



details:   https://anonhg.NetBSD.org/src/rev/e10b2275b854
branches:  trunk
changeset: 757549:e10b2275b854
user:      ahoka <ahoka%NetBSD.org@localhost>
date:      Sat Sep 04 12:17:58 2010 +0000

description:
Add libc glue for libtre.
tre will be compiled without approx and wchar/mulibyte support to
only match the minimum requirement to replace our spencer regex.

This needs a lot of testing.

Only enabled when USE_LIBTRE is set to `yes'.

diffstat:

 external/bsd/tre/Makefile.inc                   |   23 ++
 external/bsd/tre/dist/config.h                  |  259 ++++++++++++++++++++++++
 external/bsd/tre/dist/lib/regcomp.c             |    5 +
 external/bsd/tre/dist/lib/regerror.c            |    4 +
 external/bsd/tre/dist/lib/regexec.c             |    6 +
 external/bsd/tre/dist/lib/tre-config.h          |   44 ++++
 external/bsd/tre/dist/lib/tre-match-backtrack.c |   20 +-
 external/bsd/tre/dist/lib/tre-parse.c           |   20 +-
 external/bsd/tre/dist/lib/tre.h                 |  119 +++-------
 lib/libc/Makefile                               |    6 +-
 share/mk/bsd.own.mk                             |    4 +-
 11 files changed, 412 insertions(+), 98 deletions(-)

diffs (truncated from 771 to 300 lines):

diff -r 7eab642047f0 -r e10b2275b854 external/bsd/tre/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/tre/Makefile.inc     Sat Sep 04 12:17:58 2010 +0000
@@ -0,0 +1,23 @@
+#      $NetBSD: Makefile.inc,v 1.1 2010/09/04 12:17:58 ahoka Exp $
+#      @(#)Makefile.inc        8.1 (Berkeley) 6/4/93
+
+# regex sources
+TREDIST= ${NETBSDSRCDIR}/external/bsd/tre/dist
+
+# Add libc/regex for manpages
+.PATH: ${TREDIST}/lib ${NETBSDSRCDIR}/lib/libc/regex
+
+CPPFLAGS+=     -I${TREDIST} -I${TREDIST}/lib
+CPPFLAGS+=     -DHAVE_CONFIG_H=1
+
+SRCS+= regcomp.c regerror.c regexec.c
+SRCS+= tre-ast.c tre-compile.c
+SRCS+= tre-match-backtrack.c tre-match-parallel.c tre-mem.c
+SRCS+= tre-parse.c tre-stack.c
+
+WARNS= 4
+
+MAN+=  regex.3 re_format.7
+
+MLINKS+=regex.3 regcomp.3 regex.3 regexec.3 regex.3 regerror.3 \
+       regex.3 regfree.3
diff -r 7eab642047f0 -r e10b2275b854 external/bsd/tre/dist/config.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/tre/dist/config.h    Sat Sep 04 12:17:58 2010 +0000
@@ -0,0 +1,259 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define to 1 if using `alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+/* #undef ENABLE_NLS */
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+/* #undef HAVE_ALLOCA */
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+   CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYCURRENT */
+
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+   the CoreFoundation framework. */
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+   */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#define HAVE_GETOPT_H 1
+
+/* Define to 1 if you have the `getopt_long' function. */
+#define HAVE_GETOPT_LONG 1
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+/* Define if you have the iconv() function and it works. */
+#define HAVE_ICONV 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/* #undef HAVE_INTTYPES_H */
+
+/* Define to 1 if you have the `isascii' function. */
+#define HAVE_ISASCII 1
+
+/* Define to 1 if you have the `isblank' function. */
+#define HAVE_ISBLANK 1
+
+/* Define to 1 if you have the `iswascii' function or macro. */
+/* #undef HAVE_ISWASCII */
+
+/* Define to 1 if you have the `iswblank' function or macro. */
+/* #undef HAVE_ISWBLANK */
+
+/* Define to 1 if you have the `iswctype' function or macro. */
+/* #undef HAVE_ISWCTYPE */
+
+/* Define to 1 if you have the `iswlower' function or macro. */
+/* #undef HAVE_ISWLOWER */
+
+/* Define to 1 if you have the `iswupper' function or macro. */
+/* #undef HAVE_ISWUPPER */
+
+/* Define to 1 if you have the <libutf8.h> header file. */
+/* #undef HAVE_LIBUTF8_H */
+
+/* Define to 1 if you have the `mbrtowc' function or macro. */
+/* #undef HAVE_MBRTOWC */
+
+/* Define to 1 if the system has the type `mbstate_t'. */
+/* #undef HAVE_MBSTATE_T */
+
+/* Define to 1 if you have the `mbtowc' function or macro. */
+/* #undef HAVE_MBTOWC */
+
+/* Define to 1 if you have the <memory.h> header file. */
+/* #undef HAVE_MEMORY_H */
+
+/* Define to 1 if you have the <regex.h> header file. */
+#define HAVE_REGEX_H 1
+
+/* Define to 1 if the system has the type `reg_errcode_t'. */
+/* #undef HAVE_REG_ERRCODE_T */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+/* #undef HAVE_STDINT_H */
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+/* #undef HAVE_STDLIB_H */
+
+/* Define to 1 if you have the <strings.h> header file. */
+/* #undef HAVE_STRINGS_H */
+
+/* Define to 1 if you have the <string.h> header file. */
+/* #undef HAVE_STRING_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+/* #undef HAVE_SYS_STAT_H */
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the `towlower' function or macro. */
+/* #undef HAVE_TOWLOWER */
+
+/* Define to 1 if you have the `towupper' function or macro. */
+/* #undef HAVE_TOWUPPER */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define to 1 if you have the <wchar.h> header file. */
+/* #undef HAVE_WCHAR_H */
+
+/* Define to 1 if the system has the type `wchar_t'. */
+/* #undef HAVE_WCHAR_T */
+
+/* Define to 1 if you have the `wcschr' function or macro. */
+/* #undef HAVE_WCSCHR */
+
+/* Define to 1 if you have the `wcscpy' function or macro. */
+/* #undef HAVE_WCSCPY */
+
+/* Define to 1 if you have the `wcslen' function or macro. */
+/* #undef HAVE_WCSLEN */
+
+/* Define to 1 if you have the `wcsncpy' function or macro. */
+/* #undef HAVE_WCSNCPY */
+
+/* Define to 1 if you have the `wcsrtombs' function or macro. */
+/* #undef HAVE_WCSRTOMBS */
+
+/* Define to 1 if you have the `wcstombs' function or macro. */
+/* #undef HAVE_WCSTOMBS */
+
+/* Define to 1 if you have the `wctype' function or macro. */
+/* #undef HAVE_WCTYPE */
+
+/* Define to 1 if you have the <wctype.h> header file. */
+/* #undef HAVE_WCTYPE_H */
+
+/* Define to 1 if the system has the type `wint_t'. */
+/* #undef HAVE_WINT_T */
+
+/* Define if you want to disable debug assertions. */
+#define NDEBUG 1
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "tre"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "tre-general%lists.laurikari.net@localhost"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "TRE"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "TRE 0.8.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "tre"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "0.8.0"
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at runtime.
+       STACK_DIRECTION > 0 => grows toward higher addresses
+       STACK_DIRECTION < 0 => grows toward lower addresses
+       STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if you want to enable approximate matching functionality. */
+/* #undef TRE_APPROX */
+
+/* Define if you want TRE to print debug messages to stdout. */
+/* #undef TRE_DEBUG */
+
+/* Define to enable multibyte character set support. */
+/* #undef TRE_MULTIBYTE */
+
+/* Define to a field in the regex_t struct where TRE should store a pointer to
+   the internal tre_tnfa_t structure */
+#define TRE_REGEX_T_FIELD re_g
+
+/* Define to the absolute path to the system regex.h */
+#define TRE_SYSTEM_REGEX_H_PATH "../../../include/regex.h"
+
+/* Define if you want TRE to use alloca() instead of malloc() when allocating
+   memory needed for regexec operations. */
+/* #undef TRE_USE_ALLOCA */
+
+/* Define to include the system regex.h from TRE regex.h */
+#define TRE_USE_SYSTEM_REGEX_H 1
+
+/* TRE version string. */
+#define TRE_VERSION "0.8.0"
+
+/* TRE version level 1. */
+#define TRE_VERSION_1 0
+
+/* TRE version level 2. */
+#define TRE_VERSION_2 8
+
+/* TRE version level 3. */
+#define TRE_VERSION_3 0
+
+/* Define to enable wide character (wchar_t) support. */
+/* #undef TRE_WCHAR */
+
+/* Version number of package */
+#define VERSION "0.8.0"
+
+/* Define to the maximum value of wchar_t if not already defined elsewhere */
+/* #undef WCHAR_MAX */
+
+/* Define if wchar_t is signed */
+/* #undef WCHAR_T_SIGNED */
+
+/* Define if wchar_t is unsigned */
+/* #undef WCHAR_T_UNSIGNED */
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define to enable GNU extensions in glibc */
+#define _GNU_SOURCE 1
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define on IRIX */
+#define _REGCOMP_INTERNAL 1
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
diff -r 7eab642047f0 -r e10b2275b854 external/bsd/tre/dist/lib/regcomp.c
--- a/external/bsd/tre/dist/lib/regcomp.c       Sat Sep 04 11:10:16 2010 +0000
+++ b/external/bsd/tre/dist/lib/regcomp.c       Sat Sep 04 12:17:58 2010 +0000
@@ -18,6 +18,11 @@
 #include "tre-internal.h"
 #include "xmalloc.h"
 
+#ifdef __weak_alias
+__weak_alias(regcomp,_regcomp)
+__weak_alias(regfree,_regfree)



Home | Main Index | Thread Index | Old Index