summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d2b8593)
raw | patch | inline | side by side (parent: d2b8593)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 9 Oct 2005 19:52:35 +0000 (12:52 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 9 Oct 2005 19:55:49 +0000 (12:55 -0700) |
The platform specific tweaking part was using 'uname -o' which
is not always available. Squelch error message from it.
It was suggested to chain the if..else, but I chose not to, because
maintaining the nested if..else if..else..endif endif to match is a
pain. If we had "elif", things would have been different, though.
While we are at it, try not to invoke 'uname -s' for each platform
candidate.
Signed-off-by: Junio C Hamano <junkio@cox.net>
is not always available. Squelch error message from it.
It was suggested to chain the if..else, but I chose not to, because
maintaining the nested if..else if..else..endif endif to match is a
pain. If we had "elif", things would have been different, though.
While we are at it, try not to invoke 'uname -s' for each platform
candidate.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile | patch | blob | history |
diff --git a/Makefile b/Makefile
index bcda94327347de5c9e0efc2f0491fa0db9ffb635..a201187395d0102ab8b807d9ae78cb794c1df99a 100644 (file)
--- a/Makefile
+++ b/Makefile
#
# Platform specific tweaks
#
-ifeq ($(shell uname -s),Darwin)
+
+# We choose to avoid "if .. else if .. else .. endif endif"
+# because maintaining the nesting to match is a pain. If
+# we had "elif" things would have been much nicer...
+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
+uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
+
+ifeq ($(uname_S),Darwin)
NEEDS_SSL_WITH_CRYPTO = YesPlease
NEEDS_LIBICONV = YesPlease
endif
-ifeq ($(shell uname -s),SunOS)
+ifeq ($(uname_S),SunOS)
NEEDS_SOCKET = YesPlease
NEEDS_NSL = YesPlease
SHELL_PATH = /bin/bash
TAR = gtar
PLATFORM_DEFINES += -D__EXTENSIONS__
endif
-ifeq ($(shell uname -o),Cygwin)
+ifeq ($(uname_O),Cygwin)
NO_STRCASESTR = YesPlease
NEEDS_LIBICONV = YesPlease
NO_IPV6 = YesPlease
X = .exe
PLATFORM_DEFINES += -DUSE_SYMLINK_HEAD=0
endif
-ifneq (,$(findstring arm,$(shell uname -m)))
- ARM_SHA1 = YesPlease
-endif
-ifeq ($(shell uname -s),OpenBSD)
+ifeq ($(uname_S),OpenBSD)
NEEDS_LIBICONV = YesPlease
PLATFORM_DEFINES += -I/usr/local/include -L/usr/local/lib
endif
+ifneq (,$(findstring arm,$(uname_M)))
+ ARM_SHA1 = YesPlease
+endif
ifndef NO_CURL
ifdef CURLDIR