Avoid a compiler warning in Makefile tests

pull/574/merge
Jeffrey Walton 2018-01-28 20:23:48 -05:00
parent d4342558d0
commit 96bc82fe12
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 15 additions and 7 deletions

View File

@ -31,7 +31,8 @@ else
endif
# Attempt to determine host machine, fallback to "this" machine.
# The host machine is the one the package runs on.
# The host machine is the one the package runs on. Most people
# call this the "target", but not Autotools.
HOSTX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | cut -f 1 -d '-')
ifeq ($(HOSTX),)
HOSTX := $(shell uname -m 2>/dev/null)
@ -46,7 +47,7 @@ IS_ARMV8 := $(shell echo "$(HOSTX)" | $(GREP) -i -c -E 'aarch32|aarch64')
IS_SPARC32 := $(shell echo "$(HOSTX)" | $(GREP) -v "64" | $(GREP) -i -c 'sparc')
IS_SPARC64 := $(shell echo "$(HOSTX)" | $(GREP) -i -c 'sparc64')
IS_NEON := $(shell $(CXX) $(CXXFLAGS) -dumpmachine | $(GREP) -i -c -E 'armv7|armhf|arm7l|eabihf|armv8|aarch32|aarch64')
IS_NEON := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | $(GREP) -i -c -E 'armv7|armhf|arm7l|eabihf|armv8|aarch32|aarch64')
SYSTEMX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null)
IS_LINUX := $(shell echo "$(SYSTEMX)" | $(GREP) -i -c "Linux")

View File

@ -15,11 +15,18 @@ EGREP ?= egrep
LN ?= ln -sf
LDCONF ?= /sbin/ldconfig -n
MACHINE ?= $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null)
IS_i686 := $(shell echo "$MACHINE" | $(EGREP) -v 64 | $(EGREP) -i -c 'i.86')
IS_x86_64 := $(shell echo "$MACHINE" | $(EGREP) -i -c 'x86_64|amd64')
IS_ARM := $(shell echo "$MACHINE" | $(EGREP) -i -c 'arm')
IS_ARMv8 := $(shell echo "$MACHINE" | $(EGREP) -i -c 'aarch32|aarch64')
# Attempt to determine host machine, fallback to "this" machine.
# The host machine is the one the package runs on. Most people
# call this the "target", but not Autotools.
HOSTX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | cut -f 1 -d '-')
ifeq ($(HOSTX),)
HOSTX := $(shell uname -m 2>/dev/null)
endif
IS_i686 := $(shell echo "$HOSTX" | $(EGREP) -v 64 | $(EGREP) -i -c 'i.86')
IS_x86_64 := $(shell echo "$HOSTX" | $(EGREP) -i -c 'x86_64|amd64')
IS_ARM := $(shell echo "$HOSTX" | $(EGREP) -i -c 'arm')
IS_ARMv8 := $(shell echo "$HOSTX" | $(EGREP) -i -c 'aarch32|aarch64')
CLANG_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang")