git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 18/18] Makefile & configure: make PCRE v2 the default PCRE implementation

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 20, 2017, 21:23 UTC
Message-ID
<20170420212345.7408-19-avarab@gmail.com>
In-Reply-To
<20170420212345.7408-1-avarab@gmail.com>

Change the USE_LIBPCRE=YesPlease & --with-libpcre flags to the Makefile & configure script, respectively, to mean use PCRE v2, not PCRE v1. The legacy library is still available on request via USE_LIBPCRE1=YesPlease or --with-libpcre1.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Makefile     | 21 ++++++++++-----------
 configure.ac | 18 +++++++++---------
 2 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/Makefile b/Makefile
index a792f206b9..42b09f9632 100644
--- a/Makefile
+++ b/Makefile
@@ -29,10 +29,10 @@ all::
 # Perl-compatible regular expressions instead of standard or extended
 # POSIX regular expressions.
 #
-# Currently USE_LIBPCRE is a synonym for USE_LIBPCRE1, define
-# USE_LIBPCRE2 instead if you'd like to use version 2 of the PCRE
-# library. The USE_LIBPCRE flag will likely be changed to mean v2 by
-# default in future releases.
+# The USE_LIBPCRE flag is a synonym for USE_LIBPCRE2, in previous
+# versions it meant the same thing USE_LIBPCRE1 does now. Define
+# USE_LIBPCRE1 instead if you'd like to use the legacy version 1 of
+# the PCRE library.
 #
 # Define LIBPCREDIR=/foo/bar if your PCRE header and library files are in
 # /foo/bar/include and /foo/bar/lib directories.
@@ -1090,18 +1090,17 @@ ifdef NO_LIBGEN_H
 	COMPAT_OBJS += compat/basename.o
 endif
 
-USE_LIBPCRE1 ?= $(USE_LIBPCRE)
-
-ifneq (,$(USE_LIBPCRE1))
-	ifdef USE_LIBPCRE2
-$(error Only set USE_LIBPCRE1 (or its alias USE_LIBPCRE) or USE_LIBPCRE2, not both!)
-	endif
+USE_LIBPCRE2 ?= $(USE_LIBPCRE)
 
+ifdef USE_LIBPCRE1
 	BASIC_CFLAGS += -DUSE_LIBPCRE1
 	EXTLIBS += -lpcre
 endif
 
-ifdef USE_LIBPCRE2
+ifneq (,$(USE_LIBPCRE2))
+	ifdef USE_LIBPCRE1
+$(error Only set USE_LIBPCRE2 (or its alias USE_LIBPCRE) or USE_LIBPCRE1, not both!)
+	endif
 	BASIC_CFLAGS += -DUSE_LIBPCRE2
 	EXTLIBS += -lpcre2-8
 endif
diff --git a/configure.ac b/configure.ac
index 11d083fbe0..f9659daeb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,25 +255,25 @@ GIT_PARSE_WITH([openssl]))
 # Perl-compatible regular expressions instead of standard or extended
 # POSIX regular expressions.
 #
-# Currently USE_LIBPCRE is a synonym for USE_LIBPCRE1, define
-# USE_LIBPCRE2 instead if you'd like to use version 2 of the PCRE
-# library. The USE_LIBPCRE flag will likely be changed to mean v2 by
-# default in future releases.
+# The USE_LIBPCRE flag is a synonym for USE_LIBPCRE2, in previous
+# versions it meant the same thing USE_LIBPCRE1 does now. Define
+# USE_LIBPCRE1 instead if you'd like to use the legacy version 1 of
+# the PCRE library.
 #
 # Define LIBPCREDIR=/foo/bar if your PCRE header and library files are in
 # /foo/bar/include and /foo/bar/lib directories.
 #
 AC_ARG_WITH(libpcre,
-AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre1]),
+AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre2]),
     if test "$withval" = "no"; then
-	USE_LIBPCRE1=
+	USE_LIBPCRE2=
     elif test "$withval" = "yes"; then
-	USE_LIBPCRE1=YesPlease
+	USE_LIBPCRE2=YesPlease
     else
-	USE_LIBPCRE1=YesPlease
+	USE_LIBPCRE2=YesPlease
 	LIBPCREDIR=$withval
 	AC_MSG_NOTICE([Setting LIBPCREDIR to $LIBPCREDIR])
-        dnl USE_LIBPCRE1 can still be modified below, so don't substitute
+        dnl USE_LIBPCRE2 can still be modified below, so don't substitute
         dnl it yet.
 	GIT_CONF_SUBST([LIBPCREDIR])
     fi)
-- 
2.11.0
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 19 of 22 in “PCRE v1 improvements & PCRE v2 support”
  1. 00/18 PCRE v1 improvements & PCRE v2 supportÆvar Arnfjörð Bjarmason, Apr 20, 2017
  2. 01/18 grep: amend submodule recursion test in preparation for rx engine testingÆvar Arnfjörð Bjarmason, Apr 20, 2017
  3. Brandon WilliamsApr 20, 2017
  4. 02/18 grep: add tests for grep pattern types being passed to submodulesÆvar Arnfjörð Bjarmason, Apr 20, 2017
  5. 03/18 grep: submodule-related case statements should die if new fields are addedÆvar Arnfjörð Bjarmason, Apr 20, 2017
  6. Brandon WilliamsApr 20, 2017
  7. Jeff KingApr 20, 2017
  8. 04/18 grep: remove redundant regflags assignment under PCREÆvar Arnfjörð Bjarmason, Apr 20, 2017
  9. 05/18 Makefile & configure: reword outdated comment about PCREÆvar Arnfjörð Bjarmason, Apr 20, 2017
  10. 06/18 grep: add a test for backreferences in PCRE patternsÆvar Arnfjörð Bjarmason, Apr 20, 2017
  11. 08/18 log: add -P as a synonym for --perl-regexpÆvar Arnfjörð Bjarmason, Apr 20, 2017
  12. 09/18 grep & rev-list doc: stop promising libpcre for --perl-regexpÆvar Arnfjörð Bjarmason, Apr 20, 2017
  13. 10/18 grep: make grep.patternType=[pcre|pcre1] a synonym for "perl"Ævar Arnfjörð Bjarmason, Apr 20, 2017
  14. 11/18 test-lib: rename the LIBPCRE prerequisite to PCREÆvar Arnfjörð Bjarmason, Apr 20, 2017
  15. 12/18 grep: change the internal PCRE macro names to be PCRE1Ævar Arnfjörð Bjarmason, Apr 20, 2017
  16. 13/18 grep: change the internal PCRE code & header names to be PCRE1Ævar Arnfjörð Bjarmason, Apr 20, 2017
  17. 07/18 log: add exhaustive tests for pattern style options & configÆvar Arnfjörð Bjarmason, Apr 20, 2017
  18. 14/18 perf: add a performance comparison test of grep -E and -PÆvar Arnfjörð Bjarmason, Apr 20, 2017
  19. 18/18 Makefile & configure: make PCRE v2 the default PCRE implementationÆvar Arnfjörð Bjarmason, Apr 20, 2017
  20. 16/18 grep: add support for PCRE v2Ævar Arnfjörð Bjarmason, Apr 20, 2017
  21. 17/18 grep: remove support concurrent use of both PCRE v1 & v2Ævar Arnfjörð Bjarmason, Apr 20, 2017
  22. 15/18 grep: add support for the PCRE v1 JIT APIÆvar Arnfjörð Bjarmason, Apr 20, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.