Skip to content

Commit e6c531b

Browse files
avargitster
authored andcommitted
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 94da919 ("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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a363f98 commit e6c531b

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

Makefile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ all::
2929
# Perl-compatible regular expressions instead of standard or extended
3030
# POSIX regular expressions.
3131
#
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.
3636
#
3737
# When using USE_LIBPCRE1, define NO_LIBPCRE1_JIT if the PCRE v1
3838
# library is compiled without --enable-jit. We will auto-detect
@@ -1164,13 +1164,18 @@ ifdef NO_LIBGEN_H
11641164
COMPAT_OBJS += compat/basename.o
11651165
endif
11661166

1167-
USE_LIBPCRE1 ?= $(USE_LIBPCRE)
1167+
USE_LIBPCRE2 ?= $(USE_LIBPCRE)
11681168

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!)
11721172
endif
11731173

1174+
BASIC_CFLAGS += -DUSE_LIBPCRE2
1175+
EXTLIBS += -lpcre2-8
1176+
endif
1177+
1178+
ifdef USE_LIBPCRE1
11741179
BASIC_CFLAGS += -DUSE_LIBPCRE1
11751180
EXTLIBS += -lpcre
11761181

@@ -1179,11 +1184,6 @@ ifdef NO_LIBPCRE1_JIT
11791184
endif
11801185
endif
11811186

1182-
ifdef USE_LIBPCRE2
1183-
BASIC_CFLAGS += -DUSE_LIBPCRE2
1184-
EXTLIBS += -lpcre2-8
1185-
endif
1186-
11871187
ifdef LIBPCREDIR
11881188
BASIC_CFLAGS += -I$(LIBPCREDIR)/include
11891189
EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)

configure.ac

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -254,36 +254,32 @@ GIT_PARSE_WITH([openssl]))
254254
# Perl-compatible regular expressions instead of standard or extended
255255
# POSIX regular expressions.
256256
#
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.
261261
#
262262
# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are in
263263
# /foo/bar/include and /foo/bar/lib directories.
264264
#
265265
AC_ARG_WITH(libpcre,
266-
AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre1]),
266+
AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre2]),
267267
if test "$withval" = "no"; then
268-
USE_LIBPCRE1=
268+
USE_LIBPCRE2=
269269
elif test "$withval" = "yes"; then
270-
USE_LIBPCRE1=YesPlease
270+
USE_LIBPCRE2=YesPlease
271271
else
272-
USE_LIBPCRE1=YesPlease
272+
USE_LIBPCRE2=YesPlease
273273
LIBPCREDIR=$withval
274274
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
276276
dnl it yet.
277277
GIT_CONF_SUBST([LIBPCREDIR])
278278
fi)
279279

280280
AC_ARG_WITH(libpcre1,
281281
AS_HELP_STRING([--with-libpcre1],[support Perl-compatible regexes via libpcre1 (default is NO)])
282282
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-
287283
if test "$withval" = "no"; then
288284
USE_LIBPCRE1=
289285
elif test "$withval" = "yes"; then
@@ -300,6 +296,10 @@ AS_HELP_STRING([], [ARG can be also prefix for libpcre library and hea
300296
AC_ARG_WITH(libpcre2,
301297
AS_HELP_STRING([--with-libpcre2],[support Perl-compatible regexes via libpcre2 (default is NO)])
302298
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+
303303
if test -n "$USE_LIBPCRE1"; then
304304
AC_MSG_ERROR([Only supply one of --with-libpcre1 or --with-libpcre2!])
305305
fi

0 commit comments

Comments
 (0)