--- musl-1.1.7.ebuild 2015-03-22 16:31:28.384397143 -0100 +++ musl-1.1.7-r1.ebuild 2015-03-22 19:05:38.211758388 -0100 @@ -57,9 +57,11 @@ tc-getCC ${CTARGET} just_headers && export CC=true + local sysroot + is_crosscompile && sysroot=/usr/${CTARGET} ./configure \ --target="${CTARGET}" \ - --prefix="/usr" \ + --prefix="${sysroot}"/usr \ --disable-gcc-wrapper } @@ -71,23 +73,17 @@ } src_install() { - local sysroot=${D} - is_crosscompile && sysroot+="/usr/${CTARGET}" - local target="install" just_headers && target="install-headers" - emake DESTDIR="${sysroot}" ${target} || die + emake DESTDIR="${D}" ${target} || die + just_headers && return 0 - # Make sure we install the sys-include symlink so that when - # we build a 2nd stage cross-compiler, gcc finds the target - # system headers correctly. See gcc/doc/gccinstall.info - if is_crosscompile ; then - dosym usr/include /usr/${CTARGET}/sys-include - fi # musl provides ldd via a sym link to its ld.so - local ldso=$(basename ${D}/lib/ld-musl-*) - dosym /lib/${ldso} /usr/bin/ldd + local ldso=$(basename "${D}"/lib/ld-musl-*) + local sysroot=/ + is_crosscompile && sysroot=/usr/${CTARGET} + dosym /lib/${ldso} ${sysroot}/usr/bin/ldd } pkg_postinst() {