summaryrefslogtreecommitdiffstats
path: root/Makefile.inc
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2021-08-16 23:43:17 (GMT)
committerYann Collet <cyan@fb.com>2021-08-16 23:43:17 (GMT)
commit596c7472116a9204c5a32cc3d9e588fa8a4b6feb (patch)
tree803f4bcc089a4e05979a2bbc2618278c4ad7795d /Makefile.inc
parente78eeec86e696f318a0ad1e71d6ad50555d1c0a9 (diff)
downloadlz4-596c7472116a9204c5a32cc3d9e588fa8a4b6feb.zip
lz4-596c7472116a9204c5a32cc3d9e588fa8a4b6feb.tar.gz
lz4-596c7472116a9204c5a32cc3d9e588fa8a4b6feb.tar.bz2
make UNAME externally definable
on top of providing a central definition place, which eases maintenance, it might also help for #1021. Also : updated doc
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile.inc b/Makefile.inc
index 0840a56..89bb151 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -30,7 +30,9 @@
# - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c
# ################################################################
-TARGET_OS ?= $(shell uname)
+UNAME ?= uname
+
+TARGET_OS ?= $(shell $(UNAME))
ifeq ($(TARGET_OS),)
TARGET_OS ?= $(OS)
endif
@@ -67,7 +69,7 @@ WINDRES = windres
endif
#determine if dev/nul based on host environment
-ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell uname)))
+ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell $(UNAME))))
VOID := /dev/null
else
ifneq (,$(filter Windows%,$(OS)))
@@ -77,7 +79,7 @@ VOID := /dev/null
endif
endif
-ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD MINGW% CYGWIN% MSYS%,$(shell uname)))
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD MINGW% CYGWIN% MSYS%,$(shell $(UNAME))))
POSIX_ENV = Yes
else
POSIX_ENV = No
@@ -87,7 +89,7 @@ endif
ifeq ($(WINBASED),yes)
LN_SF = cp -p
else
- ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell uname)))
+ ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell $(UNAME))))
LN_SF = cp -p
else
ifneq (,$(filter Windows%,$(OS)))
@@ -98,7 +100,7 @@ LN_SF = ln -sf
endif
endif
-ifneq (,$(filter $(shell uname),SunOS))
+ifneq (,$(filter $(shell $(UNAME)),SunOS))
INSTALL ?= ginstall
else
INSTALL ?= install