Index: bin/ebuild.sh =================================================================== --- bin/ebuild.sh (revision 15820) +++ bin/ebuild.sh (working copy) @@ -482,6 +482,11 @@ : ${ECONF_SOURCE:=.} if [ -x "${ECONF_SOURCE}/configure" ]; then + if [[ -n $CONFIG_SHELL && \ + "$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'/bin/sh ]] ; then + sed -e "1s:.*:#!$CONFIG_SHELL" -i "$ECONF_SOURCE/configure" || \ + die "Substition of shebang in '$ECONF_SOURCE/configure' failed" + fi if [ -e /usr/share/gnuconfig/ ]; then find "${WORKDIR}" -type f '(' \ -name config.guess -o -name config.sub ')' -print0 | \