diff options
author | Christoph Junghans <ottxor@gentoo.org> | 2013-09-30 02:28:42 +0000 |
---|---|---|
committer | Christoph Junghans <ottxor@gentoo.org> | 2013-09-30 02:28:42 +0000 |
commit | 982db3171c42e5994a83f0e703174469f7a3d112 (patch) | |
tree | 6c7e138261777b6535c48f94988527023e469c0c /eclass | |
parent | removed unneeded eutils inherit (diff) | |
download | gentoo-2-982db3171c42e5994a83f0e703174469f7a3d112.tar.gz gentoo-2-982db3171c42e5994a83f0e703174469f7a3d112.tar.bz2 gentoo-2-982db3171c42e5994a83f0e703174469f7a3d112.zip |
add prefix support
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 6 | ||||
-rw-r--r-- | eclass/toolchain-binutils.eclass | 63 |
2 files changed, 38 insertions, 31 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index bc96a24ea728..2616e6d83d9d 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1000 2013/09/29 18:00:30 ottxor Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1001 2013/09/30 02:28:42 ottxor Exp $ + + 30 Sep 2013; Christoph Junghans <ottxor@gentoo.org> + toolchain-binutils.eclass: + add prefix support 29 Sep 2013; Christoph Junghans <ottxor@gentoo.org> intel-sdp.eclass: EAPI bump, ccache support diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass index a486ab157f3c..c7ab42321a38 100644 --- a/eclass/toolchain-binutils.eclass +++ b/eclass/toolchain-binutils.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.123 2013/02/09 04:32:48 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.124 2013/09/30 02:28:42 ottxor Exp $ # # Maintainer: Toolchain Ninjas <toolchain@gentoo.org> # @@ -60,6 +60,9 @@ if [[ ${CTARGET} == ${CHOST} ]] ; then fi is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } +: ${ED:=${D}} +: ${EROOT:=${ROOT}} + DESCRIPTION="Tools necessary to build programs" HOMEPAGE="http://sourceware.org/binutils/" @@ -262,7 +265,7 @@ toolchain-binutils_src_compile() { 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 +273,16 @@ toolchain-binutils_src_compile() { 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 +320,7 @@ toolchain-binutils_src_compile() { --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 +338,12 @@ toolchain-binutils_src_install() { 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 +354,15 @@ toolchain-binutils_src_install() { # 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 +377,9 @@ toolchain-binutils_src_install() { 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 +389,7 @@ toolchain-binutils_src_install() { 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 +419,7 @@ toolchain-binutils_src_install() { 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 +444,14 @@ toolchain-binutils_src_install() { 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,7 +464,7 @@ toolchain-binutils_pkg_postrm() { # 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/* } |