From efc07debaf60f5aa81bef78dc3219962ba88c3b8 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Wed, 27 May 2009 21:17:05 -0500 Subject: Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall We can avoid a GNU dependency by using /usr/ucb/install. Signed-off-by: Brandon Casey 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 eaae45db7c..ba780775c7 100644 --- a/Makefile +++ b/Makefile @@ -715,7 +715,7 @@ ifeq ($(uname_S),SunOS) NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease endif - INSTALL = ginstall + INSTALL = /usr/ucb/install TAR = gtar BASIC_CFLAGS += -D__EXTENSIONS__ endif -- cgit v1.2.3 From 70cf991093d4ab8854de0090aca9cf8d10ebd8f8 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Fri, 5 Jun 2009 18:36:10 -0500 Subject: Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments This library is required on Solaris when compiling with NO_IPV6 since hstrerror resides in libresolv. Additionally, Solaris 7 will need it, since inet_ntop and inet_pton reside there too. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ba780775c7..d36e92c10d 100644 --- a/Makefile +++ b/Makefile @@ -91,6 +91,10 @@ all:: # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, # Patrick Mauritz). # +# Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough. +# Notably on Solaris hstrerror resides in libresolv and on Solaris 7 +# inet_ntop and inet_pton additionally reside there. +# # Define NO_MMAP if you want to avoid mmap. # # Define NO_PTHREADS if you do not have or do not want to use Pthreads. @@ -700,7 +704,6 @@ ifeq ($(uname_S),SunOS) SHELL_PATH = /bin/bash NO_STRCASESTR = YesPlease NO_MEMMEM = YesPlease - NO_HSTRERROR = YesPlease NO_MKDTEMP = YesPlease OLD_ICONV = UnfortunatelyYes ifeq ($(uname_R),5.8) @@ -715,6 +718,9 @@ ifeq ($(uname_S),SunOS) NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease endif + ifdef NO_IPV6 + NEEDS_RESOLV = YesPlease + endif INSTALL = /usr/ucb/install TAR = gtar BASIC_CFLAGS += -D__EXTENSIONS__ @@ -956,6 +962,9 @@ endif ifdef NEEDS_NSL EXTLIBS += -lnsl endif +ifdef NEEDS_RESOLV + EXTLIBS += -lresolv +endif ifdef NO_D_TYPE_IN_DIRENT BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT endif -- cgit v1.2.3 From 309dbc82e39ea0b402ea06579fd9246df5cf6a01 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Fri, 5 Jun 2009 18:36:12 -0500 Subject: On Solaris choose the OLD_ICONV iconv() declaration based on the UNIX spec OLD_ICONV is only necessary on Solaris until UNIX03. This is indicated by the private macro _XPG6 which is set in /usr/include/sys/feature_tests.h. Signed-off-by: Brandon Casey 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 d36e92c10d..d8f9c225f9 100644 --- a/Makefile +++ b/Makefile @@ -705,7 +705,7 @@ ifeq ($(uname_S),SunOS) NO_STRCASESTR = YesPlease NO_MEMMEM = YesPlease NO_MKDTEMP = YesPlease - OLD_ICONV = UnfortunatelyYes + NO_MKSTEMPS = YesPlease ifeq ($(uname_R),5.8) NO_UNSETENV = YesPlease NO_SETENV = YesPlease -- cgit v1.2.3 From b213019c00740289997f12e5f53b1baae588ac8a Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Fri, 5 Jun 2009 18:36:14 -0500 Subject: Makefile: define __sun__ on SunOS The SUNWspro compiler does not define __sun__ (like GCC does). A check of this macro was recently added to detect compilation on SunOS and to modify the handling of the NO_ICONV and _XOPEN_SOURCE feature macros. Signed-off-by: Brandon Casey 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 d8f9c225f9..4f838b2c0b 100644 --- a/Makefile +++ b/Makefile @@ -723,7 +723,7 @@ ifeq ($(uname_S),SunOS) endif INSTALL = /usr/ucb/install TAR = gtar - BASIC_CFLAGS += -D__EXTENSIONS__ + BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ endif ifeq ($(uname_O),Cygwin) NO_D_TYPE_IN_DIRENT = YesPlease -- cgit v1.2.3 From 0e0aea5a47b675ab2dca9c77180b8fe9bc6bdeec Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 5 Jun 2009 18:36:15 -0500 Subject: Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH Some platforms (like SunOS and family) have kept their common binaries at some historical moment in time, and introduced new binaries with modern features in a special location like /usr/xpg4/bin or /usr/ucb. Some of the features provided by these modern binaries are expected and required by git. If the featureful binaries are not in the users path, then git could end up using the less featureful binary and fail. So provide a mechanism to prepend elements to the users PATH at runtime so the modern binaries will be found. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4f838b2c0b..50002edda3 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,11 @@ all:: # Define V=1 to have a more verbose compile. # +# Define SHELL_PATH to a POSIX shell if your /bin/sh is broken. +# +# Define SANE_TOOL_PATH to a colon-separated list of paths to prepend +# to PATH if your tools in /usr/bin are broken. +# # 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. @@ -702,6 +707,7 @@ ifeq ($(uname_S),SunOS) NEEDS_SOCKET = YesPlease NEEDS_NSL = YesPlease SHELL_PATH = /bin/bash + SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin NO_STRCASESTR = YesPlease NO_MEMMEM = YesPlease NO_MKDTEMP = YesPlease @@ -864,6 +870,13 @@ endif -include config.mak.autogen -include config.mak +ifdef SANE_TOOL_PATH +BROKEN_PATH_FIX = s|^. @@PATH@@|PATH=$(SANE_TOOL_PATH)| +PATH := $(SANE_TOOL_PATH):${PATH} +else +BROKEN_PATH_FIX = d +endif + ifeq ($(uname_S),Darwin) ifndef NO_FINK ifeq ($(shell test -d /sw/lib && echo y),y) @@ -1265,6 +1278,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ + -e '/^# @@PATH@@/$(BROKEN_PATH_FIX)' \ $@.sh >$@+ && \ chmod +x $@+ && \ mv $@+ $@ -- cgit v1.2.3 From a7a24ee7e0721db5427e9a5f6906e8531510d607 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Fri, 5 Jun 2009 18:36:16 -0500 Subject: Makefile: add section for SunOS 5.7 Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 50002edda3..3890a0e43a 100644 --- a/Makefile +++ b/Makefile @@ -712,6 +712,16 @@ ifeq ($(uname_S),SunOS) NO_MEMMEM = YesPlease NO_MKDTEMP = YesPlease NO_MKSTEMPS = YesPlease + ifeq ($(uname_R),5.7) + NEEDS_RESOLV = YesPlease + NO_IPV6 = YesPlease + NO_SOCKADDR_STORAGE = YesPlease + NO_UNSETENV = YesPlease + NO_SETENV = YesPlease + NO_STRLCPY = YesPlease + NO_C99_FORMAT = YesPlease + NO_STRTOUMAX = YesPlease + endif ifeq ($(uname_R),5.8) NO_UNSETENV = YesPlease NO_SETENV = YesPlease -- cgit v1.2.3 From 61dbb3c4415169194d9351cc4b68dd88788a93c5 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 8 Jun 2009 09:41:49 -0700 Subject: Makefile: insert SANE_TOOL_PATH to PATH before /bin or /usr/bin In an earlier patch, we introduced SANE_TOOL_PATH that is prepended to user's PATH. This had an unintended consequence of overriding user's private binary directory that typically comes earlier in the PATH to holds even saner commands than whatever comes with the system. For example, a user may have ~/bin that is early in the path and contains a shell script "vi" that launches system's /bin/vi with specific options. Prepending SANE_TOOL_PATH to the PATH that happens to have "vi" in it defeats such customization. This fixes the issue by inserting SANE_TOOL_PATH just before /bin or /usr/bin appears on the PATH. Signed-off-by: Junio C Hamano --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3890a0e43a..1197b2fd4d 100644 --- a/Makefile +++ b/Makefile @@ -881,10 +881,11 @@ endif -include config.mak ifdef SANE_TOOL_PATH -BROKEN_PATH_FIX = s|^. @@PATH@@|PATH=$(SANE_TOOL_PATH)| +SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH)) +BROKEN_PATH_FIX = 's|^\# @@BROKEN_PATH_FIX@@$$|git_broken_path_fix $(SANE_TOOL_PATH_SQ)|' PATH := $(SANE_TOOL_PATH):${PATH} else -BROKEN_PATH_FIX = d +BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d' endif ifeq ($(uname_S),Darwin) @@ -1288,7 +1289,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ - -e '/^# @@PATH@@/$(BROKEN_PATH_FIX)' \ + -e $(BROKEN_PATH_FIX) \ $@.sh >$@+ && \ chmod +x $@+ && \ mv $@+ $@ -- cgit v1.2.3