Skip to content

Commit 5149d66

Browse files
richardlauevanlucas
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 9cd14ce commit 5149d66

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
@@ -327,11 +327,40 @@ RELEASE=$(shell sed -ne 's/\#define NODE_VERSION_IS_RELEASE \([01]\)/\1/p' src/n
327327
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
328328
NPMVERSION=v$(shell cat deps/npm/package.json | grep '"version"' | sed 's/^[^:]*: "\([^"]*\)",.*/\1/')
329329

330-
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
330+
UNAME_M=$(shell uname -m)
331+
ifeq ($(findstring x86_64,$(UNAME_M)),x86_64)
331332
DESTCPU ?= x64
332333
else
334+
ifeq ($(findstring ppc64,$(UNAME_M)),ppc64)
335+
DESTCPU ?= ppc64
336+
else
337+
ifeq ($(findstring ppc,$(UNAME_M)),ppc)
338+
DESTCPU ?= ppc
339+
else
340+
ifeq ($(findstring s390x,$(UNAME_M)),s390x)
341+
DESTCPU ?= s390x
342+
else
343+
ifeq ($(findstring s390,$(UNAME_M)),s390)
344+
DESTCPU ?= s390
345+
else
346+
ifeq ($(findstring arm,$(UNAME_M)),arm)
347+
DESTCPU ?= arm
348+
else
349+
ifeq ($(findstring aarch64,$(UNAME_M)),aarch64)
350+
DESTCPU ?= aarch64
351+
else
352+
ifeq ($(findstring powerpc,$(shell uname -p)),powerpc)
353+
DESTCPU ?= ppc64
354+
else
333355
DESTCPU ?= x86
334356
endif
357+
endif
358+
endif
359+
endif
360+
endif
361+
endif
362+
endif
363+
endif
335364
ifeq ($(DESTCPU),x64)
336365
ARCH=x64
337366
else

0 commit comments

Comments
 (0)