grep: make sure NO_LIBPCRE1_JIT disable JIT in PCRE1

e87de7cab4 ("grep: un-break building with PCRE < 8.32", 2017-05-25) added a restriction for JIT support that is no longer needed after pcre_jit_exec() calls were removed. Reorganize the definitions in grep.h so that JIT support could be detected early and NO_LIBPCRE1_JIT could be used reliably to enforce JIT doesn't get used. Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Carlo Marcelo Arenas Belón committed Aug 25, 2019 at 11:22 UTC 8991da6a3864d93d860afe4c510b4fdbf0da6363
2 files changed +3 -10
Makefile
+2 -7
@@ -34,13 +34,8 @@ all::
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
39 -# whether the version of the PCRE v1 library in use has JIT support at
40 -# all, but we unfortunately can't auto-detect whether JIT support
41 -# hasn't been compiled in in an otherwise JIT-supporting version. If
42 -# you have link-time errors about a missing `pcre_jit_exec` define
43 -# this, or recompile PCRE v1 with --enable-jit.
37 +# When using USE_LIBPCRE1, define NO_LIBPCRE1_JIT if you want to
38 +# disable JIT even if supported by your library.
39 #
40 # Define LIBPCREDIR=/foo/bar if your PCRE header and library files are
41 # in /foo/bar/include and /foo/bar/lib directories. Which version of
grep.h
+1 -3
@@ -3,14 +3,12 @@
3 #include "color.h"
4 #ifdef USE_LIBPCRE1
5 #include <pcre.h>
6 -#ifdef PCRE_CONFIG_JIT
7 -#if PCRE_MAJOR >= 8 && PCRE_MINOR >= 32
6 #ifndef NO_LIBPCRE1_JIT
7 +#ifdef PCRE_CONFIG_JIT
8 #define GIT_PCRE1_USE_JIT
9 #define GIT_PCRE_STUDY_JIT_COMPILE PCRE_STUDY_JIT_COMPILE
10 #endif
11 #endif
13 -#endif
12 #ifndef GIT_PCRE_STUDY_JIT_COMPILE
13 #define GIT_PCRE_STUDY_JIT_COMPILE 0
14 #endif