Permalink
Browse files

PCRE1 to PCRE2 (#1230)

* Convert from PCRE1 to PCRE2

* Fix install path for pcre2

* Link directly to the bundled libpcre2-8.a file.

System ones were sometimes getting picked up instead if present. Ours is
better.

* Compile sitelock wildcard patterns into regular expressions.

* Speed up atr_iter_get() and friends:

1. Precompile regular expressions before scanning attributes.
2. Convert wildcard patterns to REs and compile same.

* Make the sqlite REGEXP match actually anchored like it's supposed to be.

* Remove some references to PCRE as a dependency from documentation.

* Fix a timestamp issue that was causing odd things when building pcre2 on some systems. Also avoid re-installing it unless needed.

* Add changelog entry.

* Have the configure script download a pcre2 tarball instead of including it directly in the Penn repo.

Addresses the bloat issue in a hopefully portable way.

* Use http instead of https because the latter isn't always supported.

* Update to pcre2 10.32, misc tweaks.
  • Loading branch information...
shawnw committed Oct 12, 2018
1 parent 20794ea commit 51beed3cc46c35aa02e64e566261f6cb7608522f
Showing with 941 additions and 999 deletions.
  1. +4 −0 .gitignore
  2. +2 −0 CHANGES.188.md
  3. +2 −5 INSTALL.md
  4. +11 −2 Makefile.in
  5. +0 −70 aclocal.m4
  6. +0 −2 config.h.in
  7. +43 −167 configure
  8. +35 −12 configure.in
  9. +2 −2 hdrs/access.h
  10. +5 −5 hdrs/ansi.h
  11. +2 −2 hdrs/externs.h
  12. +10 −19 hdrs/mypcre.h
  13. +7 −5 hdrs/parse.h
  14. +2 −2 hints/linux.txt
  15. +1 −3 hints/minix.txt
  16. +1 −2 hints/netbsd.txt
  17. +0 −1 hints/openbsd.txt
  18. +68 −26 src/access.c
  19. +27 −19 src/atr_tab.c
  20. +103 −9 src/attrib.c
  21. +12 −5 src/bsd.c
  22. +13 −6 src/conf.c
  23. +18 −25 src/db.c
  24. +143 −200 src/funlist.c
  25. +28 −23 src/funmisc.c
  26. +44 −24 src/game.c
  27. +21 −18 src/help.c
  28. +72 −44 src/markup.c
  29. +24 −17 src/mycrypt.c
  30. +1 −1 src/mymalloc.c
  31. +69 −71 src/parse.c
  32. +31 −48 src/predicat.c
  33. +30 −41 src/set.c
  34. +20 −33 src/strutil.c
  35. +16 −11 src/tz.c
  36. +68 −73 src/wild.c
  37. +6 −6 win32/README-MSYS2.txt
View
@@ -4,6 +4,8 @@
*.lib
*.exe
*.s
*.lo
*.la
*~
*.bak
*.log
@@ -60,3 +62,5 @@ dbtools/db_config.h
dbtools/dbupgrade
dbtools/grepdb
dbtools/pwutil
pcre2
pcre2-10.*
View
@@ -43,6 +43,8 @@ Minor Changes
* Millisecond timing in bsd.c for polling waits in prep for subsecond @waits. [GM]
* Sqlite3's `REGEXP` operator is always available and uses pcre regular expressions (Previously it depended on libicu and used java style REs). [SW]
* Update `local.dst` to include example of millisecond callback loop. [MT]
* Updated to use PCRE2 10.31 for regular expressions. [SW}
* Wildcard patterns are sometimes converted to regular expressions when matched against many strings. [SW]
* Add '--disable-socket-quota' option for our test suite [GM]
* The list of color definitions used with `ansi()`, `colors()`, etc. is now kept in game/txt/colors.json. [SW]
* Sqlite3 updated to 3.25.1. Biggest user-visible change is support for window functions. [SW]
View
@@ -81,13 +81,10 @@ The quickstart version of the installation is:
development packages required to compile programs (Linux
distributions that don't come with gcc in the base install often
need a package named glibc-dev).
3. A version of the PCRE regular expression library and any related
development packages. (Debian and Ubuntu call them libpcre3 and
libpcre3-dev).
4. A version of the OpenSSL library; most OSes these days come with
3. A version of the OpenSSL library; most OSes these days come with
it out of the box, but some might require a development package as
well (libssl-dev, openssl-dev or some such name).
5. Development versions of a number of optional libraries are nice to have:
4. Development versions of a number of optional libraries are nice to have:
* A sql client library for MySQL/MariaDB or Postgresql.
* ICU (For enhanced Unicode support)
* libevent (For ssl_slave)
View
@@ -20,9 +20,9 @@ CC=@PTHREAD_CC@
SQL_CFLAGS=@MYSQL_CFLAGS@ @POSTGRESQL_CPPFLAGS@
SQL_LDFLAGS=@MYSQL_LDFLAGS@ @POSTGRESQL_LDFLAGS@
CCFLAGS=@CFLAGS@ -I.. -I../hdrs -include ../config.h -include ../confmagic.h -include ../options.h @PTHREAD_CFLAGS@ @CPPFLAGS@ @ICU_CPPFLAGS@ @PCRE_CFLAGS@ @OPENSSL_INCLUDES@ @CURL_CFLAGS@
CCFLAGS=@CFLAGS@ -I.. -I../hdrs -include ../config.h -include ../confmagic.h -include ../options.h @PTHREAD_CFLAGS@ @CPPFLAGS@ @ICU_CPPFLAGS@ @OPENSSL_INCLUDES@ @CURL_CFLAGS@
LDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@
CLIBS=@PTHREAD_LIBS@ @LIBS@ @ICU_LIBS@ @PCRE_LIBS@ @OPENSSL_LIBS@ @POSTGRESQL_LIBS@ @CURL_LIBS@
CLIBS=@PTHREAD_LIBS@ @LIBS@ @ICU_LIBS@ @OPENSSL_LIBS@ @POSTGRESQL_LIBS@ @CURL_LIBS@
INSTALL=@INSTALL@
INSTALLDIR=$installdir
CP=@CP@
@@ -34,7 +34,14 @@ SHELL=/bin/sh
# Where to install with 'make globalinstall'
GLOBAL_INSTALL=@libexecdir@
PCRE2_DIR=pcre2-10.32
all: config.h autogen game/mush.cnf
@if [ ! -d pcre2 ]; then \
echo "Making all in pcre2"; \
(cd $(PCRE2_DIR) && make install); \
fi
@echo "Making all in src."
(cd src; @MAKE@ all "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \
"LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \
@@ -170,6 +177,8 @@ test: netmud
(cd test; sh alltests.sh)
clean:
(cd $(PCRE2_DIR); @MAKE@ clean)
rm -rf pcre2/
(cd src; @MAKE@ clean)
(cd game; rm -f netmush info_slave)
View
@@ -519,76 +519,6 @@ AC_DEFUN([AX_CHECK_OPENSSL], [
AC_SUBST([OPENSSL_LDFLAGS])
])
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_path_lib_pcre.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PATH_LIB_PCRE [(A/NA)]
#
# DESCRIPTION
#
# check for pcre lib and set PCRE_LIBS and PCRE_CFLAGS accordingly.
#
# also provide --with-pcre option that may point to the $prefix of the
# pcre installation - the macro will check $pcre/include and $pcre/lib to
# contain the necessary files.
#
# the usual two ACTION-IF-FOUND / ACTION-IF-NOT-FOUND are supported and
# they can take advantage of the LIBS/CFLAGS additions.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 9
AC_DEFUN([AX_PATH_LIB_PCRE],[dnl
AC_MSG_CHECKING([lib pcre])
AC_ARG_WITH(pcre,
[ --with-pcre[[=prefix]] compile xmlpcre part (via libpcre check)],,
with_pcre="yes")
if test ".$with_pcre" = ".no" ; then
AC_MSG_RESULT([disabled])
m4_ifval($2,$2)
else
AC_MSG_RESULT([(testing)])
AC_CHECK_LIB(pcre, pcre_study)
if test "$ac_cv_lib_pcre_pcre_study" = "yes" ; then
PCRE_LIBS="-lpcre"
AC_MSG_CHECKING([lib pcre])
AC_MSG_RESULT([$PCRE_LIBS])
m4_ifval($1,$1)
else
OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$with_pcre/lib"
OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$with_pcre/include"
AC_CHECK_LIB(pcre, pcre_compile)
CPPFLAGS="$OLDCPPFLAGS"
LDFLAGS="$OLDLDFLAGS"
if test "$ac_cv_lib_pcre_pcre_compile" = "yes" ; then
AC_MSG_RESULT(.setting PCRE_LIBS -L$with_pcre/lib -lpcre)
PCRE_LIBS="-L$with_pcre/lib -lpcre"
test -d "$with_pcre/include" && PCRE_CFLAGS="-I$with_pcre/include"
AC_MSG_CHECKING([lib pcre])
AC_MSG_RESULT([$PCRE_LIBS])
m4_ifval($1,$1)
else
AC_MSG_CHECKING([lib pcre])
AC_MSG_RESULT([no, (WARNING)])
m4_ifval($2,$2)
fi
fi
fi
AC_SUBST([PCRE_LIBS])
AC_SUBST([PCRE_CFLAGS])
])
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_type_socklen_t.html
# ===========================================================================
View
@@ -83,8 +83,6 @@
#undef HAVE_SSL
#undef HAVE_PCRE_H
#undef HAVE_PCRE
#undef HAVE_EVENT2_EVENT_H
Oops, something went wrong.

0 comments on commit 51beed3

Please sign in to comment.