Skip to content
This repository was archived by the owner on Mar 17, 2024. It is now read-only.

Commit f266a96

Browse files
committed
add illumos (amd64) support
1 parent 2ee5409 commit f266a96

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

rustup-init.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
# It runs on Unix shells like {a,ba,da,k,z}sh. It uses the common `local`
99
# extension. Note: Most shells limit `local` to 1 var per line, contra bash.
1010

11+
if [ "$KSH_VERSION" = 'Version JM 93t+ 2010-03-05' ]; then
12+
# The version of ksh93 that ships with many illumos systems does not
13+
# support the "local" extension. Print a message rather than fail in
14+
# subtle ways later on:
15+
echo 'rustup does not work with this ksh93 version; please try bash!' >&2
16+
exit 1
17+
fi
18+
19+
1120
set -u
1221

1322
# If RUSTUP_UPDATE_ROOT is unset or empty, default it.
@@ -192,6 +201,24 @@ get_architecture() {
192201
fi
193202
fi
194203

204+
if [ "$_ostype" = SunOS ]; then
205+
# Both Solaris and illumos presently announce as "SunOS" in "uname -s"
206+
# so use "uname -o" to disambiguate. We use the full path to the
207+
# system uname in case the user has coreutils uname first in PATH,
208+
# which has historically sometimes printed the wrong value here.
209+
if [ "$(/usr/bin/uname -o)" = illumos ]; then
210+
_ostype=illumos
211+
fi
212+
213+
# illumos systems have multi-arch userlands, and "uname -m" reports the
214+
# machine hardware name; e.g., "i86pc" on both 32- and 64-bit x86
215+
# systems. Check for the native (widest) instruction set on the
216+
# running kernel:
217+
if [ "$_cputype" = i86pc ]; then
218+
_cputype="$(isainfo -n)"
219+
fi
220+
fi
221+
195222
case "$_ostype" in
196223

197224
Android)
@@ -219,6 +246,10 @@ get_architecture() {
219246
_ostype=apple-darwin
220247
;;
221248

249+
illumos)
250+
_ostype=unknown-illumos
251+
;;
252+
222253
MINGW* | MSYS* | CYGWIN*)
223254
_ostype=pc-windows-gnu
224255
;;

0 commit comments

Comments
 (0)