Skip to content

Commit e57b207

Browse files
depressed-phonarimiran
authored andcommitted
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 0ba9321)
1 parent b9951e8 commit e57b207

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

compiler/installer.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Platforms: """
1010
macosx: i386;amd64;powerpc64;arm64
1111
solaris: i386;amd64;sparc;sparc64
1212
freebsd: i386;amd64;powerpc64;arm;arm64;riscv64;sparc64;mips;mipsel;mips64;mips64el;powerpc;powerpc64el
13-
netbsd: i386;amd64
13+
netbsd: i386;amd64;arm64
1414
openbsd: i386;amd64;arm;arm64
1515
dragonfly: i386;amd64
1616
crossos: amd64

lib/pure/distros.nim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ type
128128

129129
BSD
130130
FreeBSD
131+
NetBSD
131132
OpenBSD
132133
DragonFlyBSD
133134

@@ -169,7 +170,7 @@ proc detectOsImpl(d: Distribution): bool =
169170
else:
170171
when defined(bsd):
171172
case d
172-
of Distribution.FreeBSD, Distribution.OpenBSD:
173+
of Distribution.FreeBSD, Distribution.NetBSD, Distribution.OpenBSD:
173174
result = $d in uname()
174175
else:
175176
result = false
@@ -252,7 +253,7 @@ proc foreignDepInstallCmd*(foreignPackageName: string): (string, bool) =
252253
result = ("nix-env -i " & p, false)
253254
elif detectOs(Solaris) or detectOs(FreeBSD):
254255
result = ("pkg install " & p, true)
255-
elif detectOs(OpenBSD):
256+
elif detectOs(NetBSD) or detectOs(OpenBSD):
256257
result = ("pkg_add " & p, true)
257258
elif detectOs(PCLinuxOS):
258259
result = ("rpm -ivh " & p, true)

tools/niminst/buildsh.nimf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ case $uos in
122122
*netbsd* )
123123
myos="netbsd"
124124
LINK_FLAGS="$LINK_FLAGS -lm"
125+
ucpu=`uname -p`
125126
;;
126127
*darwin* )
127128
myos="macosx"

tools/niminst/makefile.nimf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ endif
4545
ifeq ($(uos),netbsd)
4646
myos = netbsd
4747
LDFLAGS += -lm
48+
ucpu = $(shell sh -c 'uname -p')
4849
endif
4950
ifeq ($(uos),darwin)
5051
myos = macosx

0 commit comments

Comments
 (0)