Makefile: make USE_LIBPCRE=YesPlease mean v2, not v1

Change the USE_LIBPCRE flag from being an alias for USE_LIBPCRE1 to being an alias for USE_LIBPCRE2. When support for v2 was added in my 94da9193a6 ("grep: add support for PCRE v2", 2017-06-01) the existing USE_LIBPCRE flag was left as meaning v1, with a note that this would likely change in a future release. That optional support for v2 first made it into Git version 2.14.0. The PCRE v2 support has been shown to be stable, and the upstream PCRE project is highly encouraging downstream users to move to v2, so it makes sense to give packagers of Git who haven't heard the news about PCRE v2 a further nudge to move to v2. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Mar 11, 2018 at 13:26 UTC e6c531b80819a81b7ea37fc295f2edda5f345212
2 files changed +26 -26
Makefile
+13 -13
@@ -29,10 +29,10 @@ all::
29 # Perl-compatible regular expressions instead of standard or extended
30 # POSIX regular expressions.
31 #
32 -# Currently USE_LIBPCRE is a synonym for USE_LIBPCRE1, define
33 -# USE_LIBPCRE2 instead if you'd like to use version 2 of the PCRE
34 -# library. The USE_LIBPCRE flag will likely be changed to mean v2 by
35 -# default in future releases.
32 +# USE_LIBPCRE is a synonym for USE_LIBPCRE2, define USE_LIBPCRE1
33 +# instead if you'd like to use the legacy version 1 of the PCRE
34 +# library. Support for version 1 will likely be removed in some future
35 +# release of Git, as upstream has all but abandoned it.
36 #
37 # When using USE_LIBPCRE1, define NO_LIBPCRE1_JIT if the PCRE v1
38 # library is compiled without --enable-jit. We will auto-detect
@@ -1164,13 +1164,18 @@ ifdef NO_LIBGEN_H
1164 COMPAT_OBJS += compat/basename.o
1165 endif
1166
1167 -USE_LIBPCRE1 ?= $(USE_LIBPCRE)
1167 +USE_LIBPCRE2 ?= $(USE_LIBPCRE)
1168
1169 -ifneq (,$(USE_LIBPCRE1))
1170 - ifdef USE_LIBPCRE2
1171 -$(error Only set USE_LIBPCRE1 (or its alias USE_LIBPCRE) or USE_LIBPCRE2, not both!)
1169 +ifneq (,$(USE_LIBPCRE2))
1170 + ifdef USE_LIBPCRE1
1171 +$(error Only set USE_LIBPCRE2 (or its alias USE_LIBPCRE) or USE_LIBPCRE1, not both!)
1172 endif
1173
1174 + BASIC_CFLAGS += -DUSE_LIBPCRE2
1175 + EXTLIBS += -lpcre2-8
1176 +endif
1177 +
1178 +ifdef USE_LIBPCRE1
1179 BASIC_CFLAGS += -DUSE_LIBPCRE1
1180 EXTLIBS += -lpcre
1181
@@ -1179,11 +1184,6 @@ ifdef NO_LIBPCRE1_JIT
1184 endif
1185 endif
1186
1182 -ifdef USE_LIBPCRE2
1183 - BASIC_CFLAGS += -DUSE_LIBPCRE2
1184 - EXTLIBS += -lpcre2-8
1185 -endif
1186 -
1187 ifdef LIBPCREDIR
1188 BASIC_CFLAGS += -I$(LIBPCREDIR)/include
1189 EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)
configure.ac
+13 -13
@@ -254,25 +254,25 @@ GIT_PARSE_WITH([openssl]))
254 # Perl-compatible regular expressions instead of standard or extended
255 # POSIX regular expressions.
256 #
257 -# Currently USE_LIBPCRE is a synonym for USE_LIBPCRE1, define
258 -# USE_LIBPCRE2 instead if you'd like to use version 2 of the PCRE
259 -# library. The USE_LIBPCRE flag will likely be changed to mean v2 by
260 -# default in future releases.
257 +# USE_LIBPCRE is a synonym for USE_LIBPCRE2, define USE_LIBPCRE1
258 +# instead if you'd like to use the legacy version 1 of the PCRE
259 +# library. Support for version 1 will likely be removed in some future
260 +# release of Git, as upstream has all but abandoned it.
261 #
262 # Define LIBPCREDIR=/foo/bar if your PCRE header and library files are in
263 # /foo/bar/include and /foo/bar/lib directories.
264 #
265 AC_ARG_WITH(libpcre,
266 -AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre1]),
266 +AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre2]),
267 if test "$withval" = "no"; then
268 - USE_LIBPCRE1=
268 + USE_LIBPCRE2=
269 elif test "$withval" = "yes"; then
270 - USE_LIBPCRE1=YesPlease
270 + USE_LIBPCRE2=YesPlease
271 else
272 - USE_LIBPCRE1=YesPlease
272 + USE_LIBPCRE2=YesPlease
273 LIBPCREDIR=$withval
274 AC_MSG_NOTICE([Setting LIBPCREDIR to $LIBPCREDIR])
275 - dnl USE_LIBPCRE1 can still be modified below, so don't substitute
275 + dnl USE_LIBPCRE2 can still be modified below, so don't substitute
276 dnl it yet.
277 GIT_CONF_SUBST([LIBPCREDIR])
278 fi)
@@ -280,10 +280,6 @@ AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre1]),
280 AC_ARG_WITH(libpcre1,
281 AS_HELP_STRING([--with-libpcre1],[support Perl-compatible regexes via libpcre1 (default is NO)])
282 AS_HELP_STRING([], [ARG can be also prefix for libpcre library and headers]),
283 - if test -n "$USE_LIBPCRE1"; then
284 - AC_MSG_ERROR([Only supply one of --with-libpcre or its synonym --with-libpcre1!])
285 - fi
286 -
283 if test "$withval" = "no"; then
284 USE_LIBPCRE1=
285 elif test "$withval" = "yes"; then
@@ -300,6 +296,10 @@ AS_HELP_STRING([], [ARG can be also prefix for libpcre library and hea
296 AC_ARG_WITH(libpcre2,
297 AS_HELP_STRING([--with-libpcre2],[support Perl-compatible regexes via libpcre2 (default is NO)])
298 AS_HELP_STRING([], [ARG can be also prefix for libpcre library and headers]),
299 + if test -n "$USE_LIBPCRE2"; then
300 + AC_MSG_ERROR([Only supply one of --with-libpcre or its synonym --with-libpcre2!])
301 + fi
302 +
303 if test -n "$USE_LIBPCRE1"; then
304 AC_MSG_ERROR([Only supply one of --with-libpcre1 or --with-libpcre2!])
305 fi