From ebef82776512f56eec4b6ac98b076369eb5a93fa Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:32 +0000 Subject: Makefile: pass CPPFLAGS through to fllow customization Without this patch there is no straight forward way to pass additional CPPFLAGS at configure-time. At TWW, everything non-vendor package is installed to its own subdirectory, so we need the following to show the preprocessor where the headers for the libraries we will link later can be found: $SHELL ./configure \ CPPFLAGS="-I${SB_VAR_CURL_INC}\ -I${SB_VAR_LIBEXPAT_INC}\ -I${SB_VAR_LIBZ_INC}\ ${CPPFLAGS+ $CPPFLAGS}" <<...>> Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 910f4713e..da0cfda3e 100644 --- a/Makefile +++ b/Makefile @@ -246,7 +246,7 @@ endif CFLAGS = -g -O2 -Wall LDFLAGS = -ALL_CFLAGS = $(CFLAGS) +ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) ALL_LDFLAGS = $(LDFLAGS) STRIP ?= strip -- cgit v1.2.1 From 48793cf46a286a21df420fdd7fc4b0c91c60a0c8 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:34 +0000 Subject: Makefile: -lpthread may still be necessary when libc has only pthread stubs Without this patch, systems that provide stubs for pthread functions in libc, but which still require libpthread for full the pthread implementation are not detected correctly. Also, some systems require -pthread in CFLAGS for each compilation unit for a successful link of an mt binary, which is also addressed by this patch. Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index da0cfda3e..f6085a524 100644 --- a/Makefile +++ b/Makefile @@ -294,6 +294,7 @@ RPMBUILD = rpmbuild TCL_PATH = tclsh TCLTK_PATH = wish PTHREAD_LIBS = -lpthread +PTHREAD_CFLAGS = export TCL_PATH TCLTK_PATH @@ -898,6 +899,8 @@ ifeq ($(uname_S),AIX) BASIC_CFLAGS += -D_LARGE_FILES ifeq ($(shell expr "$(uname_V)" : '[1234]'),1) NO_PTHREADS = YesPlease + else + PTHREAD_LIBS = -lpthread endif endif ifeq ($(uname_S),GNU) @@ -1349,6 +1352,7 @@ endif ifdef NO_PTHREADS BASIC_CFLAGS += -DNO_PTHREADS else + BASIC_CFLAGS += $(PTHREAD_CFLAGS) EXTLIBS += $(PTHREAD_LIBS) LIB_OBJS += thread-utils.o endif -- cgit v1.2.1 From d1b1a919461c2f00d4e10f5ba227b13f800a6ac3 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:36 +0000 Subject: Do not use "diff" found on PATH while building and installing Some of the flags used with the first diff found in PATH cause the vendor diff to choke. Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f6085a524..668dbc96c 100644 --- a/Makefile +++ b/Makefile @@ -287,6 +287,7 @@ export prefix bindir sharedir sysconfdir CC = gcc AR = ar RM = rm -f +DIFF = diff TAR = tar FIND = find INSTALL = install @@ -1460,7 +1461,7 @@ endif ALL_CFLAGS += $(BASIC_CFLAGS) ALL_LDFLAGS += $(BASIC_LDFLAGS) -export TAR INSTALL DESTDIR SHELL_PATH +export DIFF TAR INSTALL DESTDIR SHELL_PATH ### Build rules @@ -1877,6 +1878,7 @@ GIT-CFLAGS: FORCE GIT-BUILD-OPTIONS: FORCE @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@ @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@ + @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@ @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@ @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@ @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@ -- cgit v1.2.1 From 7b3bdbb335b6be938b4748e86a41357e51c97804 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 31 May 2010 17:35:20 -0700 Subject: fixup: do not unconditionally disable "diff -u" Signed-off-by: Junio C Hamano --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 668dbc96c..c8cc9e280 100644 --- a/Makefile +++ b/Makefile @@ -1374,6 +1374,10 @@ ifdef USE_NED_ALLOCATOR COMPAT_OBJS += compat/nedmalloc/nedmalloc.o endif +ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT + export GIT_TEST_CMP_USE_COPIED_CONTEXT +endif + ifeq ($(TCLTK_PATH),) NO_TCLTK=NoThanks endif -- cgit v1.2.1 From b2b0026eede10894d3317920a277b2a579cd86c5 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:38 +0000 Subject: test_cmp: do not use "diff -u" on platforms that lack one By default the testsuite calls 'diff -u' whenever a file comparison is called for. Unfortunately that throws a "diff: unknown option '-u'" error for most non-GNU diffs. This patch sets GIT_TEST_CMP to 'cmp' on all the architectures where that happens. The previous version of this patch forgot to export GIT_TEST_CMP from t/Makefile, which is why 'make test' continued to fail most tests on most architectures - test-lib.sh was falling back on its default of `diff -u' for GIT_TEST_CMP. This version of this patch shows a vast improvement in testsuite results where either GNU diff is in the path at configure time, or where Makefile knows that GIT_TEST_CMP=cmp is required. Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c8cc9e280..c7e757720 100644 --- a/Makefile +++ b/Makefile @@ -815,18 +815,21 @@ ifeq ($(uname_S),SunOS) NO_STRLCPY = YesPlease NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease + GIT_TEST_CMP = cmp endif ifeq ($(uname_R),5.8) NO_UNSETENV = YesPlease NO_SETENV = YesPlease NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease + GIT_TEST_CMP = cmp endif ifeq ($(uname_R),5.9) NO_UNSETENV = YesPlease NO_SETENV = YesPlease NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease + GIT_TEST_CMP = cmp endif INSTALL = /usr/ucb/install TAR = gtar @@ -903,6 +906,7 @@ ifeq ($(uname_S),AIX) else PTHREAD_LIBS = -lpthread endif + GIT_TEST_CMP = cmp endif ifeq ($(uname_S),GNU) # GNU/Hurd @@ -957,6 +961,7 @@ ifeq ($(uname_S),HP-UX) NO_HSTRERROR = YesPlease NO_SYS_SELECT_H = YesPlease SNPRINTF_RETURNS_BOGUS = YesPlease + GIT_TEST_CMP = cmp endif ifeq ($(uname_S),Windows) GIT_VERSION := $(GIT_VERSION).MSVC -- cgit v1.2.1 From e88a135bc55a974ea04576ccc014c5e2bdc4b892 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:42 +0000 Subject: Some platforms lack socklen_t type Some platforms do not have a socklen_t type declaration. Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c7e757720..f3717f1e4 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,9 @@ all:: # Define SANE_TOOL_PATH to a colon-separated list of paths to prepend # to PATH if your tools in /usr/bin are broken. # +# Define SOCKLEN_T to a suitable type (such as 'size_t') if your +# system headers do not define a socklen_t type. +# # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf() # or vsnprintf() return -1 instead of number of characters which would # have been written to the final string if enough space had been available. @@ -1087,6 +1090,10 @@ else BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d' endif +ifneq (,$(SOCKLEN_T)) + BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T) +endif + ifeq ($(uname_S),Darwin) ifndef NO_FINK ifeq ($(shell test -d /sw/lib && echo y),y) -- cgit v1.2.1 From f9f33cdc78b5893a4764b1437b59536f399a50d1 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:43 +0000 Subject: Allow disabling "inline" Compiler support for inline is sometimes buggy, and occasionally missing entirely. This patch adds a test for inline support, and redefines the keyword with the preprocessor if necessary at compile time. Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f3717f1e4..7f6299650 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ all:: # Define SOCKLEN_T to a suitable type (such as 'size_t') if your # system headers do not define a socklen_t type. # +# Define INLINE to a suitable substitute (such as '__inline' or '') if git +# fails to compile with errors about undefined inline functions or similar. +# # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf() # or vsnprintf() return -1 instead of number of characters which would # have been written to the final string if enough space had been available. @@ -1090,6 +1093,10 @@ else BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d' endif +ifneq (,$(INLINE)) + BASIC_CFLAGS += -Dinline=$(INLINE) +endif + ifneq (,$(SOCKLEN_T)) BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T) endif -- cgit v1.2.1 From 520fbc2a0da2ba830a54b9e1992a3f658c3ae1db Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:44 +0000 Subject: inline declaration does not work on AIX Define away inline declaration on AIX. Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7f6299650..c23ac1329 100644 --- a/Makefile +++ b/Makefile @@ -912,6 +912,9 @@ ifeq ($(uname_S),AIX) else PTHREAD_LIBS = -lpthread endif + ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3) + INLINE='' + endif GIT_TEST_CMP = cmp endif ifeq ($(uname_S),GNU) -- cgit v1.2.1 From 614dd90506476f82ab2595da384f71e78254f33e Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:45 +0000 Subject: Makefile: SunOS 5.6 portability fix Although configure takes care of most of this, set some default values for Solaris 2.6 (aka SunOS-5.6) to ensure git compiles even when configure is not used to build it. Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c23ac1329..f29ff8599 100644 --- a/Makefile +++ b/Makefile @@ -812,6 +812,18 @@ ifeq ($(uname_S),SunOS) NO_MKDTEMP = YesPlease NO_MKSTEMPS = YesPlease NO_REGEX = YesPlease + ifeq ($(uname_R),5.6) + SOCKLEN_T = int + NO_HSTRERROR = YesPlease + NO_IPV6 = YesPlease + NO_SOCKADDR_STORAGE = YesPlease + NO_UNSETENV = YesPlease + NO_SETENV = YesPlease + NO_STRLCPY = YesPlease + NO_C99_FORMAT = YesPlease + NO_STRTOUMAX = YesPlease + GIT_TEST_CMP = cmp + endif ifeq ($(uname_R),5.7) NEEDS_RESOLV = YesPlease NO_IPV6 = YesPlease -- cgit v1.2.1 From 176959d7423988183ffbe1b35fc1de7f786bb596 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:47 +0000 Subject: Makefile: HPUX11 portability fixes There is no nanosecond field on HPUX, the inline keyword is spelled "__inline", and there are no inet_ntop/inet_pton definitions on HP-UX 11.00 Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f29ff8599..638ca2f8a 100644 --- a/Makefile +++ b/Makefile @@ -971,6 +971,7 @@ ifeq ($(uname_S),IRIX64) NEEDS_LIBGEN = YesPlease endif ifeq ($(uname_S),HP-UX) + INLINE = __inline NO_IPV6=YesPlease NO_SETENV=YesPlease NO_STRCASESTR=YesPlease @@ -982,6 +983,11 @@ ifeq ($(uname_S),HP-UX) NO_HSTRERROR = YesPlease NO_SYS_SELECT_H = YesPlease SNPRINTF_RETURNS_BOGUS = YesPlease + NO_NSEC = YesPlease + ifeq ($(uname_R),B.11.00) + NO_INET_NTOP = YesPlease + NO_INET_PTON = YesPlease + endif GIT_TEST_CMP = cmp endif ifeq ($(uname_S),Windows) -- cgit v1.2.1 From e78673ff0bef100535cc2ed146e4a59929c7b4fd Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:48 +0000 Subject: Makefile: HP-UX 10.20 portability fixes HP-UX 10.20 has no pread definition, the inline keyword doesn't work, and has no inet_ntop/inet_pton definitions. Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 638ca2f8a..3368cceba 100644 --- a/Makefile +++ b/Makefile @@ -988,6 +988,14 @@ ifeq ($(uname_S),HP-UX) NO_INET_NTOP = YesPlease NO_INET_PTON = YesPlease endif + ifeq ($(uname_R),B.10.20) + # Override HP-UX 11.x setting: + INLINE = + SOCKLEN_T = size_t + NO_PREAD = YesPlease + NO_INET_NTOP = YesPlease + NO_INET_PTON = YesPlease + endif GIT_TEST_CMP = cmp endif ifeq ($(uname_S),Windows) -- cgit v1.2.1 From 46856f4e9d3d0fbfe1888ee19d632dfc04de8fab Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:49 +0000 Subject: Makefile: Tru64 portability fix Add defaults for Tru64 Unix. Without this patch I cannot compile git on Tru64 5.1. Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3368cceba..bcb84be63 100644 --- a/Makefile +++ b/Makefile @@ -740,6 +740,13 @@ EXTLIBS = # because maintaining the nesting to match is a pain. If # we had "elif" things would have been much nicer... +ifeq ($(uname_S),OSF1) + # Need this for u_short definitions et al + BASIC_CFLAGS += -D_OSF_SOURCE + SOCKLEN_T = int + NO_STRTOULL = YesPlease + NO_NSEC = YesPlease +endif ifeq ($(uname_S),Linux) NO_STRLCPY = YesPlease NO_MKSTEMPS = YesPlease -- cgit v1.2.1 From 09ce4bb6ea7c06c1de82f042cb3ade622b0fa36c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 5 Jun 2010 09:36:13 -0700 Subject: build: propagate $DIFF to scripts git-merge-one-file expects to run "-u" capable "diff", but using $DIFF is not the right way to do so. Signed-off-by: Junio C Hamano --- Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index bcb84be63..0367e8a95 100644 --- a/Makefile +++ b/Makefile @@ -1494,6 +1494,7 @@ SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH)) TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) +DIFF_SQ = $(subst ','\'',$(DIFF)) LIBS = $(GITLIBS) $(EXTLIBS) @@ -1582,6 +1583,7 @@ define cmd_munge_script $(RM) $@ $@+ && \ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ + -e 's|@@DIFF@@|$(DIFF_SQ)|' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ -e $(BROKEN_PATH_FIX) \ -- cgit v1.2.1 From 5e87eae97df69a48a575fd79131e85067f9dbf13 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 11 Jun 2010 09:40:25 -0700 Subject: test-lib: use DIFF definition from GIT-BUILD-OPTIONS Otherwise running individual tests from t/ directory may lack the definition of $DIFF, $GIT_TEST_CMP and friends. Noticed and initial patch provided by Thomas Rast, alternative solution suggested by Brandon Casey, which this patch implements. Signed-off-by: Junio C Hamano Acked-by: Thomas Rast --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0367e8a95..6b3b59bef 100644 --- a/Makefile +++ b/Makefile @@ -1944,6 +1944,12 @@ GIT-BUILD-OPTIONS: FORCE @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@ @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@ @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@ +ifdef GIT_TEST_CMP + @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@ +endif +ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT + @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@ +endif ### Detect Tck/Tk interpreter path changes ifndef NO_TCLTK -- cgit v1.2.1