# or installing for the first time. Build a local copy of tic whenever
# the host version isn't available. #249363 #557598
if ! ROOT=/ has_version "~sys-libs/${P}:0" ; then
+ local lbuildflags="-static"
+
+ # some toolchains don't quite support static linking
+ local dbuildflags="-Wl,-rpath,${WORKDIR}/lib"
+ case ${CHOST} in
+ *-darwin*) dbuildflags= ;;
+ esac
+ echo "int main() {}" | \
+ $(tc-getCC) -o x -x c - ${lbuildflags} -pipe >& /dev/null \
+ || lbuildflags="${dbuildflags}"
+
# We can't re-use the multilib BUILD_DIR because we run outside of it.
BUILD_DIR="${WORKDIR}" \
CHOST=${CBUILD} \
CFLAGS=${BUILD_CFLAGS} \
CXXFLAGS=${BUILD_CXXFLAGS} \
CPPFLAGS=${BUILD_CPPFLAGS} \
- LDFLAGS="${BUILD_LDFLAGS} -static" \
+ LDFLAGS="${BUILD_LDFLAGS} ${lbuildflags}" \
multijob_child_init do_configure cross --without-shared --with-normal
fi
multilib-minimal_src_configure
# Force bash until upstream rebuilds the configure script with a newer
# version of autotools. #545532
- CONFIG_SHELL=/bin/bash \
+ CONFIG_SHELL=${EPREFIX}/bin/bash \
ECONF_SOURCE=${S} \
econf "${conf[@]}" "$@"
}