Commit 7d1d2e9f authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

make: Simplify ARCH retrieval

Actually the former code was being expanding
uname_M variable which is not set that early
(this was not a problem since we assign it a
line below, still it was a dead code which
should be fixed).

Also update

 | ifeq ($(findstring arm,$(ARCH)),arm)

to simple

 | ifeq ($(ARCH),arm)
Reported-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 629e0454
...@@ -24,25 +24,31 @@ SH := bash ...@@ -24,25 +24,31 @@ SH := bash
MAKE := make MAKE := make
OBJCOPY := objcopy OBJCOPY := objcopy
# Additional ARCH settings for x86 #
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ # Fetch ARCH from the uname if not yet set
-e s/arm.*/arm/ -e s/sa110/arm/ \ #
-e s/s390x/s390/ -e s/parisc64/parisc/ \ ARCH ?= $(shell uname -m | sed \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ -e s/i.86/i386/ \
-e s/sh[234].*/sh/ ) -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ \
uname_M := $(shell uname -m | sed -e s/i.86/i386/) -e s/sa110/arm/ \
ifeq ($(uname_M),i386) -e s/s390x/s390/ \
-e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ \
-e s/mips.*/mips/ \
-e s/sh[234].*/sh/)
ifeq ($(ARCH),i386)
ARCH := x86-32 ARCH := x86-32
DEFINES := -DCONFIG_X86_32 DEFINES := -DCONFIG_X86_32
endif endif
ifeq ($(uname_M),x86_64) ifeq ($(ARCH),x86_64)
ARCH := x86 ARCH := x86
DEFINES := -DCONFIG_X86_64 DEFINES := -DCONFIG_X86_64
LDARCH := i386:x86-64 LDARCH := i386:x86-64
endif endif
ifeq ($(findstring arm,$(uname_M)),arm) ifeq ($(ARCH),arm)
ARCH := arm ARCH := arm
ARCH_DEFINES := -DCONFIG_ARM ARCH_DEFINES := -DCONFIG_ARM
LDARCH := arm LDARCH := arm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment