Blob Blame History Raw
From 2b7babaacaaa5e576f037e99cc6332760cd0358b Mon Sep 17 00:00:00 2001
From: William S Fulton <wsf@fultondesigns.co.uk>
Date: Thu, 20 Jan 2022 22:24:53 +0000
Subject: [PATCH 2/2] Few more PCRE to PCRE2 changes

---
 Doc/Manual/Preface.html |  8 ++++----
 Source/Modules/main.cxx |  2 +-
 Source/Swig/misc.c      |  2 +-
 Tools/mkwindows.sh      |  2 +-
 Tools/pcre-build.sh     | 26 +++++++++++++-------------
 configure.ac            | 18 +++++++++---------
 6 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/Doc/Manual/Preface.html b/Doc/Manual/Preface.html
index 6e0366bf9..559e31e44 100644
--- a/Doc/Manual/Preface.html
+++ b/Doc/Manual/Preface.html
@@ -278,12 +278,12 @@ You must use <a href="http://www.gnu.org/software/make/">GNU make</a> to build a
 </p>
 
 <p>
-<a href="http://www.pcre.org/">PCRE</a>
+<a href="http://www.pcre.org/">PCRE2</a>
 needs to be installed on your system to build SWIG, in particular
-pcre2-config must be available. If you have PCRE headers and libraries but not
+pcre2-config must be available. If you have PCRE2 headers and libraries but not
 pcre2-config itself or, alternatively, wish to override the compiler or linker
-flags returned by pcre-config, you may set PCRE2_LIBS and PCRE2_CFLAGS variables
-to be used instead. And if you don't have PCRE at all, the configure script
+flags returned by pcre2-config, you may set PCRE2_LIBS and PCRE2_CFLAGS variables
+to be used instead. And if you don't have PCRE2 at all, the configure script
 will provide instructions for obtaining it.
 </p>
 
diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
index 12b83b2e4..8bc467c76 100644
--- a/Source/Modules/main.cxx
+++ b/Source/Modules/main.cxx
@@ -135,7 +135,7 @@ static const char *usage4 = (const char *) "\
      -oh <headfile>  - Set name of C++ output header file for directors to <headfile>\n\
      -outcurrentdir  - Set default output dir to current dir instead of input file's path\n\
      -outdir <dir>   - Set language specific files output directory to <dir>\n\
-     -pcreversion    - Display PCRE version information\n\
+     -pcreversion    - Display PCRE2 version information\n\
      -small          - Compile in virtual elimination & compact mode\n\
      -swiglib        - Report location of SWIG library and exit\n\
      -templatereduce - Reduce all the typedefs in templates\n\
diff --git a/Source/Swig/misc.c b/Source/Swig/misc.c
index c63f0a6c0..543762991 100644
--- a/Source/Swig/misc.c
+++ b/Source/Swig/misc.c
@@ -1449,7 +1449,7 @@ String *Swig_pcre_version(void) {
   char *buf = malloc(len);
   String *result;
   pcre2_config(PCRE2_CONFIG_VERSION, buf);
-  result = NewStringf("PCRE Version: %s", buf);
+  result = NewStringf("PCRE2 Version: %s", buf);
   free(buf);
   return result;
 }
diff --git a/Tools/mkwindows.sh b/Tools/mkwindows.sh
index 735edeaf0..c2b6b7cbf 100755
--- a/Tools/mkwindows.sh
+++ b/Tools/mkwindows.sh
@@ -80,7 +80,7 @@ tarball=$swigbasename.tar.gz
 pcre_tarball=`ls pcre2-*.tar.*`
 
 if ! test -f "$pcre_tarball"; then
-  echo "Could not find PCRE tarball. Please download a PCRE source tarball from http://www.pcre.org"
+  echo "Could not find PCRE2 tarball. Please download a PCRE2 source tarball from http://www.pcre.org"
   echo "and place in the same directory as the SWIG tarball."
   exit 1
 fi
diff --git a/Tools/pcre-build.sh b/Tools/pcre-build.sh
index ffa7a69f8..e986d682f 100755
--- a/Tools/pcre-build.sh
+++ b/Tools/pcre-build.sh
@@ -4,17 +4,17 @@ pcre_subdir=pcre/pcre-swig-install
 pcre_install_dir=`pwd`/$pcre_subdir
 
 usage() {
-  echo "Helper script to build PCRE as a static library from a tarball just for use during the"
-  echo "SWIG build. It does not install PCRE for global use on your system."
+  echo "Helper script to build PCRE2 as a static library from a tarball just for use during the"
+  echo "SWIG build. It does not install PCRE2 for global use on your system."
   echo "Usage: pcre-build.sh [--help] [args]"
-  echo "  args   - optional additional arguments passed on to the PCRE configure script (leave out"
+  echo "  args   - optional additional arguments passed on to the PCRE2 configure script (leave out"
   echo "         unless you are an expert at configure)"
   echo "  --help - Display this help information."
   echo "Instructions:"
-  echo "  - Download the latest PCRE source tarball from http://www.pcre.org and place in the"
+  echo "  - Download the latest PCRE2 source tarball from http://www.pcre.org and place in the"
   echo "    directory that you will configure and build SWIG."
   echo "  - Run this script in the same directory that you intend to configure and build SWIG in."
-  echo "    This will configure and build PCRE as a static library."
+  echo "    This will configure and build PCRE2 as a static library."
   echo "  - Afterwards run the SWIG configure script which will then find and use the PCRE static"
   echo "    libraries in the $pcre_subdir subdirectory."
   exit 0
@@ -35,21 +35,21 @@ if test -f "pcre-build.sh" ; then
   usage
 fi
 
-echo "Looking for PCRE tarball..."
+echo "Looking for PCRE2 tarball..."
 rm -rf pcre
 pcre_tarball=`ls pcre2-*.tar*`
 test -n "$pcre_tarball" || bail "Could not find tarball matching pattern: pcre2-*.tar*"
-test -f "$pcre_tarball" || bail "Could not find a single PCRE tarball. Found: $pcre_tarball"
+test -f "$pcre_tarball" || bail "Could not find a single PCRE2 tarball. Found: $pcre_tarball"
 
 echo "Extracting tarball: $pcre_tarball"
 tar -xf $pcre_tarball || bail "Could not untar $pcre_tarball"
 pcre_dir=`echo $pcre_tarball | sed -e "s/\.tar.*//"`
 echo "Configuring PCRE in directory: pcre"
 mv $pcre_dir pcre || bail "Could not create pcre directory"
-cd pcre && ./configure --prefix=$pcre_install_dir --disable-shared $* || bail "PCRE configure failed"
-echo "Building PCRE..."
-${MAKE:-make} -s || bail "Could not build PCRE"
-echo "Installing PCRE locally to $pcre_install_dir..."
-${MAKE:-make} -s install || bail "Could not install PCRE"
+cd pcre && ./configure --prefix=$pcre_install_dir --disable-shared $* || bail "PCRE2 configure failed"
+echo "Building PCRE2..."
+${MAKE:-make} -s || bail "Could not build PCRE2"
+echo "Installing PCRE2 locally to $pcre_install_dir..."
+${MAKE:-make} -s install || bail "Could not install PCRE2"
 echo ""
-echo "The SWIG configure script can now be run, whereupon PCRE will automatically be detected and used from $pcre_install_dir/bin/pcre-config."
+echo "The SWIG configure script can now be run, whereupon PCRE2 will automatically be detected and used from $pcre_install_dir/bin/pcre-config."
diff --git a/configure.ac b/configure.ac
index 3e6e05c68..8df088ed5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,16 +56,16 @@ m4_ifdef([AC_PROG_SED],, [AC_DEFUN([AC_PROG_SED], [AC_PATH_PROG([SED], sed)])])
 
 AC_ARG_WITH([pcre],
   [AS_HELP_STRING([--without-pcre],
-                  [Disable support for regular expressions using PCRE])],
+                  [Disable support for regular expressions using PCRE2])],
   [],
   [with_pcre=yes])
 
-AC_MSG_CHECKING([whether to enable PCRE support])
+AC_MSG_CHECKING([whether to enable PCRE2 support])
 AC_MSG_RESULT([$with_pcre])
 
 dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script
 if test x"${with_pcre}" = xyes ; then
-  AC_MSG_CHECKING([whether to use local PCRE])
+  AC_MSG_CHECKING([whether to use local PCRE2])
   local_pcre_config=no
   if test -z $PCRE2_CONFIG; then
     if test -f `pwd`/pcre/pcre-swig-install/bin/pcre2-config; then
@@ -79,20 +79,20 @@ AS_IF([test "x$with_pcre" != xno],
   [AX_PATH_GENERIC([pcre2],
     [], dnl Minimal version of PCRE we need -- accept any
     [], dnl custom sed script for version parsing is not needed
-    [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
+    [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE2 library])
      LIBS="$LIBS $PCRE2_LIBS"
      CPPFLAGS="$CPPFLAGS $PCRE2_CFLAGS"
     ],
     [AC_MSG_FAILURE([
-        Cannot find pcre2-config script from PCRE (Perl Compatible Regular Expressions)
+        Cannot find pcre2-config script from PCRE2 (Perl Compatible Regular Expressions)
         library package. This dependency is needed for configure to complete,
         Either:
-        - Install the PCRE developer package on your system (preferred approach).
-        - Download the PCRE source tarball, build and install on your system
+        - Install the PCRE2 developer package on your system (preferred approach).
+        - Download the PCRE2 source tarball, build and install on your system
           as you would for any package built from source distribution.
-        - Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically
+        - Use the Tools/pcre-build.sh script to build PCRE2 just for SWIG to statically
           link against. Run 'Tools/pcre-build.sh --help' for instructions.
-          (quite easy and does not require privileges to install PCRE on your system)
+          (quite easy and does not require privileges to install PCRE2 on your system)
         - Use configure --without-pcre to disable regular expressions support in SWIG
           (not recommended).])
     ],
-- 
2.43.0