/usr/share/build-1/libtool script is tied to a shell used by configure at build time. The following steps can break compilation of packages depending on apr: 1. /bin/sh -> bash 2. compile apr 3. switch /bin/sh -> dash As a workaround you can force apr build system to always use bash (like it was in apr-1.4.8-r1): # grep CONFIG_SHELL apr-1.4.8-r1.ebuild CONFIG_SHELL="${EPREFIX}"/bin/bash econf \ For example libtool ebuild does the same: src_configure() { # the libtool script uses bash code in it and at configure time, tries # to find a bash shell. if /bin/sh is bash, it uses that. this can # cause problems for people who switch /bin/sh on the fly to other # shells, so just force libtool to use /bin/bash all the time. export CONFIG_SHELL=/bin/bash ECONF_SOURCE=${S} econf --disable-ltdl-install }