--- /usr/portage/sys-devel/binutils/binutils-2.13.90.0.18.ebuild 2003-03-11 21:21:13.000000000 +0000 +++ binutils-2.13.90.0.18-r2.ebuild 2003-03-23 03:58:22.000000000 +0000 @@ -1,16 +1,16 @@ -# Copyright 1999-2003 Gentoo Technologies, Inc. +# Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /home/cvsroot/gentoo-x86/sys-devel/binutils/binutils-2.13.90.0.18.ebuild,v 1.12 2003/03/11 21:11:47 seemant Exp $ +# $Header: /home/cvsroot/gentoo-x86/sys-devel/binutils/binutils-2.13.90.0.18.ebuild,v 1.1 2003/01/26 15:25:01 azarah Exp $ -IUSE="nls bootstrap build" +IUSE="nls bootstrap static build" # NOTE to Maintainer: ChangeLog states that it no longer use perl to build # the manpages, but seems this is incorrect .... -inherit eutils libtool flag-o-matic +inherit eutils libtool flag-o-matic crosscompile # Generate borked binaries. Bug #6730 -filter-flags "-fomit-frame-pointer -fssa" +filter-flags "-fomit-frame-pointer" S="${WORKDIR}/${P}" DESCRIPTION="Tools necessary to build programs" @@ -18,9 +18,12 @@ ftp://ftp.kernel.org/pub/linux/devel/binutils/test/${P}.tar.bz2" HOMEPAGE="http://sources.redhat.com/binutils/" -SLOT="0" +# cross compiling eclass support +# SLOT=2.13 or ${CCHOST}-2.13 +cross-check 2.13 + LICENSE="GPL-2|LGPL-2" -KEYWORDS="x86 ppc alpha ~sparc ~mips hppa arm" +KEYWORDS="x86 ~ppc ~alpha ~sparc ~mips ~arm" DEPEND="virtual/glibc >=sys-apps/portage-2.0.21 @@ -29,15 +32,9 @@ ( !build? ( dev-lang/perl ) ) ( !bootstrap? ( dev-lang/perl ) ) )" -# This is a hairy one. Basically depend on dev-lang/perl +# This is a hairy one. Basically depend on sys-devel/perl # if "build" or "bootstrap" not in USE. - -# filter CFLAGS=".. -O2 .." on arm -if [ "${ARCH}" = "arm" ]; then - CFLAGS="$(echo "${CFLAGS}" | sed -e 's,-O[2-9] ,-O1 ,')" -fi - src_unpack() { unpack ${A} @@ -49,7 +46,8 @@ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.10-ia64-brl.patch epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.10-x86_64-testsuite.patch epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.10-x86_64-gotpcrel.patch - epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.18-eh-frame-ro.patch +# This one needs to be ported, but I dont feel like it right now. +# epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.16-eh-frame-ro.patch use x86 &> /dev/null \ && epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.16-array-sects-compat.patch @@ -73,19 +71,28 @@ elibtoolize --portage ./configure --enable-shared \ + --host=${CHOST} \ + --target=${CCHOST} \ --enable-64-bit-bfd \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ - --host=${CHOST} \ ${myconf} || die make configure-bfd || die make headers -C bfd || die - emake tooldir="${ROOT}/usr/bin" \ - all || die + + if [ "`use static`" ] + then + emake tooldir="${ROOT}/usr/bin" \ + -e LDFLAGS="-all-static" \ + all || die + else + emake tooldir="${ROOT}/usr/bin" \ + all || die + fi - if [ -z "`use build`" ] + if [ -z "`use build`" ] && ! cross-target then if [ -z "`use bootstrap`" ] then @@ -104,6 +111,13 @@ infodir=${D}/usr/share/info \ install || die + if cross-target; then + # nuke libibery.so and documentation + rm -rf "${D}/usr/lib" "${D}/usr/share" + return 0 + fi + # everything else is only installed with the native tools + insinto /usr/include doins include/libiberty.h @@ -111,30 +125,27 @@ # but not the manpage, so leave that! rm -f ${D}/usr/bin/c++filt #${D}/usr/share/man/man1/c++filt* - # By default strip has a symlink going from /usr/${CHOST}/bin/strip to - # /usr/bin/strip we should reverse it: - - rm ${D}/usr/${CHOST}/bin/strip; mv ${D}/usr/bin/strip ${D}/usr/${CHOST}/bin/strip - # The strip symlink gets created in the loop below - - # By default ar, as, ld, nm, ranlib and strip are in two places; create # symlinks. This will reduce the size of the tbz2 significantly. We also # move all the stuff in /usr/bin to /usr/${CHOST}/bin and create the # appropriate symlinks. Things are cleaner that way. cd ${D}/usr/bin local x="" - for x in * strip + for x in * do - if [ ! -e ../${CHOST}/bin/${x} ] + if [ -e ../${CHOST}/bin/${x} ] then - mv ${x} ../${CHOST}/bin/${x} - else + # remove the duplicate rm -f ${x} + else + # move the only copy into safe location + mv ${x} ../${CHOST}/bin/${x} fi + # create soft link in /usr/bin ln -s ../${CHOST}/bin/${x} ${x} done cd ${S} + # now install documentation if we are not bootstraping if [ -z "`use build`" ] then make prefix=${D}/usr \