From 1e38c58fcf2ff6cb93d45effbbdecbeaf7664aab Mon Sep 17 00:00:00 2001
From: Nikita Baksalyar <nikita.baksalyar@gmail.com>
Date: Thu, 16 Jun 2016 05:25:18 +0000
Subject: [PATCH] Fix POSIX shell in the configure script

---
 configure | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/configure b/configure
index eccd7dd8c7f..22108f7f88c 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,13 @@
 #!/bin/sh
 
+# /bin/sh on Solaris is not a POSIX compatible shell, but /usr/bin/bash is.
+if [ `uname -s` = 'SunOS' -a "${POSIX_SHELL}" != "true" ]; then
+    POSIX_SHELL="true"
+    export POSIX_SHELL
+    exec /usr/bin/env bash $0 "$@"
+fi
+unset POSIX_SHELL # clear it so if we invoke other scripts, they run as bash as well
+
 msg() {
     echo "configure: $1"
 }