Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/tre make this work:



details:   https://anonhg.NetBSD.org/src/rev/a8626694adcb
branches:  trunk
changeset: 770999:a8626694adcb
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Nov 05 22:39:12 2011 +0000

description:
make this work:
- split alloca stuff in a separate file
- fix size_t/int/long inconsistencies
- fix weak alias stuff
- make paths consistent
- fix config files
- use switch instead of if/then/elseif...
- fix Makefiles

diffstat:

 external/bsd/tre/Makefile                       |    3 +
 external/bsd/tre/Makefile.inc                   |   18 +-
 external/bsd/tre/agrep/Makefile                 |   16 -
 external/bsd/tre/agrep/agrep.1                  |  205 ------------------
 external/bsd/tre/bin/Makefile                   |   18 +
 external/bsd/tre/bin/agrep.1                    |  205 ++++++++++++++++++
 external/bsd/tre/dist/config.h                  |  259 ------------------------
 external/bsd/tre/dist/lib/regcomp.c             |   11 +-
 external/bsd/tre/dist/lib/regerror.c            |    4 -
 external/bsd/tre/dist/lib/regexec.c             |   21 +-
 external/bsd/tre/dist/lib/tre-alloca.h          |   17 +
 external/bsd/tre/dist/lib/tre-ast.h             |    8 +-
 external/bsd/tre/dist/lib/tre-compile.c         |  104 ++++----
 external/bsd/tre/dist/lib/tre-config.h          |   44 ----
 external/bsd/tre/dist/lib/tre-internal.h        |   10 +-
 external/bsd/tre/dist/lib/tre-match-approx.c    |   38 +--
 external/bsd/tre/dist/lib/tre-match-backtrack.c |   29 +--
 external/bsd/tre/dist/lib/tre-match-parallel.c  |   31 +--
 external/bsd/tre/dist/lib/tre-match-utils.h     |   63 ++---
 external/bsd/tre/dist/lib/tre-mem.c             |    2 +-
 external/bsd/tre/dist/lib/tre-parse.c           |   62 ++--
 external/bsd/tre/dist/lib/tre-parse.h           |    2 +-
 external/bsd/tre/dist/lib/tre-stack.c           |    6 +-
 external/bsd/tre/dist/lib/tre-stack.h           |    6 +-
 external/bsd/tre/dist/lib/tre.h                 |    8 +-
 external/bsd/tre/dist/lib/xmalloc.c             |    2 +-
 external/bsd/tre/include/config.h               |  259 ++++++++++++++++++++++++
 external/bsd/tre/include/tre-config.h           |   44 ++++
 external/bsd/tre/lib/Makefile                   |   24 ++
 external/bsd/tre/lib/shlib_version              |    2 +
 external/bsd/tre/libtre/Makefile                |   24 --
 external/bsd/tre/libtre/config.h                |  259 ------------------------
 external/bsd/tre/libtre/shlib_version           |    2 -
 external/bsd/tre/libtre/tre-config.h            |   44 ----
 34 files changed, 742 insertions(+), 1108 deletions(-)

diffs (truncated from 2674 to 300 lines):

diff -r f54cbca22837 -r a8626694adcb external/bsd/tre/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/tre/Makefile Sat Nov 05 22:39:12 2011 +0000
@@ -0,0 +1,3 @@
+# $NetBSD: Makefile,v 1.1 2011/11/05 22:39:12 christos Exp $
+SUBDIR=        lib .WAIT bin
+.include "bsd.subdir.mk"
diff -r f54cbca22837 -r a8626694adcb external/bsd/tre/Makefile.inc
--- a/external/bsd/tre/Makefile.inc     Sat Nov 05 19:19:29 2011 +0000
+++ b/external/bsd/tre/Makefile.inc     Sat Nov 05 22:39:12 2011 +0000
@@ -1,23 +1,13 @@
-#      $NetBSD: Makefile.inc,v 1.1 2010/09/04 12:17:58 ahoka Exp $
+#      $NetBSD: Makefile.inc,v 1.2 2011/11/05 22:39:12 christos 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+=     -I${TREDIST}/lib -I${.CURDIR}/../include
 CPPFLAGS+=     -DHAVE_CONFIG_H=1
+CPPFLAGS+=     -DTRE_SYSTEM_REGEX_H_PATH=\"${NETBSDSRCDIR}/include/regex.h\"
+CPPFLAGS+=     -DTRE_USE_SYSTEM_REGEX_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 f54cbca22837 -r a8626694adcb external/bsd/tre/agrep/Makefile
--- a/external/bsd/tre/agrep/Makefile   Sat Nov 05 19:19:29 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#      $NetBSD: Makefile,v 1.1 2010/02/25 08:06:43 agc Exp $
-
-TREDIST=       ${.CURDIR}/../dist
-
-.PATH: ${TREDIST}/src
-
-CPPFLAGS+=     -I${TREDIST}/lib -I${.CURDIR}/../libtre
-CPPFLAGS+=     -DHAVE_CONFIG_H=1
-
-PROG=          agrep
-SRCS=          agrep.c
-LDADD+=                -ltre
-
-WARNS= 4
-
-.include <bsd.prog.mk>
diff -r f54cbca22837 -r a8626694adcb external/bsd/tre/agrep/agrep.1
--- a/external/bsd/tre/agrep/agrep.1    Sat Nov 05 19:19:29 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +0,0 @@
-.\" $NetBSD: agrep.1,v 1.3 2010/02/25 13:51:44 wiz Exp $
-.Dd November 21, 2004
-.Dt AGREP 1
-.Os
-.Sh NAME
-.Nm agrep
-.Nd print lines approximately matching a pattern
-.Sh SYNOPSIS
-.Nm
-.Op options
-.Ar pattern
-.Op files
-.Sh DESCRIPTION
-Searches for approximate matches of
-.Ar pattern
-in each
-.Ar FILE
-or standard input.
-.Sh OPTIONS
-.Ss Regexp selection and interpretation
-.Bl -tag -width 10n
-.It Fl e Ar pattern , Fl Fl regexp= Ns Ar pattern
-Use
-.Ar PATTERN
-as a regular expression; useful to protect patterns beginning with
-.Sq - .
-.It Fl i , Fl Fl ignore-case
-Ignore case distinctions (as defined by the current locale) in
-.Ar pattern
-and input files.
-.It Fl k , Fl Fl literal
-Treat
-.Ar pattern
-as a literal string, that is, a fixed string with no special
-characters.
-.It Fl w , Fl Fl word-regexp
-Force
-.Ar pattern
-to match only whole words.
-A
-.Dq whole word
-is a substring which either starts at the beginning
-or the record or is preceded by a non-word constituent character.
-Similarly, the substring must either end at the end of the record
-or be followed by a non-word constituent character.
-Word-constituent characters are alphanumerics (as
-defined by the current locale) and the underscore character.
-Note that the non-word constituent characters
-.Em must
-surround the match; they cannot be counted as errors.
-.El
-.Ss Approximate matching settings
-.Bl -tag -width 10n
-.It Fl D Ar num , Fl Fl delete-cost= Ns Ar num
-Set cost of missing characters to
-.Ar num .
-.It Fl I Ar num , Fl Fl insert-cost= Ns Ar num
-Set cost of extra characters to
-.Ar num .
-.It Fl S Ar num , Fl Fl substitue-cost= Ns Ar num
-Set cost of incorrect characters to
-.Ar num .
-Note that a deletion (a missing character) and an insertion (an extra
-character) together constitute a substituted character, but the cost
-will be the that of a deletion and an insertion added together.
-Thus, if the const of a substitution is set to be larger than the
-sum of the costs of deletion and insertion, direct substitutions
-will never be done.
-.It Fl E num , Fl Fl max-errors= Ns Ar num
-Select records that have at most
-.Ar num
-errors.
-.It Fl Ns Ar #
-Select records that have at most
-.Ar #
-errors
-.Ar ( #
-is a digit between 0 and 9).
-.El
-.Ss Miscellaneous
-.Bl -tag -width 10n
-.It Fl d pattern , Fl Fl delimiter= Ns Ar pattern
-Set the record delimiter regular expression to
-.Ar pattern .
-The text between two delimiters, before the first delimiter, and after
-the last delimiter is considered to be a record.
-The default record
-delimiter is the regexp
-.Dq \en ,
-so by default a record is a line.
-.Ar pattern
-can be any regular expression that does not match the empty string.
-For example, using
-.Fl d Ar \"^From \"
-defines mail messages as records in a Mailbox format file.
-.It Fl v , Fl Fl invert-match
-Select non-matching records instead of matching records.
-.It Fl V , Fl Fl version
-Print version information and exit.
-.It Fl y , Fl Fl nothing
-Does nothing.
-This options exists only for compatibility with the
-non-free agrep program.
-.It Fl Fl help
-Display a brief help message and exit.
-.El
-.Ss Output control
-.Bl -tag -width 10n
-.It Fl B , Fl Fl best-match
-Only output the best matching records, that is, the records with the
-lowest cost.
-This is currently implemented by making two passes over
-the input files and cannot be used when reading from standard input.
-.It Fl Fl color , Fl Fl colour
-Highlight the matching strings in the output with a color marker.
-The color string is taken from the
-.Ev GREP_COLOR
-environment variable.
-The default color is red.
-.It Fl c , Fl Fl count
-Only print a count of matching records per each input file,
-suppressing normal output.
-.It Fl h , Fl Fl no-filename
-Suppress the prefixing filename on output when multiple files are
-searched.
-.It Fl H , Fl Fl with-filename
-Prefix each output record with the name of the input file where the
-record was read from.
-.It Fl l , Fl Fl files-with-matches
-Only print the name of each input file which contains at least one
-match, suppressing normal output.
-The scanning for each file will stop on the first match.
-.It Fl n , Fl Fl record-number
-Prefix each output record with its sequence number in the input file.
-The number of the first record is 1.
-.It Fl q , Fl Fl quiet , Fl Fl silent
-Do not write anything to standard output.
-Exit immediately with zero exit status if a match is found.
-.It Fl s , Fl Fl show-cost
-Print match cost with output.
-.It Fl Fl show-position
-Prefix each output record with the start and end offset of the first
-match within the record.
-The offset of the first character of the record is 0.
-The end position is given as the offset of the first
-character after the match.
-.It Fl M , Fl Fl delimiter-after
-By default, the record delimiter is the newline character and is
-output after the matching record.
-If
-.Fl d
-is used, the record delimiter will be output before the matching
-record.
-This option causes the delimiter to be output after the
-matching record.
-.El
-.Pp
-With no
-.Ar file ,
-or when
-.Ar file
-is
-.Dq - ,
-.Nm
-reads standard input.
-If less than two
-.Ar files
-are given
-.Fl h
-is assumed, otherwise
-.Fl H
-is the default.
-.Sh EXAMPLES
-.Dl agrep \-2 optimize foo.txt
-outputs all lines in file
-.Pa foo.txt
-that match
-.Dq optimize
-within two errors.
-E.g. lines which contain
-.Dq optimise ,
-.Dq optmise ,
-and
-.Dq opitmize
-all match.
-.Sh DIAGNOSTICS
-Exit status is 0 if a match is found, 1 for no match, and 2 if there
-were errors.
-If
-.Fl E
-or
-.Fl Ns Ar #
-is not specified, only exact matches are selected.
-.Pp
-.Ar pattern
-is a POSIX extended regular expression (ERE) with the TRE extensions.
-.Sh REPORTING BUGS
-Report bugs to the TRE mailing list
-.Aq tre-general%lists.laurikari.net@localhost .
-.Sh COPYRIGHT
-Copyright \(co 2002-2004 Ville Laurikari.
-.Pp
-This is free software, and comes with ABSOLUTELY NO WARRANTY.
-You are welcome to redistribute this software under certain
-conditions; see the source for the full license text.
diff -r f54cbca22837 -r a8626694adcb external/bsd/tre/bin/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/tre/bin/Makefile     Sat Nov 05 22:39:12 2011 +0000
@@ -0,0 +1,18 @@
+#      $NetBSD: Makefile,v 1.1 2011/11/05 22:39:13 christos Exp $
+
+TREDIST=       ${.CURDIR}/../dist
+
+.PATH: ${TREDIST}/src
+
+CPPFLAGS+=     -I${TREDIST}/lib -I${.CURDIR}/../libtre
+CPPFLAGS+=     -DHAVE_CONFIG_H=1
+
+BINDIR=                /usr/bin
+PROG=          agrep
+SRCS=          agrep.c
+LDADD+=                -ltre
+DPADD+=                ${LIBTRE}
+
+WARNS= 4
+
+.include <bsd.prog.mk>
diff -r f54cbca22837 -r a8626694adcb external/bsd/tre/bin/agrep.1
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/tre/bin/agrep.1      Sat Nov 05 22:39:12 2011 +0000
@@ -0,0 +1,205 @@
+.\" $NetBSD: agrep.1,v 1.1 2011/11/05 22:39:13 christos Exp $
+.Dd November 21, 2004
+.Dt AGREP 1
+.Os
+.Sh NAME
+.Nm agrep
+.Nd print lines approximately matching a pattern



Home | Main Index | Thread Index | Old Index