read-cache: split-index mode
[gitweb.git] / Makefile
index 36463919afd6ee40c3a0487e481ebbaadce7b6d8..94ad3cec7fcb8dc345f95f249d7abba022df206e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,8 +34,18 @@ all::
 # git-http-push are not built, and you cannot use http:// and https://
 # transports (neither smart nor dumb).
 #
+# Define CURL_CONFIG to the path to a curl-config binary other than the
+# default 'curl-config'.  If CURL_CONFIG is unset or points to a binary that
+# is not found, defaults to the CURLDIR behavior.
+#
+# Define CURL_STATIC to statically link libcurl.  Only applies if
+# CURL_CONFIG is used.
+#
 # Define CURLDIR=/foo/bar if your curl header and library files are in
-# /foo/bar/include and /foo/bar/lib directories.
+# /foo/bar/include and /foo/bar/lib directories.  This overrides
+# CURL_CONFIG, but is less robust.  If not set, and CURL_CONFIG is not set,
+# uses -lcurl with no additional library detection (other than
+# NEEDS_*_WITH_CURL).
 #
 # Define NO_EXPAT if you do not have expat installed.  git-http-push is
 # not built, and you cannot push using http:// and https:// transports (dumb).
@@ -59,9 +69,9 @@ all::
 # FreeBSD can use either, but MinGW and some others need to use
 # libcharset.h's locale_charset() instead.
 #
-# Define CHARSET_LIB to you need to link with library other than -liconv to
+# Define CHARSET_LIB to the library you need to link with in order to
 # use locale_charset() function.  On some platforms this needs to set to
-# -lcharset
+# -lcharset, on others to -liconv .
 #
 # Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't
 # need -lintl when linking.
@@ -143,15 +153,17 @@ all::
 #
 # Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin).
 #
-# Define NEEDS_SSL_WITH_CURL if you need -lssl with -lcurl (Minix).
+# Define NEEDS_SSL_WITH_CURL if you need -lssl with -lcurl (Minix).  Only used
+# if CURLDIR is set.
 #
-# Define NEEDS_IDN_WITH_CURL if you need -lidn when using -lcurl (Minix).
+# Define NEEDS_IDN_WITH_CURL if you need -lidn when using -lcurl (Minix).  Only
+# used if CURLDIR is set.
 #
 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
 #
 # Define NEEDS_LIBINTL_BEFORE_LIBICONV if you need libintl before libiconv.
 #
-# Define NO_INTPTR_T if you don't have intptr_t nor uintptr_t.
+# Define NO_INTPTR_T if you don't have intptr_t or uintptr_t.
 #
 # Define NO_UINTMAX_T if you don't have uintmax_t.
 #
@@ -338,6 +350,9 @@ all::
 # Define TEST_GIT_INDEX_VERSION to 2, 3 or 4 to run the test suite
 # with a different indexfile format version.  If it isn't set the index
 # file format used is index-v[23].
+#
+# Define GMTIME_UNRELIABLE_ERRORS if your gmtime() function does not
+# return NULL when it receives a bogus time_t.
 
 GIT-VERSION-FILE: FORCE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -872,6 +887,7 @@ LIB_OBJS += sha1_name.o
 LIB_OBJS += shallow.o
 LIB_OBJS += sideband.o
 LIB_OBJS += sigchain.o
+LIB_OBJS += split-index.o
 LIB_OBJS += strbuf.o
 LIB_OBJS += streaming.o
 LIB_OBJS += string-list.o
@@ -1115,20 +1131,44 @@ ifdef NO_CURL
        REMOTE_CURL_NAMES =
 else
        ifdef CURLDIR
-               # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
-               BASIC_CFLAGS += -I$(CURLDIR)/include
-               CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
+               CURL_LIBCURL =
        else
-               CURL_LIBCURL = -lcurl
-       endif
-       ifdef NEEDS_SSL_WITH_CURL
-               CURL_LIBCURL += -lssl
-               ifdef NEEDS_CRYPTO_WITH_SSL
-                       CURL_LIBCURL += -lcrypto
+               CURL_CONFIG = curl-config
+               ifeq "$(CURL_CONFIG)" ""
+                       CURL_LIBCURL =
+               else
+                       CURL_LIBCURL := $(shell $(CURL_CONFIG) --libs)
                endif
        endif
-       ifdef NEEDS_IDN_WITH_CURL
-               CURL_LIBCURL += -lidn
+
+       ifeq "$(CURL_LIBCURL)" ""
+               ifdef CURL_STATIC
+$(error "CURL_STATIC must be used with CURL_CONFIG")
+               endif
+               ifdef CURLDIR
+                       # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
+                       BASIC_CFLAGS += -I$(CURLDIR)/include
+                       CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
+               else
+                       CURL_LIBCURL = -lcurl
+               endif
+               ifdef NEEDS_SSL_WITH_CURL
+                       CURL_LIBCURL += -lssl
+                       ifdef NEEDS_CRYPTO_WITH_SSL
+                               CURL_LIBCURL += -lcrypto
+                       endif
+               endif
+               ifdef NEEDS_IDN_WITH_CURL
+                       CURL_LIBCURL += -lidn
+               endif
+       else
+               BASIC_CFLAGS += $(shell $(CURL_CONFIG) --cflags)
+               ifdef CURL_STATIC
+                       CURL_LIBCURL = $(shell $(CURL_CONFIG) --static-libs)
+                       ifeq "$(CURL_LIBCURL)" ""
+$(error libcurl not detected or not compiled with static support)
+                       endif
+               endif
        endif
 
        REMOTE_CURL_PRIMARY = git-remote-http$X
@@ -1489,6 +1529,11 @@ ifneq (,$(XDL_FAST_HASH))
        BASIC_CFLAGS += -DXDL_FAST_HASH
 endif
 
+ifdef GMTIME_UNRELIABLE_ERRORS
+       COMPAT_OBJS += compat/gmtime.o
+       BASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS
+endif
+
 ifeq ($(TCLTK_PATH),)
 NO_TCLTK = NoThanks
 endif
@@ -2094,7 +2139,7 @@ pdf:
 
 XGETTEXT_FLAGS = \
        --force-po \
-       --add-comments \
+       --add-comments=TRANSLATORS: \
        --msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \
        --from-code=UTF-8
 XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \