[PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall

Subsystems: kernel build + files below scripts/ (unless maintained elsewhere), the rest

DORMANTno replies

9 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall

From: Brandon Casey <hidden>
Date: 2016-06-15 22:46:52

From: Brandon Casey <redacted>

We can avoid a GNU dependency by using /usr/ucb/install.

Signed-off-by: Brandon Casey <redacted>
---


This works for me on Solaris 7 and 10.  Any reason not to use it instead
of ginstall?

-brandon


 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index eaae45d..ba78077 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
-- 
1.6.3.1.24.g152f4

[PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments

From: Brandon Casey <hidden>
Date: 2016-06-15 22:46:52

From: Brandon Casey <redacted>

This library is required on Solaris since hstrerror resides in libresolv.
Additionally, on Solaris 7, inet_ntop and inet_pton reside there too.

Signed-off-by: Brandon Casey <redacted>
---
 Makefile |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index ba78077..32b28ea 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.
@@ -697,10 +701,10 @@ endif
 ifeq ($(uname_S),SunOS)
 	NEEDS_SOCKET = YesPlease
 	NEEDS_NSL = YesPlease
+	NEEDS_RESOLV = YesPlease
 	SHELL_PATH = /bin/bash
 	NO_STRCASESTR = YesPlease
 	NO_MEMMEM = YesPlease
-	NO_HSTRERROR = YesPlease
 	NO_MKDTEMP = YesPlease
 	OLD_ICONV = UnfortunatelyYes
 	ifeq ($(uname_R),5.8)
@@ -956,6 +960,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
-- 
1.6.3.1.24.g152f4

[PATCH 3/4] Makefile: add section for SunOS 5.7

From: Brandon Casey <hidden>
Date: 2016-06-15 22:46:52

From: Brandon Casey <redacted>


Signed-off-by: Brandon Casey <redacted>
---
 Makefile |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 32b28ea..8b377f3 100644
--- a/Makefile
+++ b/Makefile
@@ -707,6 +707,15 @@ ifeq ($(uname_S),SunOS)
 	NO_MEMMEM = YesPlease
 	NO_MKDTEMP = YesPlease
 	OLD_ICONV = UnfortunatelyYes
+	ifeq ($(uname_R),5.7)
+		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
-- 
1.6.3.1.24.g152f4

[PATCH 4/4] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH

From: Brandon Casey <hidden>
Date: 2016-06-15 22:46:52

From: Junio C Hamano <redacted>

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 <redacted>
---


I liked this patch.  Seems like the right thing to do on Solaris.

-brandon


 Makefile        |   14 ++++++++++++++
 git-sh-setup.sh |    2 ++
 2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 8b377f3..3f4708f 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.
@@ -703,6 +708,7 @@ ifeq ($(uname_S),SunOS)
 	NEEDS_NSL = YesPlease
 	NEEDS_RESOLV = YesPlease
 	SHELL_PATH = /bin/bash
+	SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
 	NO_STRCASESTR = YesPlease
 	NO_MEMMEM = YesPlease
 	NO_MKDTEMP = YesPlease
@@ -871,6 +877,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)
@@ -1272,6 +1285,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 $@+ $@
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 8382339..7802581 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -11,6 +11,8 @@
 # exporting it.
 unset CDPATH
 
+# @@PATH@@:$PATH
+
 die() {
 	echo >&2 "$@"
 	exit 1
-- 
1.6.3.1.24.g152f4

Re: [PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall

From: Jeff King <hidden>
Date: 2016-06-15 22:46:52

On Wed, May 27, 2009 at 09:17:05PM -0500, Brandon Casey wrote:
We can avoid a GNU dependency by using /usr/ucb/install.
[...]
This works for me on Solaris 7 and 10.  Any reason not to use it instead
of ginstall?
Certainly it works on Solaris 8; I've been setting it manually to
/usr/ucb/install (though I admit my auto-test script doesn't actually do
the install, I do occasionally run the install manually). I think it is
a sane default.

-Peff

Re: [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments

From: Jeff King <hidden>
Date: 2016-06-15 22:46:52

On Wed, May 27, 2009 at 09:17:06PM -0500, Brandon Casey wrote:
This library is required on Solaris since hstrerror resides in libresolv.
Additionally, on Solaris 7, inet_ntop and inet_pton reside there too.
Patch works for me on Solaris 8, though it is largely a non-issue:
hstrerror is only used at all if NO_IPV6 is set, and I don't set that
for my build.

-Peff

Re: [PATCH 4/4] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH

From: Jeff King <hidden>
Date: 2016-06-15 22:46:52

On Wed, May 27, 2009 at 09:17:08PM -0500, Brandon Casey wrote:
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.
My concern with this is that the PATH bleeds over into things we execute
on behalf of the user, like GIT_EDITOR or snippets in git-filter-branch.
So we can end up surprising users that way.

On the other hand, I don't know how big a problem that is in practice. I
feel like any sane Solaris user is going to have xpg4 in their PATH
these days.

-Peff

Re: [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments

From: Brandon Casey <hidden>
Date: 2016-06-15 22:46:52

Jeff King wrote:
On Wed, May 27, 2009 at 09:17:06PM -0500, Brandon Casey wrote:
quoted
This library is required on Solaris since hstrerror resides in libresolv.
Additionally, on Solaris 7, inet_ntop and inet_pton reside there too.
Patch works for me on Solaris 8, though it is largely a non-issue:
hstrerror is only used at all if NO_IPV6 is set, and I don't set that
for my build.
Ah, in that case I guess NEED_RESOLV should only go in the 5.7 specific
configuration section.

-brandon

Re: [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments

From: Jeff King <hidden>
Date: 2016-06-15 22:46:52

On Thu, May 28, 2009 at 02:32:20PM -0500, Brandon Casey wrote:
quoted
quoted
This library is required on Solaris since hstrerror resides in libresolv.
Additionally, on Solaris 7, inet_ntop and inet_pton reside there too.
Patch works for me on Solaris 8, though it is largely a non-issue:
hstrerror is only used at all if NO_IPV6 is set, and I don't set that
for my build.
Ah, in that case I guess NEED_RESOLV should only go in the 5.7 specific
configuration section.
Well, not exactly. Getting rid of NO_HSTRERROR and then compiling with
NO_IPV6 still requires NEED_RESOLV. It's just that NO_HSTRERROR isn't
even useful unless NO_IPV6 is defined.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help