compat: add a basename() compatibility function
[gitweb.git] / Makefile
index a70b5f0dde655c3bb4efbcecf0ffd4831d83906d..a59f10687bd158757422809ad20022d84ead9b9a 100644 (file)
--- 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