NO_IPV6 support for git daemon
[gitweb.git] / Makefile
index 67279203e8d3aabd57152e247a565462257bf406..2183903965cb67e614e654accfd996d7bae5b1b7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,8 @@
 #
 # Define WITH_OWN_SUBPROCESS_PY if you want to use with python 2.3.
 #
+# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
+#
 # Define COLLISION_CHECK below if you believe that SHA1's
 # 1461501637330902918203684832716283019655932542976 hashes do not give you
 # sufficient guarantee that no collisions between objects will ever happen.
@@ -97,7 +99,11 @@ SCRIPT_PYTHON = \
 # The ones that do not have to link with lcrypto nor lz.
 SIMPLE_PROGRAMS = \
        git-get-tar-commit-id git-mailinfo git-mailsplit git-stripspace \
-       git-daemon git-var
+       git-var
+ifndef NO_IPV6
+# Not supported to IPv6-challenged platforms yet
+SIMPLE_PROGRAMS += git-daemon
+endif
 
 # ... and all the rest
 PROGRAMS = \
@@ -116,6 +122,7 @@ PROGRAMS = \
        git-ssh-upload git-tar-tree git-unpack-file \
        git-unpack-objects git-update-index git-update-server-info \
        git-upload-pack git-verify-pack git-write-tree \
+       git-update-ref \
        $(SIMPLE_PROGRAMS)
 
 # Backward compatibility -- to be removed in 0.99.8
@@ -171,6 +178,11 @@ ifeq ($(shell uname -s),SunOS)
        TAR = gtar
        PLATFORM_DEFINES += -D__EXTENSIONS__
 endif
+ifeq ($(shell uname -o),Cygwin)
+       NO_STRCASESTR = YesPlease
+       NEEDS_LIBICONV = YesPlease
+       NO_IPV6 = YesPlease
+endif
 ifneq (,$(findstring arm,$(shell uname -m)))
        ARM_SHA1 = YesPlease
 endif
@@ -226,6 +238,9 @@ ifdef NO_STRCASESTR
        DEFINES += -Dstrcasestr=gitstrcasestr
        LIB_OBJS += compat/strcasestr.o
 endif
+ifdef NO_IPV6
+       DEFINES += -DNO_IPV6 -Dsockaddr_storage=sockaddr_in
+endif
 
 ifdef PPC_SHA1
        SHA1_HEADER = "ppc/sha1.h"
@@ -252,7 +267,7 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
          $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
          gitk
 
-export TAR INSTALL DESTDIR
+export TAR INSTALL DESTDIR SHELL_PATH
 ### Build rules
 
 all: $(PROGRAMS) $(SCRIPTS)
@@ -380,9 +395,9 @@ deb: dist
 ### Cleaning rules
 
 clean:
-       rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROGRAMS) $(LIB_FILE)
+       rm -f *.o mozilla-sha1/*.o ppc/*.o compat/*.o $(PROGRAMS) $(LIB_FILE)
        rm -f $(filter-out gitk,$(SCRIPTS))
-       rm -f git-core.spec
+       rm -f git-core.spec *.pyc *.pyo
        rm -rf $(GIT_TARNAME)
        rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
        rm -f git-core_$(GIT_VERSION)-*.deb git-core_$(GIT_VERSION)-*.dsc