From f3f3d9366edc4c150c59df929198a77ecdf69cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 3 Oct 2010 09:56:39 +0000 Subject: Makefile & configure: add a NO_FNMATCH flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows and MinGW both lack fnmatch() in their C library and needed compat/fnmatch, but they had duplicate code for adding the compat function, and there was no Makefile flag or configure check for fnmatch. Change the Makefile it so that it's now possible to compile the compat function with a NO_FNMATCH=YesPlease flag, and add a configure probe for it. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- config.mak.in | 1 + 1 file changed, 1 insertion(+) (limited to 'config.mak.in') diff --git a/config.mak.in b/config.mak.in index b4e65c32b2..49f3df5f20 100644 --- a/config.mak.in +++ b/config.mak.in @@ -46,6 +46,7 @@ NO_IPV6=@NO_IPV6@ NO_C99_FORMAT=@NO_C99_FORMAT@ NO_HSTRERROR=@NO_HSTRERROR@ NO_STRCASESTR=@NO_STRCASESTR@ +NO_FNMATCH=@NO_FNMATCH@ NO_MEMMEM=@NO_MEMMEM@ NO_STRLCPY=@NO_STRLCPY@ NO_UINTMAX_T=@NO_UINTMAX_T@ -- cgit v1.2.3 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 --- config.mak.in | 1 + 1 file changed, 1 insertion(+) (limited to 'config.mak.in') diff --git a/config.mak.in b/config.mak.in index 49f3df5f20..e4c3f569a3 100644 --- a/config.mak.in +++ b/config.mak.in @@ -47,6 +47,7 @@ NO_C99_FORMAT=@NO_C99_FORMAT@ NO_HSTRERROR=@NO_HSTRERROR@ NO_STRCASESTR=@NO_STRCASESTR@ NO_FNMATCH=@NO_FNMATCH@ +NO_FNMATCH_CASEFOLD=@NO_FNMATCH_CASEFOLD@ NO_MEMMEM=@NO_MEMMEM@ NO_STRLCPY=@NO_STRLCPY@ NO_UINTMAX_T=@NO_UINTMAX_T@ -- cgit v1.2.3