Skip to content

Commit 830a726

Browse files
richardlaumhdawson
authored andcommitted
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 ccbb00e commit 830a726

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

Makefile

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

334-
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
334+
UNAME_M=$(shell uname -m)
335+
ifeq ($(findstring x86_64,$(UNAME_M)),x86_64)
335336
DESTCPU ?= x64
336337
else
338+
ifeq ($(findstring ppc64,$(UNAME_M)),ppc64)
339+
DESTCPU ?= ppc64
340+
else
341+
ifeq ($(findstring ppc,$(UNAME_M)),ppc)
342+
DESTCPU ?= ppc
343+
else
344+
ifeq ($(findstring s390x,$(UNAME_M)),s390x)
345+
DESTCPU ?= s390x
346+
else
347+
ifeq ($(findstring s390,$(UNAME_M)),s390)
348+
DESTCPU ?= s390
349+
else
350+
ifeq ($(findstring arm,$(UNAME_M)),arm)
351+
DESTCPU ?= arm
352+
else
353+
ifeq ($(findstring aarch64,$(UNAME_M)),aarch64)
354+
DESTCPU ?= aarch64
355+
else
356+
ifeq ($(findstring powerpc,$(shell uname -p)),powerpc)
357+
DESTCPU ?= ppc64
358+
else
337359
DESTCPU ?= x86
338360
endif
361+
endif
362+
endif
363+
endif
364+
endif
365+
endif
366+
endif
367+
endif
339368
ifeq ($(DESTCPU),x64)
340369
ARCH=x64
341370
else

0 commit comments

Comments
 (0)