From 7d72ed018475b7f72a5352125ec844dcde5b0fec Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 29 May 2020 23:10:28 -0400 Subject: [PATCH] configure: Use /bin/dash as JAMSHELL if available. On platforms (such as Haiku) where dash is available or can be installed but is not the default /bin/sh, this can provide a significant improvement to compile times vs. /bin/bash or other more complex shells. At least under Haiku, this is around a ~10% "real" time gain for builds. This also allows one to specify a JAMSHELL by passing that environ to ./configure. --- configure | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 4bf2fbb22f..6056ba0a6a 100755 --- a/configure +++ b/configure @@ -541,7 +541,7 @@ configurePath=$0 configureEnvirons= for var in `env`; do case "$var" in - CC\=*|HAIKU*\=*) + CC\=*|HAIKU*\=*|JAMSHELL\=*) configureEnvirons="$configureEnvirons $var" ;; esac @@ -824,6 +824,19 @@ if [ $HOST_PLATFORM = "darwin" ]; then HOST_EXTENDED_REGEX_SED="sed -E" fi +# pick a JAMSHELL +if [ "$JAMSHELL" = "" ]; then + if check_file_exists /bin/dash; then + JAMSHELL=/bin/dash + else + JAMSHELL=/bin/sh + fi +fi +if ! $JAMSHELL -c true; then + echo "$JAMSHELL does not work! Please specify a working JAMSHELL." + exit 1 +fi + # locate python if python3 --version < /dev/null > /dev/null 2>&1; then HOST_PYTHON="python3" @@ -1068,6 +1081,8 @@ HAIKU_HOST_USE_XATTR ?= "${HAIKU_HOST_USE_XATTR}" ; HAIKU_HOST_USE_XATTR_REF ?= "${HAIKU_HOST_USE_XATTR_REF}" ; HAIKU_HOST_BUILD_ONLY ?= "${HAIKU_HOST_BUILD_ONLY}" ; +JAMSHELL ?= ${JAMSHELL} -c ; + HOST_CC ?= ${CC} ; HOST_GCC_RAW_VERSION ?= ${HOST_GCC_RAW_VERSION} ; HOST_GCC_MACHINE ?= ${HOST_GCC_MACHINE} ;