[PATCH 1/4] Make configure use /bin/bash instead of /bin/sh

Tomi Ollila tomi.ollila at iki.fi
Tue Apr 10 10:26:33 PDT 2012


On Mon, Apr 09 2012, Vladimir Marek wrote:

>> > Posix /bin/sh is not capable of running this configure and fails.
>> 
>> What fails? What would it take to make this work on posix sh instead?
>> 
>> The tests do require bash, but generally I think it would be preferable to
>> not depend on bash to build.
>
> Well I gave it a quick stab. This is not posix:
>
> BLAH=$( ... )
> BLAH=$(( ... ))
> ${option%=*}
> ${option%%=*}
> ${option#=*}
> ${option##=*}

According to 

http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html

all of those are part of Shell Command Language...

Does the configure script work if you replace /bin/sh with /bin/ksh
in your Solaris box

If yes, something like the following could be added to the beginning
of 'configure'

option=option=value
if test ! x"${option$*=}" = x"value" 2>/dev/null; then
	if test x"${PREVENT_LOOPING-}" = x; then
        	PREVENT_LOOPING=true; export PREVENT_LOOPING
                test ! -x /bin/ksh || exec /bin/ksh "$0" "$@"
                test ! -x /bin/bash || exec /bin/bash "$0" "$@"
        fi
        echo "Cannot find compatible shell for '$0'" >&2
        exit 1
fi



>
> First two cases are easy to replace by `...` resp `expr ...`. The rest
> leads to external utility like sed. The dirtiest part of configure is
> parsing the commandline arguments, but that could be replaced by
> /usr/bin/getopts.
>
> If it is appealing way of doing that, I can rework my patch and submit
> it for consideration.
>
> Thank you
> -- 
> 	Vlad
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list