Skip to content

Commit c7ffb3e

Browse files
authored
Auto merge of #3050 - nbaksalyar:configure-fix, r=alexcrichton
Fix POSIX shell in configure script (support Illumos & Solaris) This patch provides the same fix that is applied for the `configure` script in rustc: https://github.com/rust-lang/rust/blob/master/configure#L3-L9. It is required because `#!/bin/sh` is not Bash/POSIX-compatible on Solaris and its derivatives by default. This change was previously discussed there: rust-lang/rust#28589.
2 parents eff0a95 + 1e38c58 commit c7ffb3e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

configure

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/sh
22

3+
# /bin/sh on Solaris is not a POSIX compatible shell, but /usr/bin/bash is.
4+
if [ `uname -s` = 'SunOS' -a "${POSIX_SHELL}" != "true" ]; then
5+
POSIX_SHELL="true"
6+
export POSIX_SHELL
7+
exec /usr/bin/env bash $0 "$@"
8+
fi
9+
unset POSIX_SHELL # clear it so if we invoke other scripts, they run as bash as well
10+
311
msg() {
412
echo "configure: $1"
513
}

0 commit comments

Comments
 (0)