summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2009-05-31 08:35:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-06-01 00:57:59 (GMT)
commite1c068869216c8c231c1585bbfa9fda42b4756f8 (patch)
tree929b5984b0ce8bfaba925a84ebb5ae04e7559e28 /Makefile
parent0620b39b3b7b1f27bf863d9591fd8146a9a8931d (diff)
downloadgit-e1c068869216c8c231c1585bbfa9fda42b4756f8.zip
git-e1c068869216c8c231c1585bbfa9fda42b4756f8.tar.gz
git-e1c068869216c8c231c1585bbfa9fda42b4756f8.tar.bz2
compat: add a basename() compatibility function
Some systems such as Windows lack libgen.h so provide a basename() implementation for cross-platform use. This introduces the NO_LIBGEN_H construct to the Makefile and autoconf scripts. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index a70b5f0..a59f106 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,8 @@ all::
#
# Define NO_MKSTEMPS if you don't have mkstemps in the C library.
#
+# Define NO_LIBGEN_H if you don't have libgen.h.
+#
# Define NO_SYS_SELECT_H if you don't have sys/select.h.
#
# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
@@ -834,6 +836,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_PREAD = YesPlease
NO_OPENSSL = YesPlease
NO_CURL = YesPlease
+ NO_LIBGEN_H = YesPlease
NO_SYMLINK_HEAD = YesPlease
NO_IPV6 = YesPlease
NO_SETENV = YesPlease
@@ -899,6 +902,11 @@ ifndef CC_LD_DYNPATH
endif
endif
+ifdef NO_LIBGEN_H
+ COMPAT_CFLAGS += -DNO_LIBGEN_H
+ COMPAT_OBJS += compat/basename.o
+endif
+
ifdef NO_CURL
BASIC_CFLAGS += -DNO_CURL
else