git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Joshua Jensen" <jjensen@workspacewhiz.com>,
	"Johannes Sixt" <j6t@kdbg.org>,
	"Brandon Casey" <drafnel@gmail.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH/RFC v3 1/8] Makefile & configure: add a NO_FNMATCH flag
Date: Sun,  3 Oct 2010 09:56:39 +0000	[thread overview]
Message-ID: <1286099806-25774-2-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <4CA847D5.4000903@workspacewhiz.com>

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 <avarab@gmail.com>
---
 Makefile      |   18 +++++++++++++-----
 config.mak.in |    1 +
 configure.ac  |    6 ++++++
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 8a56b9a..f7c4383 100644
--- a/Makefile
+++ b/Makefile
@@ -70,6 +70,8 @@ all::
 #
 # Define NO_STRTOK_R if you don't have strtok_r in the C library.
 #
+# Define NO_FNMATCH if you don't have fnmatch in the C library.
+#
 # Define NO_LIBGEN_H if you don't have libgen.h.
 #
 # Define NEEDS_LIBGEN if your libgen needs -lgen when linking
@@ -1052,6 +1054,7 @@ ifeq ($(uname_S),Windows)
 	NO_STRCASESTR = YesPlease
 	NO_STRLCPY = YesPlease
 	NO_STRTOK_R = YesPlease
+	NO_FNMATCH = YesPlease
 	NO_MEMMEM = YesPlease
 	# NEEDS_LIBICONV = YesPlease
 	NO_ICONV = YesPlease
@@ -1081,8 +1084,8 @@ ifeq ($(uname_S),Windows)
 	AR = compat/vcbuild/scripts/lib.pl
 	CFLAGS =
 	BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
-	COMPAT_OBJS = compat/msvc.o compat/fnmatch/fnmatch.o compat/winansi.o compat/win32/pthread.o
-	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/fnmatch -Icompat/regex -Icompat/fnmatch -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
+	COMPAT_OBJS = compat/msvc.o compat/winansi.o compat/win32/pthread.o
+	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
 	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
 	EXTLIBS = advapi32.lib shell32.lib wininet.lib ws2_32.lib
 	PTHREAD_LIBS =
@@ -1107,6 +1110,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
 	NO_STRCASESTR = YesPlease
 	NO_STRLCPY = YesPlease
 	NO_STRTOK_R = YesPlease
+	NO_FNMATCH = YesPlease
 	NO_MEMMEM = YesPlease
 	NEEDS_LIBICONV = YesPlease
 	OLD_ICONV = YesPlease
@@ -1128,10 +1132,9 @@ ifneq (,$(findstring MINGW,$(uname_S)))
 	NO_PYTHON = YesPlease
 	BLK_SHA1 = YesPlease
 	ETAGS_TARGET = ETAGS
-	COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch -Icompat/win32
+	COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/win32
 	COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
-	COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o \
-		compat/win32/pthread.o
+	COMPAT_OBJS += compat/mingw.o compat/winansi.o compat/win32/pthread.o
 	EXTLIBS += -lws2_32
 	PTHREAD_LIBS =
 	X = .exe
@@ -1342,6 +1345,11 @@ ifdef NO_STRTOK_R
 	COMPAT_CFLAGS += -DNO_STRTOK_R
 	COMPAT_OBJS += compat/strtok_r.o
 endif
+ifdef NO_FNMATCH
+	COMPAT_CFLAGS += -Icompat/fnmatch
+	COMPAT_CFLAGS += -DNO_FNMATCH
+	COMPAT_OBJS += compat/fnmatch/fnmatch.o
+endif
 ifdef NO_SETENV
 	COMPAT_CFLAGS += -DNO_SETENV
 	COMPAT_OBJS += compat/setenv.o
diff --git a/config.mak.in b/config.mak.in
index a0c34ee..aaa70a8 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_STRTOK_R=@NO_STRTOK_R@
+NO_FNMATCH=@NO_FNMATCH@
 NO_MEMMEM=@NO_MEMMEM@
 NO_STRLCPY=@NO_STRLCPY@
 NO_UINTMAX_T=@NO_UINTMAX_T@
diff --git a/configure.ac b/configure.ac
index cc55b6d..7715f6c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -818,6 +818,12 @@ GIT_CHECK_FUNC(strtok_r,
 [NO_STRTOK_R=YesPlease])
 AC_SUBST(NO_STRTOK_R)
 #
+# Define NO_FNMATCH if you don't have fnmatch
+GIT_CHECK_FUNC(fnmatch,
+[NO_FNMATCH=],
+[NO_FNMATCH=YesPlease])
+AC_SUBST(NO_FNMATCH)
+#
 # Define NO_MEMMEM if you don't have memmem.
 GIT_CHECK_FUNC(memmem,
 [NO_MEMMEM=],
-- 
1.7.3.159.g610493

  parent reply	other threads:[~2010-10-03  9:57 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-03  4:32 [PATCH v2 0/6] Extensions of core.ignorecase=true support Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 1/6] Add string comparison functions that respect the ignore_case variable Joshua Jensen
2010-10-03  8:30   ` Ævar Arnfjörð Bjarmason
2010-10-03  9:07     ` Joshua Jensen
2010-10-03  9:56       ` [PATCH/RFC v3 0/8] ab/icase-directory: jj/icase-directory with Makefile + configure checks Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` Ævar Arnfjörð Bjarmason [this message]
2010-10-03  9:56       ` [PATCH/RFC v3 2/8] Makefile & configure: add a NO_FNMATCH_CASEFOLD flag Ævar Arnfjörð Bjarmason
2010-10-03 17:58         ` Johannes Sixt
2010-10-04  2:48           ` [PATCH/RFC v4 " Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 3/8] Add string comparison functions that respect the ignore_case variable Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 4/8] Case insensitivity support for .gitignore via core.ignorecase Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 5/8] Add case insensitivity support for directories when using git status Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 6/8] Add case insensitivity support when using git ls-files Ævar Arnfjörð Bjarmason
2010-10-03 11:54         ` Thomas Adam
2010-10-03 18:19           ` Johannes Sixt
2010-10-03 21:59             ` Thomas Adam
2010-10-04  7:49             ` Jonathan Nieder
2010-10-04  8:02               ` Ævar Arnfjörð Bjarmason
2010-10-04 14:03               ` Erik Faye-Lund
2010-10-04 14:58                 ` Joshua Jensen
2010-10-04 17:03                   ` Jonathan Nieder
2010-10-04 16:02         ` Robin Rosenberg
2010-10-04 16:41           ` Ævar Arnfjörð Bjarmason
2010-10-04 16:48           ` Erik Faye-Lund
2010-10-04 16:49           ` Joshua Jensen
2010-10-04 17:08             ` Jonathan Nieder
2010-10-04 17:53             ` Ævar Arnfjörð Bjarmason
2010-10-04 19:02           ` Johannes Sixt
2010-10-04 19:17             ` Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 7/8] Support case folding for git add when core.ignorecase=true Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 8/8] Support case folding in git fast-import " Ævar Arnfjörð Bjarmason
2010-10-07  4:13       ` [PATCH v2 1/6] Add string comparison functions that respect the ignore_case variable Junio C Hamano
2010-10-07  5:48         ` Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 2/6] Case insensitivity support for .gitignore via core.ignorecase Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 3/6] Add case insensitivity support for directories when using git status Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 4/6] Add case insensitivity support when using git ls-files Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 5/6] Support case folding for git add when core.ignorecase=true Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 6/6] Support case folding in git fast-import " Joshua Jensen
2010-10-03 13:00   ` Sverre Rabbelier
2010-10-03  8:17 ` [PATCH v2 0/6] Extensions of core.ignorecase=true support Johannes Sixt
2010-10-03 23:34   ` Junio C Hamano
2010-10-03 11:48 ` Robert Buck
2010-10-03 18:12   ` Johannes Sixt
2010-10-06 22:04     ` Robert Buck
2010-10-06 22:46       ` Joshua Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286099806-25774-2-git-send-email-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=drafnel@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=jjensen@workspacewhiz.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).