builtin/receive-pack: fix incorrect pointer arithmetic
[gitweb.git] / Makefile
index 94ad3cec7fcb8dc345f95f249d7abba022df206e..2320de592e6dbc545866e6bfef09a05f660c2c14 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -30,22 +30,14 @@ all::
 # Define LIBPCREDIR=/foo/bar if your libpcre header and library files are in
 # /foo/bar/include and /foo/bar/lib directories.
 #
+# Define HAVE_ALLOCA_H if you have working alloca(3) defined in that header.
+#
 # Define NO_CURL if you do not have libcurl installed.  git-http-fetch and
 # 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.  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).
+# /foo/bar/include and /foo/bar/lib directories.
 #
 # 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).
@@ -153,11 +145,9 @@ 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).  Only used
-# if CURLDIR is set.
+# Define NEEDS_SSL_WITH_CURL if you need -lssl with -lcurl (Minix).
 #
-# Define NEEDS_IDN_WITH_CURL if you need -lidn when using -lcurl (Minix).  Only
-# used if CURLDIR is set.
+# Define NEEDS_IDN_WITH_CURL if you need -lidn when using -lcurl (Minix).
 #
 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
 #
@@ -195,9 +185,6 @@ all::
 # Define NO_STRUCT_ITIMERVAL if you don't have struct itimerval
 # This also implies NO_SETITIMER
 #
-# Define NO_THREAD_SAFE_PREAD if your pread() implementation is not
-# thread-safe. (e.g. compat/pread.c or cygwin)
-#
 # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
 # generally faster on your platform than accessing the working directory.
 #
@@ -353,6 +340,8 @@ all::
 #
 # Define GMTIME_UNRELIABLE_ERRORS if your gmtime() function does not
 # return NULL when it receives a bogus time_t.
+#
+# Define HAVE_CLOCK_GETTIME if your platform has clock_gettime in librt.
 
 GIT-VERSION-FILE: FORCE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -565,6 +554,7 @@ TEST_PROGRAMS_NEED_X += test-ctype
 TEST_PROGRAMS_NEED_X += test-date
 TEST_PROGRAMS_NEED_X += test-delta
 TEST_PROGRAMS_NEED_X += test-dump-cache-tree
+TEST_PROGRAMS_NEED_X += test-dump-split-index
 TEST_PROGRAMS_NEED_X += test-genrandom
 TEST_PROGRAMS_NEED_X += test-hashmap
 TEST_PROGRAMS_NEED_X += test-index-version
@@ -742,6 +732,7 @@ LIB_H += transport.h
 LIB_H += tree-walk.h
 LIB_H += tree.h
 LIB_H += unpack-trees.h
+LIB_H += unicode_width.h
 LIB_H += url.h
 LIB_H += urlmatch.h
 LIB_H += userdiff.h
@@ -1012,6 +1003,7 @@ BUILTIN_OBJS += builtin/update-ref.o
 BUILTIN_OBJS += builtin/update-server-info.o
 BUILTIN_OBJS += builtin/upload-archive.o
 BUILTIN_OBJS += builtin/var.o
+BUILTIN_OBJS += builtin/verify-commit.o
 BUILTIN_OBJS += builtin/verify-pack.o
 BUILTIN_OBJS += builtin/verify-tag.o
 BUILTIN_OBJS += builtin/write-tree.o
@@ -1124,6 +1116,10 @@ ifdef USE_LIBPCRE
        EXTLIBS += -lpcre
 endif
 
+ifdef HAVE_ALLOCA_H
+       BASIC_CFLAGS += -DHAVE_ALLOCA_H
+endif
+
 ifdef NO_CURL
        BASIC_CFLAGS += -DNO_CURL
        REMOTE_CURL_PRIMARY =
@@ -1131,45 +1127,21 @@ ifdef NO_CURL
        REMOTE_CURL_NAMES =
 else
        ifdef CURLDIR
-               CURL_LIBCURL =
+               # 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_CONFIG = curl-config
-               ifeq "$(CURL_CONFIG)" ""
-                       CURL_LIBCURL =
-               else
-                       CURL_LIBCURL := $(shell $(CURL_CONFIG) --libs)
-               endif
+               CURL_LIBCURL = -lcurl
        endif
-
-       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
+       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
 
        REMOTE_CURL_PRIMARY = git-remote-http$X
        REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
@@ -1376,10 +1348,6 @@ endif
 ifdef NO_PREAD
        COMPAT_CFLAGS += -DNO_PREAD
        COMPAT_OBJS += compat/pread.o
-       NO_THREAD_SAFE_PREAD = YesPlease
-endif
-ifdef NO_THREAD_SAFE_PREAD
-       BASIC_CFLAGS += -DNO_THREAD_SAFE_PREAD
 endif
 ifdef NO_FAST_WORKING_DIRECTORY
        BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
@@ -1534,6 +1502,11 @@ ifdef GMTIME_UNRELIABLE_ERRORS
        BASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS
 endif
 
+ifdef HAVE_CLOCK_GETTIME
+       BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME
+       EXTLIBS += -lrt
+endif
+
 ifeq ($(TCLTK_PATH),)
 NO_TCLTK = NoThanks
 endif
@@ -1589,13 +1562,13 @@ endif
 PROFILE_DIR := $(CURDIR)
 
 ifeq ("$(PROFILE)","GEN")
-       CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1
+       BASIC_CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1
        EXTLIBS += -lgcov
        export CCACHE_DISABLE = t
        V = 1
 else
 ifneq ("$(PROFILE)","")
-       CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1
+       BASIC_CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1
        export CCACHE_DISABLE = t
        V = 1
 endif
@@ -1680,12 +1653,20 @@ SHELL = $(SHELL_PATH)
 all:: shell_compatibility_test
 
 ifeq "$(PROFILE)" "BUILD"
-ifeq ($(filter all,$(MAKECMDGOALS)),all)
-all:: profile-clean
+all:: profile
+endif
+
+profile:: profile-clean
        $(MAKE) PROFILE=GEN all
        $(MAKE) PROFILE=GEN -j1 test
-endif
-endif
+       $(MAKE) PROFILE=GEN -j1 perf
+       $(MAKE) PROFILE=USE all
+
+profile-fast: profile-clean
+       $(MAKE) PROFILE=GEN all
+       $(MAKE) PROFILE=GEN -j1 perf
+       $(MAKE) PROFILE=USE all
+
 
 all:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
 ifneq (,$X)
@@ -2372,6 +2353,12 @@ mergetools_instdir_SQ = $(subst ','\'',$(mergetools_instdir))
 
 install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X)
 
+profile-install: profile
+       $(MAKE) install
+
+profile-fast-install: profile-fast
+       $(MAKE) install
+
 install: all
        $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
        $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'