From b36f5119ae3e4f450960a86ff77eaae4e9b05fcd Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Thu, 1 Dec 2022 04:48:47 +0000 Subject: [PATCH] Add HPPA and sparc64 architectures (#20934) * Add comments on CPU arch detection * Support HPPA/hppa/parisc64 CPU architecture * Support sparc64 CPU architecture * Update tools/niminst/makefile.nimf Co-authored-by: Andreas Rumpf --- lib/system/platforms.nim | 2 ++ tools/niminst/makefile.nimf | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lib/system/platforms.nim b/lib/system/platforms.nim index 18d61b93cfdd4..0619f3fcaa4e6 100644 --- a/lib/system/platforms.nim +++ b/lib/system/platforms.nim @@ -10,6 +10,8 @@ ## Platform detection for NimScript. This module is included by the system module! ## Do not import it directly! +# CPU architectures have alias names mapped in tools/niminst/makefile.nimf + type CpuPlatform* {.pure.} = enum ## the CPU this program will run on. none, ## unknown CPU diff --git a/tools/niminst/makefile.nimf b/tools/niminst/makefile.nimf index 46b4892a02de6..2fe89ed697df5 100644 --- a/tools/niminst/makefile.nimf +++ b/tools/niminst/makefile.nimf @@ -16,6 +16,7 @@ endif target := ?{"$(binDir)/" & toLowerAscii(c.name)} + ucpu := $(shell sh -c 'uname -m | tr "[:upper:]" "[:lower:]"') ifeq ($(OS),Windows_NT) uos := windows @@ -103,12 +104,18 @@ endif ifeq ($(ucpu),x86_64) mycpu = amd64 endif +ifeq ($(ucpu),parisc64) + mycpu = hppa +endif ifeq ($(ucpu),s390x) mycpu = s390x endif ifeq ($(ucpu),sparc) mycpu = sparc endif +ifeq ($(ucpu),sparc64) + mycpu = sparc64 +endif ifeq ($(ucpu),sun) mycpu = sparc endif