mirror of
https://github.com/git/git.git
synced 2024-10-28 12:59:41 +01:00
Makefile: avoid error message from 'uname -o'
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>
This commit is contained in:
parent
d2b8593fd3
commit
f7c153431b
1 changed files with 15 additions and 7 deletions
22
Makefile
22
Makefile
|
@ -166,11 +166,19 @@ LIBS += -lz
|
||||||
#
|
#
|
||||||
# Platform specific tweaks
|
# 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_SSL_WITH_CRYPTO = YesPlease
|
||||||
NEEDS_LIBICONV = YesPlease
|
NEEDS_LIBICONV = YesPlease
|
||||||
endif
|
endif
|
||||||
ifeq ($(shell uname -s),SunOS)
|
ifeq ($(uname_S),SunOS)
|
||||||
NEEDS_SOCKET = YesPlease
|
NEEDS_SOCKET = YesPlease
|
||||||
NEEDS_NSL = YesPlease
|
NEEDS_NSL = YesPlease
|
||||||
SHELL_PATH = /bin/bash
|
SHELL_PATH = /bin/bash
|
||||||
|
@ -180,20 +188,20 @@ ifeq ($(shell uname -s),SunOS)
|
||||||
TAR = gtar
|
TAR = gtar
|
||||||
PLATFORM_DEFINES += -D__EXTENSIONS__
|
PLATFORM_DEFINES += -D__EXTENSIONS__
|
||||||
endif
|
endif
|
||||||
ifeq ($(shell uname -o),Cygwin)
|
ifeq ($(uname_O),Cygwin)
|
||||||
NO_STRCASESTR = YesPlease
|
NO_STRCASESTR = YesPlease
|
||||||
NEEDS_LIBICONV = YesPlease
|
NEEDS_LIBICONV = YesPlease
|
||||||
NO_IPV6 = YesPlease
|
NO_IPV6 = YesPlease
|
||||||
X = .exe
|
X = .exe
|
||||||
PLATFORM_DEFINES += -DUSE_SYMLINK_HEAD=0
|
PLATFORM_DEFINES += -DUSE_SYMLINK_HEAD=0
|
||||||
endif
|
endif
|
||||||
ifneq (,$(findstring arm,$(shell uname -m)))
|
ifeq ($(uname_S),OpenBSD)
|
||||||
ARM_SHA1 = YesPlease
|
|
||||||
endif
|
|
||||||
ifeq ($(shell uname -s),OpenBSD)
|
|
||||||
NEEDS_LIBICONV = YesPlease
|
NEEDS_LIBICONV = YesPlease
|
||||||
PLATFORM_DEFINES += -I/usr/local/include -L/usr/local/lib
|
PLATFORM_DEFINES += -I/usr/local/include -L/usr/local/lib
|
||||||
endif
|
endif
|
||||||
|
ifneq (,$(findstring arm,$(uname_M)))
|
||||||
|
ARM_SHA1 = YesPlease
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef NO_CURL
|
ifndef NO_CURL
|
||||||
ifdef CURLDIR
|
ifdef CURLDIR
|
||||||
|
|
Loading…
Reference in a new issue