git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall
@ 2009-05-28  2:17 Brandon Casey
  2009-05-28  2:17 ` [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments Brandon Casey
  2009-05-28 18:57 ` [PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall Jeff King
  0 siblings, 2 replies; 10+ messages in thread
From: Brandon Casey @ 2009-05-28  2:17 UTC (permalink / raw)
  To: git; +Cc: Brandon Casey

From: Brandon Casey <drafnel@gmail.com>

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

Signed-off-by: Brandon Casey <drafnel@gmail.com>
---


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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments
  2009-05-28  2:17 [PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall Brandon Casey
@ 2009-05-28  2:17 ` Brandon Casey
  2009-05-28  2:17   ` [PATCH 3/4] Makefile: add section for SunOS 5.7 Brandon Casey
  2009-05-28 19:10   ` [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments Jeff King
  2009-05-28 18:57 ` [PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall Jeff King
  1 sibling, 2 replies; 10+ messages in thread
From: Brandon Casey @ 2009-05-28  2:17 UTC (permalink / raw)
  To: git; +Cc: Brandon Casey

From: Brandon Casey <drafnel@gmail.com>

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 <drafnel@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/4] Makefile: add section for SunOS 5.7
  2009-05-28  2:17 ` [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments Brandon Casey
@ 2009-05-28  2:17   ` Brandon Casey
  2009-05-28  2:17     ` [PATCH 4/4] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH Brandon Casey
  2009-05-28 19:10   ` [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments Jeff King
  1 sibling, 1 reply; 10+ messages in thread
From: Brandon Casey @ 2009-05-28  2:17 UTC (permalink / raw)
  To: git; +Cc: Brandon Casey

From: Brandon Casey <drafnel@gmail.com>


Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/4] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH
  2009-05-28  2:17   ` [PATCH 3/4] Makefile: add section for SunOS 5.7 Brandon Casey
@ 2009-05-28  2:17     ` Brandon Casey
  2009-05-28 19:13       ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Brandon Casey @ 2009-05-28  2:17 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Brandon Casey

From: Junio C Hamano <gitster@pobox.com>

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 <drafnel@gmail.com>
---


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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall
  2009-05-28  2:17 [PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall Brandon Casey
  2009-05-28  2:17 ` [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments Brandon Casey
@ 2009-05-28 18:57 ` Jeff King
  1 sibling, 0 replies; 10+ messages in thread
From: Jeff King @ 2009-05-28 18:57 UTC (permalink / raw)
  To: Brandon Casey; +Cc: git, Brandon Casey

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments
  2009-05-28  2:17 ` [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments Brandon Casey
  2009-05-28  2:17   ` [PATCH 3/4] Makefile: add section for SunOS 5.7 Brandon Casey
@ 2009-05-28 19:10   ` Jeff King
  2009-05-28 19:32     ` Brandon Casey
  1 sibling, 1 reply; 10+ messages in thread
From: Jeff King @ 2009-05-28 19:10 UTC (permalink / raw)
  To: Brandon Casey; +Cc: git, Brandon Casey

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH
  2009-05-28  2:17     ` [PATCH 4/4] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH Brandon Casey
@ 2009-05-28 19:13       ` Jeff King
  2009-05-29  5:13         ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff King @ 2009-05-28 19:13 UTC (permalink / raw)
  To: Brandon Casey; +Cc: git, Junio C Hamano, Brandon Casey

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments
  2009-05-28 19:10   ` [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments Jeff King
@ 2009-05-28 19:32     ` Brandon Casey
  2009-05-28 19:35       ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Brandon Casey @ 2009-05-28 19:32 UTC (permalink / raw)
  To: Jeff King; +Cc: git, Brandon Casey

Jeff King wrote:
> 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.

Ah, in that case I guess NEED_RESOLV should only go in the 5.7 specific
configuration section.

-brandon

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments
  2009-05-28 19:32     ` Brandon Casey
@ 2009-05-28 19:35       ` Jeff King
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff King @ 2009-05-28 19:35 UTC (permalink / raw)
  To: Brandon Casey; +Cc: git, Brandon Casey

On Thu, May 28, 2009 at 02:32:20PM -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.
> 
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH
  2009-05-28 19:13       ` Jeff King
@ 2009-05-29  5:13         ` Junio C Hamano
  0 siblings, 0 replies; 10+ messages in thread
From: Junio C Hamano @ 2009-05-29  5:13 UTC (permalink / raw)
  To: Jeff King; +Cc: Brandon Casey, git, Junio C Hamano, Brandon Casey

Jeff King <peff@peff.net> writes:

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

I share that feeling, in which case the patch should be no-op.

But I recall the "how about this" patch was done as an illustration of a
possible approach to solve breakage in _tests_; the patch actually does
not touch t/Makefile and would not help tests.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-05-29  5:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-28  2:17 [PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall Brandon Casey
2009-05-28  2:17 ` [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments Brandon Casey
2009-05-28  2:17   ` [PATCH 3/4] Makefile: add section for SunOS 5.7 Brandon Casey
2009-05-28  2:17     ` [PATCH 4/4] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH Brandon Casey
2009-05-28 19:13       ` Jeff King
2009-05-29  5:13         ` Junio C Hamano
2009-05-28 19:10   ` [PATCH 2/4] Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments Jeff King
2009-05-28 19:32     ` Brandon Casey
2009-05-28 19:35       ` Jeff King
2009-05-28 18:57 ` [PATCH 1/4] Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).