Skip to content

Commit 43ce6fc

Browse files
richardlauMyles Borins
authored and
Myles Borins
committed
build: fix DESTCPU detection for binary target
`make binary` attempts to auto detect DESTCPU if not set, but was assuming being on an Intel architecture. PR-URL: #6310 Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 0f6146c commit 43ce6fc

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

Makefile

+30-1
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,40 @@ RELEASE=$(shell sed -ne 's/\#define NODE_VERSION_IS_RELEASE \([01]\)/\1/p' src/n
264264
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
265265
NPMVERSION=v$(shell cat deps/npm/package.json | grep '"version"' | sed 's/^[^:]*: "\([^"]*\)",.*/\1/')
266266

267-
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
267+
UNAME_M=$(shell uname -m)
268+
ifeq ($(findstring x86_64,$(UNAME_M)),x86_64)
268269
DESTCPU ?= x64
269270
else
271+
ifeq ($(findstring ppc64,$(UNAME_M)),ppc64)
272+
DESTCPU ?= ppc64
273+
else
274+
ifeq ($(findstring ppc,$(UNAME_M)),ppc)
275+
DESTCPU ?= ppc
276+
else
277+
ifeq ($(findstring s390x,$(UNAME_M)),s390x)
278+
DESTCPU ?= s390x
279+
else
280+
ifeq ($(findstring s390,$(UNAME_M)),s390)
281+
DESTCPU ?= s390
282+
else
283+
ifeq ($(findstring arm,$(UNAME_M)),arm)
284+
DESTCPU ?= arm
285+
else
286+
ifeq ($(findstring aarch64,$(UNAME_M)),aarch64)
287+
DESTCPU ?= aarch64
288+
else
289+
ifeq ($(findstring powerpc,$(shell uname -p)),powerpc)
290+
DESTCPU ?= ppc64
291+
else
270292
DESTCPU ?= x86
271293
endif
294+
endif
295+
endif
296+
endif
297+
endif
298+
endif
299+
endif
300+
endif
272301
ifeq ($(DESTCPU),x64)
273302
ARCH=x64
274303
else

0 commit comments

Comments
 (0)