Index: tauon/toolchain-binutils.eclass =================================================================== --- tauon.orig/toolchain-binutils.eclass 2013-07-29 14:18:31.000000000 +0900 +++ tauon/toolchain-binutils.eclass 2013-08-12 17:10:36.000000000 +0900 @@ -229,7 +229,8 @@ local myconf=() # enable gold if available (installed as ld.gold) - if use cxx ; then + # PREFIX LOCAL: Linux only (fails to compile on Solaris, MiNT #353410) + if [[ ${CHOST} == *-linux* ]] && use cxx ; then if grep -q 'enable-gold=default' "${S}"/configure ; then myconf+=( --enable-gold ) # old ways - remove when 2.21 is stable @@ -260,9 +261,10 @@ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;; esac + [[ ${CHOST} == *"-solaris"* ]] && use nls && append-libs -lintl use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd ) [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} ) - is_cross && myconf+=( --with-sysroot=/usr/${CTARGET} ) + is_cross && myconf+=( --with-sysroot="${EPREFIX}"/usr/${CTARGET} ) # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+ # on everyone in alpha (for now), we'll just enable it when possible @@ -270,16 +272,16 @@ has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt ) myconf+=( - --prefix=/usr + --prefix="${EPREFIX}"/usr --host=${CHOST} --target=${CTARGET} - --datadir=${DATAPATH} - --infodir=${DATAPATH}/info - --mandir=${DATAPATH}/man - --bindir=${BINPATH} - --libdir=${LIBPATH} - --libexecdir=${LIBPATH} - --includedir=${INCPATH} + --datadir="${EPREFIX}"${DATAPATH} + --infodir="${EPREFIX}"${DATAPATH}/info + --mandir="${EPREFIX}"${DATAPATH}/man + --bindir="${EPREFIX}"${BINPATH} + --libdir="${EPREFIX}"${LIBPATH} + --libexecdir="${EPREFIX}"${LIBPATH} + --includedir="${EPREFIX}"${INCPATH} --enable-obsolete --enable-shared --enable-threads @@ -317,7 +319,7 @@ --with-bfd-include-dir=${MY_BUILDDIR}/bfd --with-libbfd=${MY_BUILDDIR}/bfd/libbfd.a --with-libiberty=${MY_BUILDDIR}/libiberty/libiberty.a - --with-binutils-ldscript-dir=${LIBPATH}/ldscripts + --with-binutils-ldscript-dir="${EPREFIX}"/${LIBPATH}/ldscripts ) echo ./configure "${myconf[@]}" ./configure "${myconf[@]}" || die @@ -335,12 +337,12 @@ local x d cd "${MY_BUILDDIR}" - emake DESTDIR="${D}" tooldir="${LIBPATH}" install || die - rm -rf "${D}"/${LIBPATH}/bin - use static-libs || find "${D}" -name '*.la' -delete + emake DESTDIR="${D}" tooldir="${EPREFIX}/${LIBPATH}" install || die + rm -rf "${ED}"/${LIBPATH}/bin + use static-libs || find "${ED}" -name '*.la' -delete # Newer versions of binutils get fancy with ${LIBPATH} #171905 - cd "${D}"/${LIBPATH} + cd "${ED}"/${LIBPATH} for d in ../* ; do [[ ${d} == ../${BVER} ]] && continue mv ${d}/* . || die @@ -351,15 +353,15 @@ # When something is built to cross-compile, it installs into # /usr/$CHOST/ by default ... we have to 'fix' that :) if is_cross ; then - cd "${D}"/${BINPATH} + cd "${ED}"/${BINPATH} for x in * ; do mv ${x} ${x/${CTARGET}-} done - if [[ -d ${D}/usr/${CHOST}/${CTARGET} ]] ; then - mv "${D}"/usr/${CHOST}/${CTARGET}/include "${D}"/${INCPATH} - mv "${D}"/usr/${CHOST}/${CTARGET}/lib/* "${D}"/${LIBPATH}/ - rm -r "${D}"/usr/${CHOST}/{include,lib} + if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then + mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH} + mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/ + rm -r "${ED}"/usr/${CHOST}/{include,lib} fi fi insinto ${INCPATH} @@ -374,9 +376,9 @@ splay-tree.h ) doins "${libiberty_headers[@]/#/${S}/include/}" || die - if [[ -d ${D}/${LIBPATH}/lib ]] ; then - mv "${D}"/${LIBPATH}/lib/* "${D}"/${LIBPATH}/ - rm -r "${D}"/${LIBPATH}/lib + if [[ -d ${ED}/${LIBPATH}/lib ]] ; then + mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ + rm -r "${ED}"/${LIBPATH}/lib fi # Insert elf2flt where appropriate @@ -386,7 +388,7 @@ doins elf2flt.ld || die "doins elf2flt.ld failed" exeinto ${BINPATH} doexe elf2flt flthdr || die "doexe elf2flt flthdr failed" - mv "${D}"/${BINPATH}/{ld,ld.real} || die + mv "${ED}"/${BINPATH}/{ld,ld.real} || die newexe ld-elf2flt ld || die "doexe ld-elf2flt failed" newdoc README README.elf2flt fi @@ -416,7 +418,7 @@ cat <<-EOF > env.d TARGET="${CTARGET}" VER="${BVER}" - LIBPATH="${LIBPATH}" + LIBPATH="${EPREFIX}/${LIBPATH}" FAKE_TARGETS="${FAKE_TARGETS}" EOF newins env.d ${CTARGET}-${BVER} @@ -441,14 +443,14 @@ dodoc opcodes/ChangeLog* fi # Remove shared info pages - rm -f "${D}"/${DATAPATH}/info/{dir,configure.info,standards.info} + rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info} # Trim all empty dirs - find "${D}" -type d | xargs rmdir >& /dev/null + find "${ED}" -type d | xargs rmdir >& /dev/null } toolchain-binutils_pkg_postinst() { # Make sure this ${CTARGET} has a binutils version selected - [[ -e ${ROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0 + [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0 binutils-config ${CTARGET}-${BVER} } @@ -461,12 +463,12 @@ # rerun binutils-config if this is a remerge, as # we want the mtimes on the symlinks updated (if # it is the same as the current selected profile) - if [[ ! -e ${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then + if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}') choice=${choice//$'\n'/ } choice=${choice/* } if [[ -z ${choice} ]] ; then - env -i ROOT="${ROOT}" binutils-config -u ${CTARGET} + env -i ROOT="${ROOT}" "${EPREFIX}"/usr/bin/binutils-config -u ${CTARGET} else binutils-config ${choice} fi