Skip to contentSkip to conversation

no "uname -o" on Mac OSX

DISCUSSION Randal L. Schwartz 2 participants 4 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

Recently, a change was made to git/Makefile to invoke "uname -o". This isn't portable to OSX/Darwin. Is there a chance this information can be obtained some other way, or not invoked on darwni?

Signature · 4 lines
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
#1 lore raw
Quoted 3 lines · [email protected] (Randal L. Schwartz) writes:

Recently, a change was made to git/Makefile to invoke "uname -o". This isn't portable to OSX/Darwin. Is there a chance this information can be obtained some other way, or not invoked on darwni?

Peter, I noticed the same on Solaris recently.

The following seems to work but is quite yucky, and I prefer somebody to come up with a better alternative.

    ------------

Makefile: 'uname -o' is not portable.

---

Makefile +1 -1
index 7ba3eeb..ba048cb 100644
@@ -180,7 +180,7 @@ ifeq ($(shell uname -s),SunOS)
 	TAR = gtar
 	PLATFORM_DEFINES += -D__EXTENSIONS__
 endif
-ifeq ($(shell uname -o),Cygwin)
+ifeq ($(shell sh -c 'uname -o 2>/dev/null || echo not'),Cygwin)
 	NO_STRCASESTR = YesPlease
 	NEEDS_LIBICONV = YesPlease
 	NO_IPV6 = YesPlease
#2 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Junio" == Junio C Hamano <[email protected]> writes:

Junio> Peter, I noticed the same on Solaris recently.

Junio> The following seems to work but is quite yucky, and I prefer Junio> somebody to come up with a better alternative.

How about a chain of elsif's?

Doesn't make support that?

I mean, when you know it's Darwin, no point in checking if it's OpenBSD. :)

Signature · 4 lines
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!