From c1537e8171cdeac30f063c63eabeacc38b11d611 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Wed, 20 Apr 2016 13:12:14 -0400 Subject: [PATCH] build: fix DESTCPU detection for binary target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `make binary` attempts to auto detect DESTCPU if not set, but was assuming being on an Intel architecture. PR-URL: https://github.com/nodejs/node/pull/6310 Reviewed-By: Johan Bergström Reviewed-By: Myles Borins Reviewed-By: Michael Dawson --- Makefile | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2732886cdf97d6..4d180501c6d2c3 100644 --- a/Makefile +++ b/Makefile @@ -264,11 +264,40 @@ RELEASE=$(shell sed -ne 's/\#define NODE_VERSION_IS_RELEASE \([01]\)/\1/p' src/n PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]') NPMVERSION=v$(shell cat deps/npm/package.json | grep '"version"' | sed 's/^[^:]*: "\([^"]*\)",.*/\1/') -ifeq ($(findstring x86_64,$(shell uname -m)),x86_64) +UNAME_M=$(shell uname -m) +ifeq ($(findstring x86_64,$(UNAME_M)),x86_64) DESTCPU ?= x64 else +ifeq ($(findstring ppc64,$(UNAME_M)),ppc64) +DESTCPU ?= ppc64 +else +ifeq ($(findstring ppc,$(UNAME_M)),ppc) +DESTCPU ?= ppc +else +ifeq ($(findstring s390x,$(UNAME_M)),s390x) +DESTCPU ?= s390x +else +ifeq ($(findstring s390,$(UNAME_M)),s390) +DESTCPU ?= s390 +else +ifeq ($(findstring arm,$(UNAME_M)),arm) +DESTCPU ?= arm +else +ifeq ($(findstring aarch64,$(UNAME_M)),aarch64) +DESTCPU ?= aarch64 +else +ifeq ($(findstring powerpc,$(shell uname -p)),powerpc) +DESTCPU ?= ppc64 +else DESTCPU ?= x86 endif +endif +endif +endif +endif +endif +endif +endif ifeq ($(DESTCPU),x64) ARCH=x64 else