Files
MINGW-packages/mingw-w64-git-git/0011-w64-msysgit-Use-GIT_CHECK_FUNC-for-regcomp-regex.patch
2014-10-09 23:57:23 +01:00

51 lines
1.2 KiB
Diff

From 6a66929952df080dd8134abd2577d7ee78e7db52 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Thu, 9 Oct 2014 23:39:06 +0100
Subject: [PATCH] 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 1f582bd..4a0ecab 100644
--- a/Makefile
+++ b/Makefile
@@ -1483,6 +1483,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 f1c1dfc..fedbe41 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