mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -122,6 +122,7 @@ case $uos in
|
||||
*netbsd* )
|
||||
myos="netbsd"
|
||||
LINK_FLAGS="$LINK_FLAGS -lm"
|
||||
ucpu=`uname -p`
|
||||
;;
|
||||
*darwin* )
|
||||
myos="macosx"
|
||||
|
||||
@@ -45,6 +45,7 @@ endif
|
||||
ifeq ($(uos),netbsd)
|
||||
myos = netbsd
|
||||
LDFLAGS += -lm
|
||||
ucpu = $(shell sh -c 'uname -p')
|
||||
endif
|
||||
ifeq ($(uos),darwin)
|
||||
myos = macosx
|
||||
|
||||
Reference in New Issue
Block a user