From 4de066b6f12a17b2b4d3206ee66efb251e1cdd29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Mon, 4 Oct 2010 02:48:11 +0000 Subject: Makefile & configure: add a NO_FNMATCH_CASEFOLD flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On some platforms (like Solaris) there is a fnmatch, but it doesn't support the GNU FNM_CASEFOLD extension that's used by the jj/icase-directory series' fnmatch_icase wrapper. Change the Makefile so that it's now possible to set NO_FNMATCH_CASEFOLD=YesPlease on those systems, and add a configure probe for it. Unlike the NO_REGEX check we don't add AC_INCLUDES_DEFAULT to our headers. This is because on a GNU system the definition of FNM_CASEFOLD in fnmatch.h is guarded by: #if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE One of the headers AC_INCLUDES_DEFAULT includes ends up defining one of those, so if we'd use it we'd always get NO_FNMATCH_CASEFOLD=YesPlease on GNU systems, even though they have FNM_CASEFOLD. When checking the flags we use: ifdef NO_FNMATCH ... else ifdef NO_FNMATCH_CASEFOLD ... endif endif The "else" so that we don't link against compat/fnmatch/fnmatch.o twice if both NO_FNMATCH and NO_FNMATCH_CASEFOLD are defined. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- configure.ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 3aa59bc615..cbca4c763a 100644 --- a/configure.ac +++ b/configure.ac @@ -789,6 +789,28 @@ GIT_CHECK_FUNC(fnmatch, [NO_FNMATCH=YesPlease]) AC_SUBST(NO_FNMATCH) # +# Define NO_FNMATCH_CASEFOLD if your fnmatch function doesn't have the +# FNM_CASEFOLD GNU extension. +AC_CACHE_CHECK([whether the fnmatch function supports the FNMATCH_CASEFOLD GNU extension], + [ac_cv_c_excellent_fnmatch], [ +AC_EGREP_CPP(yippeeyeswehaveit, + AC_LANG_PROGRAM([ +#include +], +[#ifdef FNM_CASEFOLD +yippeeyeswehaveit +#endif +]), + [ac_cv_c_excellent_fnmatch=yes], + [ac_cv_c_excellent_fnmatch=no]) +]) +if test $ac_cv_c_excellent_fnmatch = yes; then + NO_FNMATCH_CASEFOLD= +else + NO_FNMATCH_CASEFOLD=YesPlease +fi +AC_SUBST(NO_FNMATCH_CASEFOLD) +# # Define NO_MEMMEM if you don't have memmem. GIT_CHECK_FUNC(memmem, [NO_MEMMEM=], -- cgit v1.2.1