提交 e85f06ee authored 作者: James Le Cuirot's avatar James Le Cuirot 提交者: Travis Cross

Completely unbundle pcre

FS-353
Signed-off-by: 's avatarTravis Cross <tc@traviscross.com>
上级 3ec53f0b
...@@ -84,7 +84,6 @@ CORE_CFLAGS = $(AM_LIBAPR_CFLAGS) $(AM_LIBAPR_CPPFLAGS) ...@@ -84,7 +84,6 @@ CORE_CFLAGS = $(AM_LIBAPR_CFLAGS) $(AM_LIBAPR_CPPFLAGS)
CORE_CFLAGS += $(AM_LIBAPU_CPPFLAGS) CORE_CFLAGS += $(AM_LIBAPU_CPPFLAGS)
CORE_CFLAGS += -I$(switch_srcdir)/libs/libtpl-1.5/src CORE_CFLAGS += -I$(switch_srcdir)/libs/libtpl-1.5/src
CORE_CFLAGS += -I$(switch_builddir)/libs/sqlite CORE_CFLAGS += -I$(switch_builddir)/libs/sqlite
CORE_CFLAGS += -I$(switch_srcdir)/libs/pcre
CORE_CFLAGS += -I$(switch_srcdir)/libs/speex/include -Ilibs/speex/include CORE_CFLAGS += -I$(switch_srcdir)/libs/speex/include -Ilibs/speex/include
CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/include CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/include
CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/crypto/include -Ilibs/srtp/crypto/include CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/crypto/include -Ilibs/srtp/crypto/include
...@@ -93,7 +92,7 @@ CORE_CFLAGS += -I$(switch_builddir)/libs/tiff-4.0.2/libtiff -I$(switch_srcdir)/l ...@@ -93,7 +92,7 @@ CORE_CFLAGS += -I$(switch_builddir)/libs/tiff-4.0.2/libtiff -I$(switch_srcdir)/l
APR_LIBS = $(AM_LIBAPU_LIBS) $(AM_LIBAPR_LIBS) APR_LIBS = $(AM_LIBAPU_LIBS) $(AM_LIBAPR_LIBS)
CORE_LIBS = libs/apr-util/libaprutil-1.la libs/apr/libapr-1.la CORE_LIBS = libs/apr-util/libaprutil-1.la libs/apr/libapr-1.la
CORE_LIBS += libs/sqlite/libsqlite3.la libs/pcre/libpcre.la libs/speex/libspeex/libspeexdsp.la libs/speex/libspeex/libspeex.la CORE_LIBS += libs/sqlite/libsqlite3.la libs/speex/libspeex/libspeexdsp.la libs/speex/libspeex/libspeex.la
if ENABLE_SRTP if ENABLE_SRTP
CORE_CFLAGS += -DENABLE_SRTP CORE_CFLAGS += -DENABLE_SRTP
...@@ -125,9 +124,9 @@ libfreeswitch_spandsp_la_SOURCES = libs/spandsp/src/plc.c libs/spandsp/src/alloc ...@@ -125,9 +124,9 @@ libfreeswitch_spandsp_la_SOURCES = libs/spandsp/src/plc.c libs/spandsp/src/alloc
libfreeswitch_spandsp_la_CFLAGS = -Ilibs/spandsp/src $(CORE_CFLAGS) $(AM_CFLAGS) libfreeswitch_spandsp_la_CFLAGS = -Ilibs/spandsp/src $(CORE_CFLAGS) $(AM_CFLAGS)
CORE_LIBS+=libfreeswitch_spandsp.la CORE_LIBS+=libfreeswitch_spandsp.la
lib_LTLIBRARIES = libfreeswitch.la lib_LTLIBRARIES = libfreeswitch.la
libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(AM_CFLAGS) libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(PCRE_CFLAGS) $(AM_CFLAGS)
libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -shared -no-undefined libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -shared -no-undefined
libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(PLATFORM_CORE_LIBS) libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(PCRE_LIBS) $(PLATFORM_CORE_LIBS)
libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES)
if CURL_BUILTIN if CURL_BUILTIN
...@@ -482,11 +481,6 @@ libs/sqlite/Makefile: libs/sqlite/configure.ac ...@@ -482,11 +481,6 @@ libs/sqlite/Makefile: libs/sqlite/configure.ac
cd libs/sqlite && ./config.status cd libs/sqlite && ./config.status
@$(TOUCH_TARGET) @$(TOUCH_TARGET)
libs/pcre/libpcre.la: libs/pcre libs/pcre/.update
touch $(switch_srcdir)/src/include/switch.h
@cd libs/pcre && $(MAKE)
@$(TOUCH_TARGET)
SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/srtp/ekt.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \ SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/srtp/ekt.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \
libs/srtp/crypto/cipher/aes.c libs/srtp/crypto/cipher/aes_icm.c \ libs/srtp/crypto/cipher/aes.c libs/srtp/crypto/cipher/aes_icm.c \
libs/srtp/crypto/cipher/aes_cbc.c \ libs/srtp/crypto/cipher/aes_cbc.c \
......
...@@ -1102,6 +1102,7 @@ AM_CONDITIONAL([CURL_BUILTIN],[test "${ac_cv_use_system_curl}" != "yes"]) ...@@ -1102,6 +1102,7 @@ AM_CONDITIONAL([CURL_BUILTIN],[test "${ac_cv_use_system_curl}" != "yes"])
AC_SUBST(LIBCURL_DEPS) AC_SUBST(LIBCURL_DEPS)
PKG_CHECK_MODULES([PCRE], [libpcre >= 7.9])
AC_ARG_ENABLE(core-libedit-support, AC_ARG_ENABLE(core-libedit-support,
[AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])], [enable_core_libedit_support="$enableval"], [enable_core_libedit_support="yes"]) [AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])], [enable_core_libedit_support="$enableval"], [enable_core_libedit_support="yes"])
...@@ -1492,7 +1493,6 @@ if test "$enable_core_libedit_support" = "yes" ; then ...@@ -1492,7 +1493,6 @@ if test "$enable_core_libedit_support" = "yes" ; then
AC_CONFIG_SUBDIRS([libs/libedit]) AC_CONFIG_SUBDIRS([libs/libedit])
fi fi
AC_CONFIG_SUBDIRS([libs/pcre])
AC_CONFIG_SUBDIRS([libs/apr]) AC_CONFIG_SUBDIRS([libs/apr])
AC_CONFIG_SUBDIRS([libs/apr-util]) AC_CONFIG_SUBDIRS([libs/apr-util])
AC_CONFIG_SUBDIRS([libs/ilbc]) AC_CONFIG_SUBDIRS([libs/ilbc])
......
...@@ -1821,14 +1821,6 @@ Copyright: 2008-2010, Eric des Courtis <eric.des.courtis@benbria.com> ...@@ -1821,14 +1821,6 @@ Copyright: 2008-2010, Eric des Courtis <eric.des.courtis@benbria.com>
Benbria. Benbria.
License: MPL-1.1 License: MPL-1.1
Files: libs/pcre/*
Copyright: 1997-2009 University of Cambridge
2003 and onwards Google Inc.
2005-2006, Google Inc
2001 Alexander Tokarev <dwalin@dwalin.ru>
2001 Peter S. Voronov aka Chem O'Dun <petervrn@yahoo.com>
License: BSD-3-clause
Files: libs/silk/* Files: libs/silk/*
Copyright: 2006-2011, Skype Limited. Copyright: 2006-2011, Skype Limited.
License: BSD-2-clause License: BSD-2-clause
......
...@@ -1243,7 +1243,7 @@ SEARCH_INCLUDES = YES ...@@ -1243,7 +1243,7 @@ SEARCH_INCLUDES = YES
INCLUDE_PATH =../libs/apr ../libs/apr-util ../libs/curl \ INCLUDE_PATH =../libs/apr ../libs/apr-util ../libs/curl \
../libs/iksemel ../libs/ilbc ../libs/js \ ../libs/iksemel ../libs/ilbc ../libs/js \
../libs/libedit ../libs/libg722_1 ../libs/libnatpmp \ ../libs/libedit ../libs/libg722_1 ../libs/libnatpmp \
../libs/libsndfile ../libs/miniupnpc ../libs/pcre \ ../libs/libsndfile ../libs/miniupnpc \
../libs/portaudio ../libs/sofia-sip ../libs/spandsp \ ../libs/portaudio ../libs/sofia-sip ../libs/spandsp \
../libs/speex ../libs/sqlite ../libs/srtp \ ../libs/speex ../libs/sqlite ../libs/srtp \
../libs/tiff-4.0.2 ../libs/udns \ ../libs/tiff-4.0.2 ../libs/udns \
......
...@@ -408,20 +408,6 @@ opal ...@@ -408,20 +408,6 @@ opal
/openzap/INSTALL /openzap/INSTALL
/openzap/Makefile.in /openzap/Makefile.in
/opus-*/ /opus-*/
/pcre/config.h
/pcre/Makefile
/pcre/Makefile.in
/pcre/pcre_chartables.c
/pcre/pcre-config
/pcre/pcrecpparg.h
/pcre/pcrecpp_unittest
/pcre/pcregrep
/pcre/pcre_scanner_unittest
/pcre/pcre_stringpiece.h
/pcre/pcre_stringpiece_unittest
/pcre/pcretest
/pcre/stamp-h1
/pcre-*/
/pocketsphinx-*/ /pocketsphinx-*/
/portaudio/bin/ /portaudio/bin/
/portaudio/bin-stamp /portaudio/bin-stamp
...@@ -1012,7 +998,6 @@ opal ...@@ -1012,7 +998,6 @@ opal
!/libdingaling/missing !/libdingaling/missing
!/libg722_1/config/depcomp !/libg722_1/config/depcomp
!/libg722_1/config/missing !/libg722_1/config/missing
!/pcre/depcomp
!/portaudio/bindings/cpp/build/gnu/aclocal.m4 !/portaudio/bindings/cpp/build/gnu/aclocal.m4
!/portaudio/bindings/cpp/build/gnu/config.guess !/portaudio/bindings/cpp/build/gnu/config.guess
!/portaudio/bindings/cpp/build/gnu/config.sub !/portaudio/bindings/cpp/build/gnu/config.sub
......
Mon Jun 8 19:51:53 EDT 2009
#! /usr/bin/perl -w
# Script to turn PCRE man pages into HTML
# Subroutine to handle font changes and other escapes
sub do_line {
my($s) = $_[0];
$s =~ s/</&#60;/g; # Deal with < and >
$s =~ s/>/&#62;/g;
$s =~ s"\\fI(.*?)\\f[RP]"<i>$1</i>"g;
$s =~ s"\\fB(.*?)\\f[RP]"<b>$1</b>"g;
$s =~ s"\\e"\\"g;
$s =~ s/(?<=Copyright )\(c\)/&copy;/g;
$s;
}
# Subroutine to ensure not in a paragraph
sub end_para {
if ($inpara)
{
print TEMP "</PRE>\n" if ($inpre);
print TEMP "</P>\n";
}
$inpara = $inpre = 0;
$wrotetext = 0;
}
# Subroutine to start a new paragraph
sub new_para {
&end_para();
print TEMP "<P>\n";
$inpara = 1;
}
# Main program
$innf = 0;
$inpara = 0;
$inpre = 0;
$wrotetext = 0;
$toc = 0;
$ref = 1;
while ($#ARGV >= 0 && $ARGV[0] =~ /^-/)
{
$toc = 1 if $ARGV[0] eq "-toc";
shift;
}
# Initial output to STDOUT
print <<End ;
<html>
<head>
<title>$ARGV[0] specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>$ARGV[0] man page</h1>
<p>
Return to the <a href="index.html">PCRE index page</a>.
</p>
<p>
This page is part of the PCRE HTML documentation. It was generated automatically
from the original man page. If there is any nonsense in it, please consult the
man page, in case the conversion went wrong.
<br>
End
print "<ul>\n" if ($toc);
open(TEMP, ">/tmp/$$") || die "Can't open /tmp/$$ for output\n";
while (<STDIN>)
{
# Handle lines beginning with a dot
if (/^\./)
{
# Some of the PCRE man pages used to contain instances of .br. However,
# they should have all been removed because they cause trouble in some
# (other) automated systems that translate man pages to HTML. Complain if
# we find .br or .in (another macro that is deprecated).
if (/^\.br/ || /^\.in/)
{
print STDERR "\n*** Deprecated macro encountered - rewrite needed\n";
print STDERR "*** $_\n";
die "*** Processing abandoned\n";
}
# Instead of .br, relevent "literal" sections are enclosed in .nf/.fi.
elsif (/^\.nf/)
{
$innf = 1;
}
elsif (/^\.fi/)
{
$innf = 0;
}
# Handling .sp is subtle. If it is inside a literal section, do nothing if
# the next line is a non literal text line; similarly, if not inside a
# literal section, do nothing if a literal follows. The point being that
# the <pre> and </pre> that delimit literal sections will do the spacing.
# Always skip if no previous output.
elsif (/^\.sp/)
{
if ($wrotetext)
{
$_ = <STDIN>;
if ($inpre)
{
print TEMP "\n" if (/^[\s.]/);
}
else
{
print TEMP "<br>\n<br>\n" if (!/^[\s.]/);
}
redo; # Now process the lookahead line we just read
}
}
elsif (/^\.TP/ || /^\.PP/ || /^\.P/)
{
&new_para();
}
elsif (/^\.SH\s*("?)(.*)\1/)
{
# Ignore the NAME section
if ($2 =~ /^NAME\b/)
{
<STDIN>;
next;
}
&end_para();
my($title) = &do_line($2);
if ($toc)
{
printf("<li><a name=\"TOC%d\" href=\"#SEC%d\">$title</a>\n",
$ref, $ref);
printf TEMP ("<br><a name=\"SEC%d\" href=\"#TOC1\">$title</a><br>\n",
$ref, $ref);
$ref++;
}
else
{
print TEMP "<br><b>\n$title\n</b><br>\n";
}
}
elsif (/^\.SS\s*("?)(.*)\1/)
{
&end_para();
my($title) = &do_line($2);
print TEMP "<br><b>\n$title\n</b><br>\n";
}
elsif (/^\.B\s*(.*)/)
{
&new_para() if (!$inpara);
$_ = &do_line($1);
s/"(.*?)"/$1/g;
print TEMP "<b>$_</b>\n";
$wrotetext = 1;
}
elsif (/^\.I\s*(.*)/)
{
&new_para() if (!$inpara);
$_ = &do_line($1);
s/"(.*?)"/$1/g;
print TEMP "<i>$_</i>\n";
$wrotetext = 1;
}
# A comment that starts "HREF" takes the next line as a name that
# is turned into a hyperlink, using the text given, which might be
# in a special font. If it ends in () or (digits) or punctuation, they
# aren't part of the link.
elsif (/^\.\\"\s*HREF/)
{
$_=<STDIN>;
chomp;
$_ = &do_line($_);
$_ =~ s/\s+$//;
$_ =~ /^(?:<.>)?([^<(]+)(?:\(\))?(?:<\/.>)?(?:\(\d+\))?[.,;:]?$/;
print TEMP "<a href=\"$1.html\">$_</a>\n";
}
# A comment that starts "HTML" inserts literal HTML
elsif (/^\.\\"\s*HTML\s*(.*)/)
{
print TEMP $1;
}
# A comment that starts < inserts that HTML at the end of the
# *next* input line - so as not to get a newline between them.
elsif (/^\.\\"\s*(<.*>)/)
{
my($markup) = $1;
$_=<STDIN>;
chomp;
$_ = &do_line($_);
$_ =~ s/\s+$//;
print TEMP "$_$markup\n";
}
# A comment that starts JOIN joins the next two lines together, with one
# space between them. Then that line is processed. This is used in some
# displays where two lines are needed for the "man" version. JOINSH works
# the same, except that it assumes this is a shell command, so removes
# continuation backslashes.
elsif (/^\.\\"\s*JOIN(SH)?/)
{
my($one,$two);
$one = <STDIN>;
$two = <STDIN>;
$one =~ s/\s*\\e\s*$// if (defined($1));
chomp($one);
$two =~ s/^\s+//;
$_ = "$one $two";
redo; # Process the joined lines
}
# Ignore anything not recognized
next;
}
# Line does not begin with a dot. Replace blank lines with new paragraphs
if (/^\s*$/)
{
&end_para() if ($wrotetext);
next;
}
# Convert fonts changes and output an ordinary line. Ensure that indented
# lines are marked as literal.
$_ = &do_line($_);
&new_para() if (!$inpara);
if (/^\s/)
{
if (!$inpre)
{
print TEMP "<pre>\n";
$inpre = 1;
}
}
elsif ($inpre)
{
print TEMP "</pre>\n";
$inpre = 0;
}
# Add <br> to the end of a non-literal line if we are within .nf/.fi
$_ .= "<br>\n" if (!$inpre && $innf);
print TEMP;
$wrotetext = 1;
}
# The TOC, if present, will have been written - terminate it
print "</ul>\n" if ($toc);
# Copy the remainder to the standard output
close(TEMP);
open(TEMP, "/tmp/$$") || die "Can't open /tmp/$$ for input\n";
print while (<TEMP>);
print <<End ;
<p>
Return to the <a href="index.html">PCRE index page</a>.
</p>
End
close(TEMP);
unlink("/tmp/$$");
# End
THE MAIN PCRE LIBRARY
---------------------
Written by: Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
Copyright (c) 1997-2009 University of Cambridge
All rights reserved
THE C++ WRAPPER LIBRARY
-----------------------
Written by: Google Inc.
Copyright (c) 2007-2008 Google Inc
All rights reserved
####
差异被折叠。
PCRE LICENCE
Please see the file LICENCE in the PCRE distribution for licensing details.
End
This source diff could not be displayed because it is too large. You can view the blob instead.
#! /usr/bin/perl -w
# Script to take the output of nroff -man and remove all the backspacing and
# the page footers and the screen commands etc so that it is more usefully
# readable online. In fact, in the latest nroff, intermediate footers don't
# seem to be generated any more.
$blankcount = 0;
$lastwascut = 0;
$firstheader = 1;
# Input on STDIN; output to STDOUT.
while (<STDIN>)
{
s/\x1b\[\d+m//g; # Remove screen controls "ESC [ number m"
s/.\x8//g; # Remove "char, backspace"
# Handle header lines. Retain only the first one we encounter, but remove
# the blank line that follows. Any others (e.g. at end of document) and the
# following blank line are dropped.
if (/^PCRE(\w*)\(([13])\)\s+PCRE\1\(\2\)$/)
{
if ($firstheader)
{
$firstheader = 0;
print;
$lastprinted = $_;
$lastwascut = 0;
}
$_=<STDIN>; # Remove a blank that follows
next;
}
# Count runs of empty lines
if (/^\s*$/)
{
$blankcount++;
$lastwascut = 0;
next;
}
# If a chunk of lines has been cut out (page footer) and the next line
# has a different indentation, put back one blank line.
if ($lastwascut && $blankcount < 1 && defined($lastprinted))
{
($a) = $lastprinted =~ /^(\s*)/;
($b) = $_ =~ /^(\s*)/;
$blankcount++ if ($a ne $b);
}
# We get here only when we have a non-blank line in hand. If it was preceded
# by 3 or more blank lines, read the next 3 lines and see if they are blank.
# If so, remove all 7 lines, and remember that we have just done a cut.
if ($blankcount >= 3)
{
for ($i = 0; $i < 3; $i++)
{
$next[$i] = <STDIN>;
$next[$i] = "" if !defined $next[$i];
$next[$i] =~ s/\x1b\[\d+m//g; # Remove screen controls "ESC [ number m"
$next[$i] =~ s/.\x8//g; # Remove "char, backspace"
}
# Cut out chunks of the form <3 blanks><non-blank><3 blanks>
if ($next[0] =~ /^\s*$/ &&
$next[1] =~ /^\s*$/ &&
$next[2] =~ /^\s*$/)
{
$blankcount -= 3;
$lastwascut = 1;
}
# Otherwise output the saved blanks, the current, and the next three
# lines. Remember the last printed line.
else
{
for ($i = 0; $i < $blankcount; $i++) { print "\n"; }
print;
for ($i = 0; $i < 3; $i++)
{
$next[$i] =~ s/.\x8//g;
print $next[$i];
$lastprinted = $_;
}
$lastwascut = 0;
$blankcount = 0;
}
}
# This non-blank line is not preceded by 3 or more blank lines. Output
# any blanks there are, and the line. Remember it. Force two blank lines
# before headings.
else
{
$blankcount = 2 if /^\S/ && !/^Last updated/ && !/^Copyright/ &&
defined($lastprinted);
for ($i = 0; $i < $blankcount; $i++) { print "\n"; }
print;
$lastprinted = $_;
$lastwascut = 0;
$blankcount = 0;
}
}
# End
#!/usr/bin/perl
# This is a script for removing trailing whitespace from lines in files that
# are listed on the command line.
# This subroutine does the work for one file.
sub detrail {
my($file) = $_[0];
my($changed) = 0;
open(IN, "$file") || die "Can't open $file for input";
@lines = <IN>;
close(IN);
foreach (@lines)
{
if (/\s+\n$/)
{
s/\s+\n$/\n/;
$changed = 1;
}
}
if ($changed)
{
open(OUT, ">$file") || die "Can't open $file for output";
print OUT @lines;
close(OUT);
}
}
# This is the main program
$, = ""; # Output field separator
for ($i = 0; $i < @ARGV; $i++) { &detrail($ARGV[$i]); }
# End
差异被折叠。
差异被折叠。
PCRE LICENCE
------------
PCRE is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.
Release 7 of PCRE is distributed under the terms of the "BSD" licence, as
specified below. The documentation for PCRE, supplied in the "doc"
directory, is distributed under the same terms as the software itself.
The basic library functions are written in C and are freestanding. Also
included in the distribution is a set of C++ wrapper functions.
THE BASIC LIBRARY FUNCTIONS
---------------------------
Written by: Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
Copyright (c) 1997-2009 University of Cambridge
All rights reserved.
THE C++ WRAPPER FUNCTIONS
-------------------------
Contributed by: Google Inc.
Copyright (c) 2007-2008, Google Inc.
All rights reserved.
THE "BSD" LICENCE
-----------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the University of Cambridge nor the name of Google
Inc. nor the names of their contributors may be used to endorse or
promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
End
## Process this file with automake to produce Makefile.in.
pcrecpp_html = doc/html/pcrecpp.html
dist_noinst_DATA = $(pcrecpp_html)
# The Libtool libraries to install. We'll add to this later.
lib_LTLIBRARIES =
# Unit tests you want to run when people type 'make check'.
# TESTS is for binary unit tests, check_SCRIPTS for script-based tests
TESTS =
check_SCRIPTS =
dist_noinst_SCRIPTS =
# Some of the binaries we make are to be installed, and others are
# (non-user-visible) helper programs needed to build libpcre.
bin_PROGRAMS =
noinst_PROGRAMS =
# Additional files to delete on 'make clean' and 'make maintainer-clean'.
CLEANFILES =
MAINTAINERCLEANFILES =
# Additional files to bundle with the distribution, over and above what
# the Autotools include by default.
EXTRA_DIST =
# These files contain maintenance information
EXTRA_DIST += \
doc/perltest.txt \
NON-UNIX-USE \
HACKING
# These files are used in the preparation of a release
EXTRA_DIST += \
PrepareRelease \
CleanTxt \
Detrail \
132html \
doc/index.html.src
# These files are to do with building for Virtual Pascal
EXTRA_DIST += \
makevp.bat \
makevp_c.txt \
makevp_l.txt \
pcregexp.pas
# These files are usable versions of pcre.h and config.h that are distributed
# for the benefit of people who are building PCRE manually, without the
# Autotools support.
EXTRA_DIST += \
pcre.h.generic \
config.h.generic
pcre.h.generic: configure.ac
rm -f $@
cp -p pcre.h $@
MAINTAINERCLEANFILES += pcre.h.generic
# These are the header files we'll install. We do not distribute pcre.h because
# it is generated from pcre.h.in.
nodist_include_HEADERS = \
pcre.h
include_HEADERS = \
pcreposix.h
# These additional headers will be be installed if C++ support is enabled. We
# do not distribute pcrecpparg.h or pcre_stringpiece.h, as these are generated
# from corresponding .h.in files (which we do distribute).
if WITH_PCRE_CPP
nodist_include_HEADERS += \
pcrecpparg.h \
pcre_stringpiece.h
include_HEADERS += \
pcrecpp.h \
pcre_scanner.h
endif # WITH_PCRE_CPP
bin_SCRIPTS = pcre-config
## ---------------------------------------------------------------
## The dftables program is used to rebuild character tables before compiling
## PCRE, if --enable-rebuild-chartables is specified. It is not a user-visible
## program. The default (when --enable-rebuild-chartables is not specified) is
## to copy a distributed set of tables that are defined for ASCII code. In this
## case, dftables is not needed.
if WITH_REBUILD_CHARTABLES
noinst_PROGRAMS += dftables
dftables_SOURCES = dftables.c
pcre_chartables.c: dftables$(EXEEXT)
./dftables$(EXEEXT) $@
else
pcre_chartables.c: $(srcdir)/pcre_chartables.c.dist
rm -f $@
$(LN_S) $(srcdir)/pcre_chartables.c.dist $@
endif # WITH_REBUILD_CHARTABLES
## The main pcre library
lib_LTLIBRARIES += libpcre.la
libpcre_la_SOURCES = \
pcre_compile.c \
pcre_config.c \
pcre_dfa_exec.c \
pcre_exec.c \
pcre_fullinfo.c \
pcre_get.c \
pcre_globals.c \
pcre_info.c \
pcre_internal.h \
pcre_maketables.c \
pcre_newline.c \
pcre_ord2utf8.c \
pcre_refcount.c \
pcre_study.c \
pcre_tables.c \
pcre_try_flipped.c \
pcre_ucd.c \
pcre_valid_utf8.c \
pcre_version.c \
pcre_xclass.c \
ucp.h
## This file is generated as part of the building process, so don't distribute.
nodist_libpcre_la_SOURCES = \
pcre_chartables.c
# The pcre_printint.src file is #included by some source files, so it must be
# distributed. The pcre_chartables.c.dist file is the default version of
# pcre_chartables.c, used unless --enable-rebuild-chartables is specified.
EXTRA_DIST += pcre_printint.src pcre_chartables.c.dist
libpcre_la_LDFLAGS = $(EXTRA_LIBPCRE_LDFLAGS)
CLEANFILES += pcre_chartables.c
## A version of the main pcre library that has a posix re API.
lib_LTLIBRARIES += libpcreposix.la
libpcreposix_la_SOURCES = \
pcreposix.c
libpcreposix_la_LDFLAGS = $(EXTRA_LIBPCREPOSIX_LDFLAGS)
libpcreposix_la_LIBADD = libpcre.la
## There's a C++ library as well.
if WITH_PCRE_CPP
lib_LTLIBRARIES += libpcrecpp.la
libpcrecpp_la_SOURCES = \
pcrecpp_internal.h \
pcrecpp.cc \
pcre_scanner.cc \
pcre_stringpiece.cc
libpcrecpp_la_LDFLAGS = $(EXTRA_LIBPCRECPP_LDFLAGS)
libpcrecpp_la_LIBADD = libpcre.la
TESTS += pcrecpp_unittest
noinst_PROGRAMS += pcrecpp_unittest
pcrecpp_unittest_SOURCES = pcrecpp_unittest.cc
pcrecpp_unittest_LDADD = libpcrecpp.la
TESTS += pcre_scanner_unittest
noinst_PROGRAMS += pcre_scanner_unittest
pcre_scanner_unittest_SOURCES = pcre_scanner_unittest.cc
pcre_scanner_unittest_LDADD = libpcrecpp.la
TESTS += pcre_stringpiece_unittest
noinst_PROGRAMS += pcre_stringpiece_unittest
pcre_stringpiece_unittest_SOURCES = pcre_stringpiece_unittest.cc
pcre_stringpiece_unittest_LDADD = libpcrecpp.la
endif # WITH_PCRE_CPP
## The main unit tests
# Each unit test is a binary plus a script that runs that binary in various
# ways. We install these test binaries in case folks find it helpful.
TESTS += RunTest
dist_noinst_SCRIPTS += RunTest
EXTRA_DIST += RunTest.bat
bin_PROGRAMS += pcretest
pcretest_SOURCES = pcretest.c
pcretest_LDADD = libpcreposix.la $(LIBREADLINE)
TESTS += RunGrepTest
dist_noinst_SCRIPTS += RunGrepTest
bin_PROGRAMS += pcregrep
pcregrep_SOURCES = pcregrep.c
pcregrep_LDADD = libpcreposix.la $(LIBZ) $(LIBBZ2)
EXTRA_DIST += \
testdata/grepinput \
testdata/grepinput8 \
testdata/grepinputv \
testdata/grepinputx \
testdata/greplist \
testdata/grepoutput \
testdata/grepoutput8 \
testdata/grepoutputN \
testdata/testinput1 \
testdata/testinput2 \
testdata/testinput3 \
testdata/testinput4 \
testdata/testinput5 \
testdata/testinput6 \
testdata/testinput7 \
testdata/testinput8 \
testdata/testinput9 \
testdata/testinput10 \
testdata/testoutput1 \
testdata/testoutput2 \
testdata/testoutput3 \
testdata/testoutput4 \
testdata/testoutput5 \
testdata/testoutput6 \
testdata/testoutput7 \
testdata/testoutput8 \
testdata/testoutput9 \
testdata/testoutput10 \
testdata/wintestinput3 \
testdata/wintestoutput3 \
perltest.pl
CLEANFILES += \
testsavedregex \
teststderr \
testtry \
testNinput
# PCRE demonstration program. No longer built automatcally. The point is that
# the users should build it themselves. So just distribute the source.
# noinst_PROGRAMS += pcredemo
# pcredemo_SOURCES = pcredemo.c
# pcredemo_LDADD = libpcre.la
EXTRA_DIST += pcredemo.c
## Utility rules, documentation, etc.
# A compatibility line, the old build system worked with 'make test'
test: check ;
# A PCRE user submitted the following addition, saying that it "will allow
# anyone using the 'mingw32' compiler to simply type 'make pcre.dll' and get a
# nice DLL for Windows use". (It is used by the pcre.dll target.)
DLL_OBJS= pcre_compile.o pcre_config.o \
pcre_dfa_exec.o pcre_exec.o pcre_fullinfo.o pcre_get.o \
pcre_globals.o pcre_info.o pcre_maketables.o \
pcre_newline.o pcre_ord2utf8.o pcre_refcount.o \
pcre_study.o pcre_tables.o pcre_try_flipped.o \
pcre_ucd.o pcre_valid_utf8.o pcre_version.o \
pcre_chartables.o \
pcre_xclass.o
# A PCRE user submitted the following addition, saying that it "will allow
# anyone using the 'mingw32' compiler to simply type 'make pcre.dll' and get a
# nice DLL for Windows use".
pcre.dll: $(DLL_OBJS)
$(CC) -shared -o pcre.dll -Wl,"--strip-all" -Wl,"--export-all-symbols" $(DLL_OBJS)
# We have .pc files for pkg-config users.
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libpcre.pc
if WITH_PCRE_CPP
pkgconfig_DATA += libpcrecpp.pc
endif
dist_man_MANS = \
doc/pcre.3 \
doc/pcre-config.1 \
doc/pcre_compile.3 \
doc/pcre_compile2.3 \
doc/pcre_config.3 \
doc/pcre_copy_named_substring.3 \
doc/pcre_copy_substring.3 \
doc/pcre_dfa_exec.3 \
doc/pcre_exec.3 \
doc/pcre_free_substring.3 \
doc/pcre_free_substring_list.3 \
doc/pcre_fullinfo.3 \
doc/pcre_get_named_substring.3 \
doc/pcre_get_stringnumber.3 \
doc/pcre_get_stringtable_entries.3 \
doc/pcre_get_substring.3 \
doc/pcre_get_substring_list.3 \
doc/pcre_info.3 \
doc/pcre_maketables.3 \
doc/pcre_refcount.3 \
doc/pcre_study.3 \
doc/pcre_version.3 \
doc/pcreapi.3 \
doc/pcrebuild.3 \
doc/pcrecallout.3 \
doc/pcrecompat.3 \
doc/pcregrep.1 \
doc/pcrematching.3 \
doc/pcrepartial.3 \
doc/pcrepattern.3 \
doc/pcreperform.3 \
doc/pcreposix.3 \
doc/pcreprecompile.3 \
doc/pcresample.3 \
doc/pcrestack.3 \
doc/pcresyntax.3 \
doc/pcretest.1
pcrecpp_man = doc/pcrecpp.3
EXTRA_DIST += $(pcrecpp_man)
if WITH_PCRE_CPP
man_MANS = $(pcrecpp_man)
endif
## CMake support
EXTRA_DIST += \
cmake/COPYING-CMAKE-SCRIPTS \
cmake/FindPackageHandleStandardArgs.cmake \
cmake/FindReadline.cmake \
CMakeLists.txt \
config-cmake.h.in
## end Makefile.am
差异被折叠。
差异被折叠。
#/bin/sh
# Script to prepare the files for building a PCRE release. It does some
# processing of the documentation, detrails files, and creates pcre.h.generic
# and config.h.generic (for use by builders who can't run ./configure).
# You must run this script before runnning "make dist". It makes use of the
# following files:
# 132html A Perl script that converts a .1 or .3 man page into HTML. It
# is called from MakeRelease. It "knows" the relevant troff
# constructs that are used in the PCRE man pages.
# CleanTxt A Perl script that cleans up the output of "nroff -man" by
# removing backspaces and other redundant text so as to produce
# a readable .txt file.
# Detrail A Perl script that removes trailing spaces from files.
# doc/index.html.src
# A file that is copied as index.html into the doc/html directory
# when the HTML documentation is built. It works like this so that
# doc/html can be deleted and re-created from scratch.
# First, sort out the documentation
cd doc
echo Processing documentation
# Make Text form of the documentation. It needs some mangling to make it
# tidy for online reading. Concatenate all the .3 stuff, but omit the
# individual function pages.
cat <<End >pcre.txt
-----------------------------------------------------------------------------
This file contains a concatenation of the PCRE man pages, converted to plain
text format for ease of searching with a text editor, or for use on systems
that do not have a man page processor. The small individual files that give
synopses of each function in the library have not been included. There are
separate text files for the pcregrep and pcretest commands.
-----------------------------------------------------------------------------
End
echo "Making pcre.txt"
for file in pcre pcrebuild pcrematching pcreapi pcrecallout pcrecompat \
pcrepattern pcresyntax pcrepartial pcreprecompile \
pcreperform pcreposix pcrecpp pcresample pcrestack ; do
echo " Processing $file.3"
nroff -c -man $file.3 >$file.rawtxt
../CleanTxt <$file.rawtxt >>pcre.txt
/bin/rm $file.rawtxt
echo "------------------------------------------------------------------------------" >>pcre.txt
if [ "$file" != "pcresample" ] ; then
echo " " >>pcre.txt
echo " " >>pcre.txt
fi
done
# The three commands
for file in pcretest pcregrep pcre-config ; do
echo Making $file.txt
nroff -c -man $file.1 >$file.rawtxt
../CleanTxt <$file.rawtxt >$file.txt
/bin/rm $file.rawtxt
done
# Make HTML form of the documentation.
echo "Making HTML documentation"
/bin/rm html/*
cp index.html.src html/index.html
for file in *.1 ; do
base=`basename $file .1`
echo " Making $base.html"
../132html -toc $base <$file >html/$base.html
done
# Exclude table of contents for function summaries. It seems that expr
# forces an anchored regex. Also exclude them for small pages that have
# only one section.
for file in *.3 ; do
base=`basename $file .3`
toc=-toc
if [ `expr $base : '.*_'` -ne 0 ] ; then toc="" ; fi
if [ "$base" = "pcresample" ] || \
[ "$base" = "pcrestack" ] || \
[ "$base" = "pcrecompat" ] || \
[ "$base" = "pcreperform" ] ; then
toc=""
fi
echo " Making $base.html"
../132html $toc $base <$file >html/$base.html
if [ $? != 0 ] ; then exit 1; fi
done
# End of documentation processing
cd ..
echo Documentation done
# These files are detrailed; do not detrail the test data because there may be
# significant trailing spaces. The configure files are also omitted from the
# detrailing.
files="\
Makefile.am \
Makefile.in \
configure.ac \
README \
LICENCE \
COPYING \
AUTHORS \
NEWS \
NON-UNIX-USE \
INSTALL \
132html \
CleanTxt \
Detrail \
ChangeLog \
CMakeLists.txt \
RunGrepTest \
RunTest \
RunTest.bat \
pcre-config.in \
libpcre.pc.in \
libpcrecpp.pc.in \
config.h.in \
pcre_printint.src \
pcre_chartables.c.dist \
pcredemo.c \
pcregrep.c \
pcretest.c \
dftables.c \
pcreposix.c \
pcreposix.h \
pcre.h.in \
pcre_internal.h
pcre_compile.c \
pcre_config.c \
pcre_dfa_exec.c \
pcre_exec.c \
pcre_fullinfo.c \
pcre_get.c \
pcre_globals.c \
pcre_info.c \
pcre_maketables.c \
pcre_newline.c \
pcre_ord2utf8.c \
pcre_refcount.c \
pcre_study.c \
pcre_tables.c \
pcre_try_flipped.c \
pcre_ucp_searchfuncs.c \
pcre_valid_utf8.c \
pcre_version.c \
pcre_xclass.c \
pcre_scanner.cc \
pcre_scanner.h \
pcre_scanner_unittest.cc \
pcrecpp.cc \
pcrecpp.h \
pcrecpparg.h.in \
pcrecpp_unittest.cc \
pcre_stringpiece.cc \
pcre_stringpiece.h.in \
pcre_stringpiece_unittest.cc \
perltest.pl \
ucp.h \
ucpinternal.h \
ucptable.h \
makevp.bat \
pcre.def \
libpcre.def \
libpcreposix.def"
echo Detrailing
./Detrail $files doc/p* doc/html/*
echo Doing basic configure to get default pcre.h and config.h
# This is in case the caller has set aliases (as I do - PH)
unset cp ls mv rm
./configure >/dev/null
echo Converting pcre.h and config.h to generic forms
cp -f pcre.h pcre.h.generic
perl <<'END'
open(IN, "<config.h") || die "Can't open config.h: $!\n";
open(OUT, ">config.h.generic") || die "Can't open config.h.generic: $!\n";
while (<IN>)
{
if (/^#define\s(?!PACKAGE)(\w+)/)
{
print OUT "#ifndef $1\n";
print OUT;
print OUT "#endif\n";
}
else
{
print OUT;
}
}
close IN;
close OUT;
END
echo Done
#End
差异被折叠。
差异被折叠。
#! /bin/sh
# This file is generated by configure from RunGrepTest.in. Make any changes
# to that file.
echo "Testing pcregrep"
./pcregrep -V
# Run pcregrep tests. The assumption is that the PCRE tests check the library
# itself. What we are checking here is the file handling and options that are
# supported by pcregrep.
cf=diff
valgrind=
if [ ! -d testdata ] ; then
ln -s @top_srcdir@/testdata testdata
fi
testdata=./testdata
while [ $# -gt 0 ] ; do
case $1 in
valgrind) valgrind="valgrind -q --leak-check=no";;
*) echo "Unknown argument $1"; exit 1;;
esac
shift
done
echo "---------------------------- Test 1 ------------------------------" >testtry
$valgrind ./pcregrep PATTERN $testdata/grepinput >>testtry
echo "---------------------------- Test 2 ------------------------------" >>testtry
$valgrind ./pcregrep '^PATTERN' $testdata/grepinput >>testtry
echo "---------------------------- Test 3 ------------------------------" >>testtry
$valgrind ./pcregrep -in PATTERN $testdata/grepinput >>testtry
echo "---------------------------- Test 4 ------------------------------" >>testtry
$valgrind ./pcregrep -ic PATTERN $testdata/grepinput >>testtry
echo "---------------------------- Test 5 ------------------------------" >>testtry
$valgrind ./pcregrep -in PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
echo "---------------------------- Test 6 ------------------------------" >>testtry
$valgrind ./pcregrep -inh PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
echo "---------------------------- Test 7 ------------------------------" >>testtry
$valgrind ./pcregrep -il PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
echo "---------------------------- Test 8 ------------------------------" >>testtry
$valgrind ./pcregrep -l PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
echo "---------------------------- Test 9 ------------------------------" >>testtry
$valgrind ./pcregrep -q PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 10 -----------------------------" >>testtry
$valgrind ./pcregrep -q NEVER-PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 11 -----------------------------" >>testtry
$valgrind ./pcregrep -vn pattern $testdata/grepinputx >>testtry
echo "---------------------------- Test 12 -----------------------------" >>testtry
$valgrind ./pcregrep -ix pattern $testdata/grepinputx >>testtry
echo "---------------------------- Test 13 -----------------------------" >>testtry
$valgrind ./pcregrep -f$testdata/greplist $testdata/grepinputx >>testtry
echo "---------------------------- Test 14 -----------------------------" >>testtry
$valgrind ./pcregrep -w pat $testdata/grepinput $testdata/grepinputx >>testtry
echo "---------------------------- Test 15 -----------------------------" >>testtry
$valgrind ./pcregrep 'abc^*' $testdata/grepinput 2>>testtry >>testtry
echo "---------------------------- Test 16 -----------------------------" >>testtry
$valgrind ./pcregrep abc $testdata/grepinput $testdata/nonexistfile 2>>testtry >>testtry
echo "---------------------------- Test 17 -----------------------------" >>testtry
$valgrind ./pcregrep -M 'the\noutput' $testdata/grepinput >>testtry
echo "---------------------------- Test 18 -----------------------------" >>testtry
$valgrind ./pcregrep -Mn '(the\noutput|dog\.\n--)' $testdata/grepinput >>testtry
echo "---------------------------- Test 19 -----------------------------" >>testtry
$valgrind ./pcregrep -Mix 'Pattern' $testdata/grepinputx >>testtry
echo "---------------------------- Test 20 -----------------------------" >>testtry
$valgrind ./pcregrep -Mixn 'complete pair\nof lines' $testdata/grepinputx >>testtry
echo "---------------------------- Test 21 -----------------------------" >>testtry
$valgrind ./pcregrep -nA3 'four' $testdata/grepinputx >>testtry
echo "---------------------------- Test 22 -----------------------------" >>testtry
$valgrind ./pcregrep -nB3 'four' $testdata/grepinputx >>testtry
echo "---------------------------- Test 23 -----------------------------" >>testtry
$valgrind ./pcregrep -C3 'four' $testdata/grepinputx >>testtry
echo "---------------------------- Test 24 -----------------------------" >>testtry
$valgrind ./pcregrep -A9 'four' $testdata/grepinputx >>testtry
echo "---------------------------- Test 25 -----------------------------" >>testtry
$valgrind ./pcregrep -nB9 'four' $testdata/grepinputx >>testtry
echo "---------------------------- Test 26 -----------------------------" >>testtry
$valgrind ./pcregrep -A9 -B9 'four' $testdata/grepinputx >>testtry
echo "---------------------------- Test 27 -----------------------------" >>testtry
$valgrind ./pcregrep -A10 'four' $testdata/grepinputx >>testtry
echo "---------------------------- Test 28 -----------------------------" >>testtry
$valgrind ./pcregrep -nB10 'four' $testdata/grepinputx >>testtry
echo "---------------------------- Test 29 -----------------------------" >>testtry
$valgrind ./pcregrep -C12 -B10 'four' $testdata/grepinputx >>testtry
echo "---------------------------- Test 30 -----------------------------" >>testtry
$valgrind ./pcregrep -inB3 'pattern' $testdata/grepinput $testdata/grepinputx >>testtry
echo "---------------------------- Test 31 -----------------------------" >>testtry
$valgrind ./pcregrep -inA3 'pattern' $testdata/grepinput $testdata/grepinputx >>testtry
echo "---------------------------- Test 32 -----------------------------" >>testtry
$valgrind ./pcregrep -L 'fox' $testdata/grepinput $testdata/grepinputx >>testtry
echo "---------------------------- Test 33 -----------------------------" >>testtry
$valgrind ./pcregrep 'fox' $testdata/grepnonexist >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 34 -----------------------------" >>testtry
$valgrind ./pcregrep -s 'fox' $testdata/grepnonexist >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 35 -----------------------------" >>testtry
$valgrind ./pcregrep -L -r --include=grepinputx 'fox' $testdata >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 36 -----------------------------" >>testtry
$valgrind ./pcregrep -L -r --include=grepinput --exclude 'grepinput$' 'fox' $testdata >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 37 -----------------------------" >>testtry
$valgrind ./pcregrep '^(a+)*\d' $testdata/grepinput >>testtry 2>teststderr
echo "RC=$?" >>testtry
echo "======== STDERR ========" >>testtry
cat teststderr >>testtry
echo "---------------------------- Test 38 ------------------------------" >>testtry
$valgrind ./pcregrep '>\x00<' $testdata/grepinput >>testtry
echo "---------------------------- Test 39 ------------------------------" >>testtry
$valgrind ./pcregrep -A1 'before the binary zero' $testdata/grepinput >>testtry
echo "---------------------------- Test 40 ------------------------------" >>testtry
$valgrind ./pcregrep -B1 'after the binary zero' $testdata/grepinput >>testtry
echo "---------------------------- Test 41 ------------------------------" >>testtry
$valgrind ./pcregrep -B1 -o '\w+ the binary zero' $testdata/grepinput >>testtry
echo "---------------------------- Test 41 ------------------------------" >>testtry
$valgrind ./pcregrep -B1 -onH '\w+ the binary zero' $testdata/grepinput >>testtry
echo "---------------------------- Test 42 ------------------------------" >>testtry
$valgrind ./pcregrep -on 'before|zero|after' $testdata/grepinput >>testtry
echo "---------------------------- Test 43 ------------------------------" >>testtry
$valgrind ./pcregrep -on -e before -e zero -e after $testdata/grepinput >>testtry
echo "---------------------------- Test 44 ------------------------------" >>testtry
$valgrind ./pcregrep -on -f $testdata/greplist -e binary $testdata/grepinput >>testtry
echo "---------------------------- Test 45 ------------------------------" >>testtry
$valgrind ./pcregrep -e abc -e '(unclosed' $testdata/grepinput 2>>testtry >>testtry
echo "---------------------------- Test 46 ------------------------------" >>testtry
$valgrind ./pcregrep -Fx "AB.VE
elephant" $testdata/grepinput >>testtry
echo "---------------------------- Test 47 ------------------------------" >>testtry
$valgrind ./pcregrep -F "AB.VE
elephant" $testdata/grepinput >>testtry
echo "---------------------------- Test 48 ------------------------------" >>testtry
$valgrind ./pcregrep -F -e DATA -e "AB.VE
elephant" $testdata/grepinput >>testtry
echo "---------------------------- Test 49 ------------------------------" >>testtry
$valgrind ./pcregrep "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
echo "---------------------------- Test 50 ------------------------------" >>testtry
$valgrind ./pcregrep -N CR "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
echo "---------------------------- Test 51 ------------------------------" >>testtry
$valgrind ./pcregrep --newline=crlf "^(abc|def|ghi|jkl)" $testdata/grepinputx >>testtry
echo "---------------------------- Test 52 ------------------------------" >>testtry
$valgrind ./pcregrep --newline=cr -F "def jkl" $testdata/grepinputx >>testtry
echo "---------------------------- Test 53 ------------------------------" >>testtry
$valgrind ./pcregrep --newline=crlf -F "xxx
jkl" $testdata/grepinputx >>testtry
# Now compare the results.
$cf testtry $testdata/grepoutput
if [ $? != 0 ] ; then exit 1; else exit 0; fi
# End
#! /bin/sh
# Run PCRE tests.
valgrind=
# Set up a suitable "diff" command for comparison. Some systems
# have a diff that lacks a -u option. Try to deal with this.
if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi
# Find the test data
testdata=testdata
if [ -n "$srcdir" -a -d "$srcdir" ] ; then
testdata="$srcdir/testdata"
fi
# Find which optional facilities are available
case `./pcretest -C | ./pcregrep 'Internal link size'` in
*2) link_size=2;;
*3) link_size=3;;
*4) link_size=4;;
*) echo "Failed to find internal link size"; exit 1;;
esac
./pcretest -C | ./pcregrep 'No UTF-8 support' >/dev/null
utf8=$?
./pcretest -C | ./pcregrep 'No Unicode properties support' >/dev/null
ucp=$?
# Select which tests to run; for those that are explicitly requested, check
# that the necessary optional facilities are available.
do1=no
do2=no
do3=no
do4=no
do5=no
do6=no
do7=no
do8=no
do9=no
do10=no
while [ $# -gt 0 ] ; do
case $1 in
1) do1=yes;;
2) do2=yes;;
3) do3=yes;;
4) do4=yes;;
5) do5=yes;;
6) do6=yes;;
7) do7=yes;;
8) do8=yes;;
9) do9=yes;;
10) do10=yes;;
valgrind) valgrind="valgrind -q";;
*) echo "Unknown test number $1"; exit 1;;
esac
shift
done
if [ $utf8 -eq 0 ] ; then
if [ $do4 = yes ] ; then
echo "Can't run test 4 because UTF-8 support is not configured"
exit 1
fi
if [ $do5 = yes ] ; then
echo "Can't run test 5 because UTF-8 support is not configured"
exit 1
fi
if [ $do8 = yes ] ; then
echo "Can't run test 8 because UTF-8 support is not configured"
exit 1
fi
fi
if [ $ucp -eq 0 ] ; then
if [ $do6 = yes ] ; then
echo "Can't run test 6 because Unicode property support is not configured"
exit 1
fi
if [ $do9 = yes ] ; then
echo "Can't run test 9 because Unicode property support is not configured"
exit 1
fi
if [ $do10 = yes ] ; then
echo "Can't run test 10 because Unicode property support is not configured"
exit 1
fi
fi
if [ $link_size -ne 2 ] ; then
if [ $do10 = yes ] ; then
echo "Can't run test 10 because the link size ($link_size) is not 2"
exit 1
fi
fi
# If no specific tests were requested, select all that are relevant.
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
$do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \
$do9 = no -a $do10 = no ] ; then
do1=yes
do2=yes
do3=yes
if [ $utf8 -ne 0 ] ; then do4=yes; fi
if [ $utf8 -ne 0 ] ; then do5=yes; fi
if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do6=yes; fi
do7=yes
if [ $utf8 -ne 0 ] ; then do8=yes; fi
if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do9=yes; fi
if [ $link_size -eq 2 -a $ucp -ne 0 ] ; then do10=yes; fi
fi
# Show which release
echo ""
echo PCRE C library tests
./pcretest /dev/null
# Primary test, Perl-compatible
if [ $do1 = yes ] ; then
echo "Test 1: main functionality (Perl compatible)"
$valgrind ./pcretest -q $testdata/testinput1 testtry
if [ $? = 0 ] ; then
$cf $testdata/testoutput1 testtry
if [ $? != 0 ] ; then exit 1; fi
else exit 1
fi
echo "OK"
fi
# PCRE tests that are not Perl-compatible - API & error tests, mostly
if [ $do2 = yes ] ; then
echo "Test 2: API and error handling (not Perl compatible)"
$valgrind ./pcretest -q $testdata/testinput2 testtry
if [ $? = 0 ] ; then
$cf $testdata/testoutput2 testtry
if [ $? != 0 ] ; then exit 1; fi
else
echo " "
echo "** Test 2 requires a lot of stack. If it has crashed with a"
echo "** segmentation fault, it may be that you do not have enough"
echo "** stack available by default. Please see the 'pcrestack' man"
echo "** page for a discussion of PCRE's stack usage."
echo " "
exit 1
fi
echo "OK"
fi
# Locale-specific tests, provided that either the "fr_FR" or the "french"
# locale is available. The former is the Unix-like standard; the latter is
# for Windows.
if [ $do3 = yes ] ; then
locale -a | grep '^fr_FR$' >/dev/null
if [ $? -eq 0 ] ; then
locale=fr_FR
infile=$testdata/testinput3
outfile=$testdata/testoutput3
else
locale -a | grep '^french$' >/dev/null
if [ $? -eq 0 ] ; then
locale=french
sed 's/fr_FR/french/' $testdata/testinput3 >test3input
sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
infile=test3input
outfile=test3output
else
locale=
fi
fi
if [ "$locale" != "" ] ; then
echo "Test 3: locale-specific features (using '$locale' locale)"
$valgrind ./pcretest -q $infile testtry
if [ $? = 0 ] ; then
$cf $outfile testtry
if [ $? != 0 ] ; then
echo " "
echo "Locale test did not run entirely successfully."
echo "This usually means that there is a problem with the locale"
echo "settings rather than a bug in PCRE."
else
echo "OK"
fi
else exit 1
fi
else
echo "Cannot test locale-specific features - neither the 'fr_FR' nor the"
echo "'french' locale exists, or the \"locale\" command is not available"
echo "to check for them."
echo " "
fi
fi
# Additional tests for UTF8 support
if [ $do4 = yes ] ; then
echo "Test 4: UTF-8 support (Perl compatible)"
$valgrind ./pcretest -q $testdata/testinput4 testtry
if [ $? = 0 ] ; then
$cf $testdata/testoutput4 testtry
if [ $? != 0 ] ; then exit 1; fi
else exit 1
fi
echo "OK"
fi
if [ $do5 = yes ] ; then
echo "Test 5: API and internals for UTF-8 support (not Perl compatible)"
$valgrind ./pcretest -q $testdata/testinput5 testtry
if [ $? = 0 ] ; then
$cf $testdata/testoutput5 testtry
if [ $? != 0 ] ; then exit 1; fi
else exit 1
fi
echo "OK"
fi
if [ $do6 = yes ] ; then
echo "Test 6: Unicode property support"
$valgrind ./pcretest -q $testdata/testinput6 testtry
if [ $? = 0 ] ; then
$cf $testdata/testoutput6 testtry
if [ $? != 0 ] ; then exit 1; fi
else exit 1
fi
echo "OK"
fi
# Tests for DFA matching support
if [ $do7 = yes ] ; then
echo "Test 7: DFA matching"
$valgrind ./pcretest -q -dfa $testdata/testinput7 testtry
if [ $? = 0 ] ; then
$cf $testdata/testoutput7 testtry
if [ $? != 0 ] ; then exit 1; fi
else exit 1
fi
echo "OK"
fi
if [ $do8 = yes ] ; then
echo "Test 8: DFA matching with UTF-8"
$valgrind ./pcretest -q -dfa $testdata/testinput8 testtry
if [ $? = 0 ] ; then
$cf $testdata/testoutput8 testtry
if [ $? != 0 ] ; then exit 1; fi
else exit 1
fi
echo "OK"
fi
if [ $do9 = yes ] ; then
echo "Test 9: DFA matching with Unicode properties"
$valgrind ./pcretest -q -dfa $testdata/testinput9 testtry
if [ $? = 0 ] ; then
$cf $testdata/testoutput9 testtry
if [ $? != 0 ] ; then exit 1; fi
else exit 1
fi
echo "OK"
fi
# Test of internal offsets and code sizes. This test is run only when there
# is Unicode property support and the link size is 2. The actual tests are
# mostly the same as in some of the above, but in this test we inspect some
# offsets and sizes that require a known link size. This is a doublecheck for
# the maintainer, just in case something changes unexpectely.
if [ $do10 = yes ] ; then
echo "Test 10: Internal offsets and code size tests"
$valgrind ./pcretest -q $testdata/testinput10 testtry
if [ $? = 0 ] ; then
$cf $testdata/testoutput10 testtry
if [ $? != 0 ] ; then exit 1; fi
else exit 1
fi
echo "OK"
fi
# End
@rem This file was contributed by Ralf Junker, and touched up by
@rem Daniel Richard G. Test 10 added by Philip H.
@rem Philip H also changed test 3 to use "wintest" files.
@rem
@rem MS Windows batch file to run pcretest on testfiles with the correct
@rem options.
@rem
@rem Output is written to a newly created subfolder named "testdata".
setlocal
if [%srcdir%]==[] set srcdir=.
if [%pcretest%]==[] set pcretest=pcretest
if not exist testout md testout
%pcretest% -q %srcdir%\testdata\testinput1 > testout\testoutput1
%pcretest% -q %srcdir%\testdata\testinput2 > testout\testoutput2
@rem %pcretest% -q %srcdir%\testdata\testinput3 > testout\testoutput3
%pcretest% -q %srcdir%\testdata\wintestinput3 > testout\wintestoutput3
%pcretest% -q %srcdir%\testdata\testinput4 > testout\testoutput4
%pcretest% -q %srcdir%\testdata\testinput5 > testout\testoutput5
%pcretest% -q %srcdir%\testdata\testinput6 > testout\testoutput6
%pcretest% -q -dfa %srcdir%\testdata\testinput7 > testout\testoutput7
%pcretest% -q -dfa %srcdir%\testdata\testinput8 > testout\testoutput8
%pcretest% -q -dfa %srcdir%\testdata\testinput9 > testout\testoutput9
%pcretest% -q %srcdir%\testdata\testinput10 > testout\testoutput10
fc /n %srcdir%\testdata\testoutput1 testout\testoutput1
fc /n %srcdir%\testdata\testoutput2 testout\testoutput2
rem fc /n %srcdir%\testdata\testoutput3 testout\testoutput3
fc /n %srcdir%\testdata\wintestoutput3 testout\wintestoutput3
fc /n %srcdir%\testdata\testoutput4 testout\testoutput4
fc /n %srcdir%\testdata\testoutput5 testout\testoutput5
fc /n %srcdir%\testdata\testoutput6 testout\testoutput6
fc /n %srcdir%\testdata\testoutput7 testout\testoutput7
fc /n %srcdir%\testdata\testoutput8 testout\testoutput8
fc /n %srcdir%\testdata\testoutput9 testout\testoutput9
fc /n %srcdir%\testdata\testoutput10 testout\testoutput10
差异被折叠。
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# from http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/FindReadline.cmake
# http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/COPYING-CMAKE-SCRIPTS
# --> BSD licensed
#
# GNU Readline library finder
if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
set(READLINE_FOUND TRUE)
else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h
/usr/include/readline
)
# 2008-04-22 The next clause used to read like this:
#
# FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
# FIND_LIBRARY(NCURSES_LIBRARY NAMES ncurses )
# include(FindPackageHandleStandardArgs)
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG NCURSES_LIBRARY READLINE_INCLUDE_DIR READLINE_LIBRARY )
#
# I was advised to modify it such that it will find an ncurses library if
# required, but not if one was explicitly given, that is, it allows the
# default to be overridden. PH
FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY )
MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY)
endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
差异被折叠。
差异被折叠。
差异被折叠。
#! /bin/sh
srcpath=$(dirname $0 2>/dev/null ) || srcpath="."
$srcpath/configure "$@" --disable-shared --with-pic --disable-cpp
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论