Files
MINGW-packages/mingw-w64-git-git/0011-Use-GIT_CHECK_FUNC-for-regcomp-regex.patch

51 lines
1.3 KiB
Diff

From 803533fc133221721abce9439586cc422d63f5f2 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Fri, 10 Oct 2014 00:08:31 +0100
Subject: [PATCH 11/16] Use GIT_CHECK_FUNC for regcomp (regex)
---
Makefile | 3 +++
configure.ac | 12 +++++++-----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index d3666c6..2eb1b46 100644
--- a/Makefile
+++ b/Makefile
@@ -1476,6 +1476,9 @@ ifdef NO_REGEX
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
endif
+ifdef REGEX_LIB
+ EXTLIBS += $(REGEX_LIB)
+endif
ifdef NATIVE_CRLF
BASIC_CFLAGS += -DNATIVE_CRLF
endif
diff --git a/configure.ac b/configure.ac
index 4881bbe..06af6b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -827,11 +827,13 @@ yippeeyeswehaveit
[ac_cv_c_excellent_regex=yes],
[ac_cv_c_excellent_regex=no])
])
-if test $ac_cv_c_excellent_regex = yes; then
- NO_REGEX=
-else
- NO_REGEX=YesPlease
-fi
+AS_IF([test "x$ac_cv_c_excellent_regex" = "xyes"],
+ [GIT_CHECK_FUNC([regcomp], [regex gnurx],
+ [REGEX_LIB=],
+ [REGEX_LIB=$ac_cv_search_regcomp])]
+ NO_REGEX=],
+ [NO_REGEX=YesPlease])
+GIT_CONF_SUBST([REGEX_LIB])
GIT_CONF_SUBST([NO_REGEX])
#
# Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
--
2.1.2