Skip to content

Commit 972cb47

Browse files
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.
1 parent 31de5cc commit 972cb47

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

327-
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
327+
UNAME_M=$(shell uname -m)
328+
ifeq ($(findstring x86_64,$(UNAME_M)),x86_64)
328329
DESTCPU ?= x64
329330
else
331+
ifeq ($(findstring ppc64,$(UNAME_M)),ppc64)
332+
DESTCPU ?= ppc64
333+
else
334+
ifeq ($(findstring ppc,$(UNAME_M)),ppc)
335+
DESTCPU ?= ppc
336+
else
337+
ifeq ($(findstring s390x,$(UNAME_M)),s390x)
338+
DESTCPU ?= s390x
339+
else
340+
ifeq ($(findstring s390,$(UNAME_M)),s390)
341+
DESTCPU ?= s390
342+
else
343+
ifeq ($(findstring arm,$(UNAME_M)),arm)
344+
DESTCPU ?= arm
345+
else
346+
ifeq ($(findstring aarch64,$(UNAME_M)),aarch64)
347+
DESTCPU ?= aarch64
348+
else
349+
ifeq ($(findstring powerpc,$(shell uname -p)),powerpc)
350+
DESTCPU ?= ppc64
351+
else
330352
DESTCPU ?= x86
331353
endif
354+
endif
355+
endif
356+
endif
357+
endif
358+
endif
359+
endif
360+
endif
332361
ifeq ($(DESTCPU),x64)
333362
ARCH=x64
334363
else

0 commit comments

Comments
 (0)