configure: fix a regression in PCRE v1 detection
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 11 Mar 2018 13:26:07 +0000 (13:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Mar 2018 22:27:36 +0000 (15:27 -0700)
Change the check for PCRE v1 to disable the --with-libpcre1 option if
the pcre_version() function can't be found in the pcre library. I
unintentionally changed this in my 94da9193a6 ("grep: add support for
PCRE v2", 2017-06-01) while renaming moving some variables.

The intent of this check ever since it was added in
a119f91e57 ("configure: Check for libpcre", 2011-05-09) is to
second-guess the user and turn off an explicitly provided
--with-libpcre if the library can't be found.

I don't think that behavior makes any sense, we shouldn't be
second-guessing the user with an auto-detection, but changing that
needs a bigger refactoring of this script, and only has marginal
benefits. So let's fix it to work as it was intended to work again.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
configure.ac
index 7f8415140f309e0522310fac3160b5a01cefc7cd..41ceb2ac81ee530d3b0a9ddac8f1ab1d5b4faf11 100644 (file)
@@ -549,8 +549,8 @@ if test -n "$USE_LIBPCRE1"; then
 GIT_STASH_FLAGS($LIBPCREDIR)
 
 AC_CHECK_LIB([pcre], [pcre_version],
 GIT_STASH_FLAGS($LIBPCREDIR)
 
 AC_CHECK_LIB([pcre], [pcre_version],
-[USE_LIBPCRE=YesPlease],
-[USE_LIBPCRE=])
+[USE_LIBPCRE1=YesPlease],
+[USE_LIBPCRE1=])
 
 GIT_UNSTASH_FLAGS($LIBPCREDIR)
 
 
 GIT_UNSTASH_FLAGS($LIBPCREDIR)