зеркало из https://github.com/microsoft/git.git
Merge branch 'ab/pcre-v2'
Git can be built to use either v1 or v2 of the PCRE library, and so far, the build-time configuration USE_LIBPCRE=YesPlease instructed the build procedure to use v1, but now it means v2. USE_LIBPCRE1 and USE_LIBPCRE2 can be used to explicitly choose which version to use, as before. * ab/pcre-v2: Makefile: make USE_LIBPCRE=YesPlease mean v2, not v1 configure: detect redundant --with-libpcre & --with-libpcre1 configure: fix a regression in PCRE v1 detection
This commit is contained in:
Коммит
cac5351363
26
Makefile
26
Makefile
|
@ -29,10 +29,10 @@ all::
|
||||||
# Perl-compatible regular expressions instead of standard or extended
|
# Perl-compatible regular expressions instead of standard or extended
|
||||||
# POSIX regular expressions.
|
# POSIX regular expressions.
|
||||||
#
|
#
|
||||||
# Currently USE_LIBPCRE is a synonym for USE_LIBPCRE1, define
|
# USE_LIBPCRE is a synonym for USE_LIBPCRE2, define USE_LIBPCRE1
|
||||||
# USE_LIBPCRE2 instead if you'd like to use version 2 of the PCRE
|
# instead if you'd like to use the legacy version 1 of the PCRE
|
||||||
# library. The USE_LIBPCRE flag will likely be changed to mean v2 by
|
# library. Support for version 1 will likely be removed in some future
|
||||||
# default in future releases.
|
# release of Git, as upstream has all but abandoned it.
|
||||||
#
|
#
|
||||||
# When using USE_LIBPCRE1, define NO_LIBPCRE1_JIT if the PCRE v1
|
# When using USE_LIBPCRE1, define NO_LIBPCRE1_JIT if the PCRE v1
|
||||||
# library is compiled without --enable-jit. We will auto-detect
|
# library is compiled without --enable-jit. We will auto-detect
|
||||||
|
@ -1170,13 +1170,18 @@ ifdef NO_LIBGEN_H
|
||||||
COMPAT_OBJS += compat/basename.o
|
COMPAT_OBJS += compat/basename.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
USE_LIBPCRE1 ?= $(USE_LIBPCRE)
|
USE_LIBPCRE2 ?= $(USE_LIBPCRE)
|
||||||
|
|
||||||
ifneq (,$(USE_LIBPCRE1))
|
ifneq (,$(USE_LIBPCRE2))
|
||||||
ifdef USE_LIBPCRE2
|
ifdef USE_LIBPCRE1
|
||||||
$(error Only set USE_LIBPCRE1 (or its alias USE_LIBPCRE) or USE_LIBPCRE2, not both!)
|
$(error Only set USE_LIBPCRE2 (or its alias USE_LIBPCRE) or USE_LIBPCRE1, not both!)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
BASIC_CFLAGS += -DUSE_LIBPCRE2
|
||||||
|
EXTLIBS += -lpcre2-8
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef USE_LIBPCRE1
|
||||||
BASIC_CFLAGS += -DUSE_LIBPCRE1
|
BASIC_CFLAGS += -DUSE_LIBPCRE1
|
||||||
EXTLIBS += -lpcre
|
EXTLIBS += -lpcre
|
||||||
|
|
||||||
|
@ -1185,11 +1190,6 @@ ifdef NO_LIBPCRE1_JIT
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef USE_LIBPCRE2
|
|
||||||
BASIC_CFLAGS += -DUSE_LIBPCRE2
|
|
||||||
EXTLIBS += -lpcre2-8
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef LIBPCREDIR
|
ifdef LIBPCREDIR
|
||||||
BASIC_CFLAGS += -I$(LIBPCREDIR)/include
|
BASIC_CFLAGS += -I$(LIBPCREDIR)/include
|
||||||
EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)
|
EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)
|
||||||
|
|
26
configure.ac
26
configure.ac
|
@ -254,25 +254,25 @@ GIT_PARSE_WITH([openssl]))
|
||||||
# Perl-compatible regular expressions instead of standard or extended
|
# Perl-compatible regular expressions instead of standard or extended
|
||||||
# POSIX regular expressions.
|
# POSIX regular expressions.
|
||||||
#
|
#
|
||||||
# Currently USE_LIBPCRE is a synonym for USE_LIBPCRE1, define
|
# USE_LIBPCRE is a synonym for USE_LIBPCRE2, define USE_LIBPCRE1
|
||||||
# USE_LIBPCRE2 instead if you'd like to use version 2 of the PCRE
|
# instead if you'd like to use the legacy version 1 of the PCRE
|
||||||
# library. The USE_LIBPCRE flag will likely be changed to mean v2 by
|
# library. Support for version 1 will likely be removed in some future
|
||||||
# default in future releases.
|
# release of Git, as upstream has all but abandoned it.
|
||||||
#
|
#
|
||||||
# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are in
|
# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are in
|
||||||
# /foo/bar/include and /foo/bar/lib directories.
|
# /foo/bar/include and /foo/bar/lib directories.
|
||||||
#
|
#
|
||||||
AC_ARG_WITH(libpcre,
|
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
|
if test "$withval" = "no"; then
|
||||||
USE_LIBPCRE1=
|
USE_LIBPCRE2=
|
||||||
elif test "$withval" = "yes"; then
|
elif test "$withval" = "yes"; then
|
||||||
USE_LIBPCRE1=YesPlease
|
USE_LIBPCRE2=YesPlease
|
||||||
else
|
else
|
||||||
USE_LIBPCRE1=YesPlease
|
USE_LIBPCRE2=YesPlease
|
||||||
LIBPCREDIR=$withval
|
LIBPCREDIR=$withval
|
||||||
AC_MSG_NOTICE([Setting LIBPCREDIR to $LIBPCREDIR])
|
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.
|
dnl it yet.
|
||||||
GIT_CONF_SUBST([LIBPCREDIR])
|
GIT_CONF_SUBST([LIBPCREDIR])
|
||||||
fi)
|
fi)
|
||||||
|
@ -296,6 +296,10 @@ AS_HELP_STRING([], [ARG can be also prefix for libpcre library and hea
|
||||||
AC_ARG_WITH(libpcre2,
|
AC_ARG_WITH(libpcre2,
|
||||||
AS_HELP_STRING([--with-libpcre2],[support Perl-compatible regexes via libpcre2 (default is NO)])
|
AS_HELP_STRING([--with-libpcre2],[support Perl-compatible regexes via libpcre2 (default is NO)])
|
||||||
AS_HELP_STRING([], [ARG can be also prefix for libpcre library and headers]),
|
AS_HELP_STRING([], [ARG can be also prefix for libpcre library and headers]),
|
||||||
|
if test -n "$USE_LIBPCRE2"; then
|
||||||
|
AC_MSG_ERROR([Only supply one of --with-libpcre or its synonym --with-libpcre2!])
|
||||||
|
fi
|
||||||
|
|
||||||
if test -n "$USE_LIBPCRE1"; then
|
if test -n "$USE_LIBPCRE1"; then
|
||||||
AC_MSG_ERROR([Only supply one of --with-libpcre1 or --with-libpcre2!])
|
AC_MSG_ERROR([Only supply one of --with-libpcre1 or --with-libpcre2!])
|
||||||
fi
|
fi
|
||||||
|
@ -549,8 +553,8 @@ if test -n "$USE_LIBPCRE1"; then
|
||||||
GIT_STASH_FLAGS($LIBPCREDIR)
|
GIT_STASH_FLAGS($LIBPCREDIR)
|
||||||
|
|
||||||
AC_CHECK_LIB([pcre], [pcre_version],
|
AC_CHECK_LIB([pcre], [pcre_version],
|
||||||
[USE_LIBPCRE=YesPlease],
|
[USE_LIBPCRE1=YesPlease],
|
||||||
[USE_LIBPCRE=])
|
[USE_LIBPCRE1=])
|
||||||
|
|
||||||
GIT_UNSTASH_FLAGS($LIBPCREDIR)
|
GIT_UNSTASH_FLAGS($LIBPCREDIR)
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче