|
8 | 8 | # It runs on Unix shells like {a,ba,da,k,z}sh. It uses the common `local`
|
9 | 9 | # extension. Note: Most shells limit `local` to 1 var per line, contra bash.
|
10 | 10 |
|
| 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 | + |
11 | 20 | set -u
|
12 | 21 |
|
13 | 22 | # If RUSTUP_UPDATE_ROOT is unset or empty, default it.
|
@@ -192,6 +201,24 @@ get_architecture() {
|
192 | 201 | fi
|
193 | 202 | fi
|
194 | 203 |
|
| 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 | + |
195 | 222 | case "$_ostype" in
|
196 | 223 |
|
197 | 224 | Android)
|
@@ -219,6 +246,10 @@ get_architecture() {
|
219 | 246 | _ostype=apple-darwin
|
220 | 247 | ;;
|
221 | 248 |
|
| 249 | + illumos) |
| 250 | + _ostype=unknown-illumos |
| 251 | + ;; |
| 252 | + |
222 | 253 | MINGW* | MSYS* | CYGWIN*)
|
223 | 254 | _ostype=pc-windows-gnu
|
224 | 255 | ;;
|
|
0 commit comments