Support NetBSD/aarch64 (#23616)

I could trivially port Nim to NetBSD/aarch64 because it already
supported NetBSD and aarch64. I only needed to generate `c_code` for
this combination.

(cherry picked from commit 0ba932132e)
This commit is contained in:
PHO
2024-05-17 06:22:49 +09:00
committed by narimiran
parent b9951e8c87
commit e57b207ff8
4 changed files with 6 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ Platforms: """
macosx: i386;amd64;powerpc64;arm64
solaris: i386;amd64;sparc;sparc64
freebsd: i386;amd64;powerpc64;arm;arm64;riscv64;sparc64;mips;mipsel;mips64;mips64el;powerpc;powerpc64el
netbsd: i386;amd64
netbsd: i386;amd64;arm64
openbsd: i386;amd64;arm;arm64
dragonfly: i386;amd64
crossos: amd64

View File

@@ -128,6 +128,7 @@ type
BSD
FreeBSD
NetBSD
OpenBSD
DragonFlyBSD
@@ -169,7 +170,7 @@ proc detectOsImpl(d: Distribution): bool =
else:
when defined(bsd):
case d
of Distribution.FreeBSD, Distribution.OpenBSD:
of Distribution.FreeBSD, Distribution.NetBSD, Distribution.OpenBSD:
result = $d in uname()
else:
result = false
@@ -252,7 +253,7 @@ proc foreignDepInstallCmd*(foreignPackageName: string): (string, bool) =
result = ("nix-env -i " & p, false)
elif detectOs(Solaris) or detectOs(FreeBSD):
result = ("pkg install " & p, true)
elif detectOs(OpenBSD):
elif detectOs(NetBSD) or detectOs(OpenBSD):
result = ("pkg_add " & p, true)
elif detectOs(PCLinuxOS):
result = ("rpm -ivh " & p, true)

View File

@@ -122,6 +122,7 @@ case $uos in
*netbsd* )
myos="netbsd"
LINK_FLAGS="$LINK_FLAGS -lm"
ucpu=`uname -p`
;;
*darwin* )
myos="macosx"

View File

@@ -45,6 +45,7 @@ endif
ifeq ($(uos),netbsd)
myos = netbsd
LDFLAGS += -lm
ucpu = $(shell sh -c 'uname -p')
endif
ifeq ($(uos),darwin)
myos = macosx