| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.119 2012/10/17 19:14:58 vapier Exp $
|
| 4 |
#
|
| 5 |
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
|
| 6 |
#
|
| 7 |
# We install binutils into CTARGET-VERSION specific directories. This lets
|
| 8 |
# us easily merge multiple versions for multiple targets (if we wish) and
|
| 9 |
# then switch the versions on the fly (with `binutils-config`).
|
| 10 |
#
|
| 11 |
# binutils-99999999 -> live cvs
|
| 12 |
# binutils-9999 -> live git
|
| 13 |
# binutils-9999_preYYMMDD -> nightly snapshot date YYMMDD
|
| 14 |
# binutils-# -> normal release
|
| 15 |
|
| 16 |
extra_eclass=""
|
| 17 |
if [[ -n ${BINUTILS_TYPE} ]] ; then
|
| 18 |
BTYPE=${BINUTILS_TYPE}
|
| 19 |
else
|
| 20 |
case ${PV} in
|
| 21 |
99999999) BTYPE="cvs";;
|
| 22 |
9999) BTYPE="git";;
|
| 23 |
9999_pre*) BTYPE="snap";;
|
| 24 |
*.*.90) BTYPE="snap";;
|
| 25 |
*.*.*.*.*) BTYPE="hjlu";;
|
| 26 |
*) BTYPE="rel";;
|
| 27 |
esac
|
| 28 |
fi
|
| 29 |
|
| 30 |
case ${BTYPE} in
|
| 31 |
cvs)
|
| 32 |
extra_eclass="cvs"
|
| 33 |
ECVS_SERVER="sourceware.org:/cvs/src"
|
| 34 |
ECVS_MODULE="binutils"
|
| 35 |
ECVS_USER="anoncvs"
|
| 36 |
ECVS_PASS="anoncvs"
|
| 37 |
BVER="cvs"
|
| 38 |
;;
|
| 39 |
git)
|
| 40 |
extra_eclass="git-2"
|
| 41 |
BVER="git"
|
| 42 |
EGIT_REPO_URI="git://sourceware.org/git/binutils.git"
|
| 43 |
;;
|
| 44 |
snap)
|
| 45 |
BVER=${PV/9999_pre}
|
| 46 |
;;
|
| 47 |
*)
|
| 48 |
BVER=${BINUTILS_VER:-${PV}}
|
| 49 |
;;
|
| 50 |
esac
|
| 51 |
|
| 52 |
inherit eutils libtool flag-o-matic gnuconfig multilib versionator unpacker ${extra_eclass}
|
| 53 |
EXPORT_FUNCTIONS src_unpack src_compile src_test src_install pkg_postinst pkg_postrm
|
| 54 |
|
| 55 |
export CTARGET=${CTARGET:-${CHOST}}
|
| 56 |
if [[ ${CTARGET} == ${CHOST} ]] ; then
|
| 57 |
if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
|
| 58 |
export CTARGET=${CATEGORY/cross-}
|
| 59 |
fi
|
| 60 |
fi
|
| 61 |
is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
|
| 62 |
|
| 63 |
DESCRIPTION="Tools necessary to build programs"
|
| 64 |
HOMEPAGE="http://sources.redhat.com/binutils/"
|
| 65 |
|
| 66 |
case ${BTYPE} in
|
| 67 |
cvs|git) SRC_URI="" ;;
|
| 68 |
snap)
|
| 69 |
SRC_URI="ftp://gcc.gnu.org/pub/binutils/snapshots/binutils-${BVER}.tar.bz2
|
| 70 |
ftp://sourceware.org/pub/binutils/snapshots/binutils-${BVER}.tar.bz2" ;;
|
| 71 |
hjlu)
|
| 72 |
SRC_URI="mirror://kernel/linux/devel/binutils/binutils-${BVER}.tar."
|
| 73 |
version_is_at_least 2.21.51.0.5 && SRC_URI+="xz" || SRC_URI+="bz2" ;;
|
| 74 |
rel) SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.bz2" ;;
|
| 75 |
esac
|
| 76 |
add_src_uri() {
|
| 77 |
[[ -z $2 ]] && return
|
| 78 |
local a=$1
|
| 79 |
if version_is_at_least 2.22.52.0.2 ; then
|
| 80 |
a+=".xz"
|
| 81 |
else
|
| 82 |
a+=".bz2"
|
| 83 |
fi
|
| 84 |
set -- mirror://gentoo http://dev.gentoo.org/~vapier/dist
|
| 85 |
SRC_URI="${SRC_URI} ${@/%//${a}}"
|
| 86 |
}
|
| 87 |
add_src_uri binutils-${BVER}-patches-${PATCHVER}.tar ${PATCHVER}
|
| 88 |
add_src_uri binutils-${BVER}-uclibc-patches-${UCLIBC_PATCHVER}.tar ${UCLIBC_PATCHVER}
|
| 89 |
add_src_uri elf2flt-${ELF2FLT_VER}.tar ${ELF2FLT_VER}
|
| 90 |
|
| 91 |
if version_is_at_least 2.18 ; then
|
| 92 |
LICENSE="|| ( GPL-3 LGPL-3 )"
|
| 93 |
else
|
| 94 |
LICENSE="|| ( GPL-2 LGPL-2 )"
|
| 95 |
fi
|
| 96 |
IUSE="cxx nls multitarget multislot static-libs test vanilla"
|
| 97 |
if version_is_at_least 2.19 ; then
|
| 98 |
IUSE+=" zlib"
|
| 99 |
fi
|
| 100 |
if use multislot ; then
|
| 101 |
SLOT="${BVER}"
|
| 102 |
else
|
| 103 |
SLOT="0"
|
| 104 |
fi
|
| 105 |
|
| 106 |
RDEPEND=">=sys-devel/binutils-config-1.9"
|
| 107 |
in_iuse zlib && RDEPEND+=" zlib? ( sys-libs/zlib )"
|
| 108 |
DEPEND="${RDEPEND}
|
| 109 |
test? ( dev-util/dejagnu )
|
| 110 |
nls? ( sys-devel/gettext )
|
| 111 |
sys-devel/flex
|
| 112 |
virtual/yacc"
|
| 113 |
|
| 114 |
S=${WORKDIR}/binutils
|
| 115 |
case ${BVER} in
|
| 116 |
cvs|git) ;;
|
| 117 |
*) S=${S}-${BVER} ;;
|
| 118 |
esac
|
| 119 |
|
| 120 |
LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER}
|
| 121 |
INCPATH=${LIBPATH}/include
|
| 122 |
DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER}
|
| 123 |
MY_BUILDDIR=${WORKDIR}/build
|
| 124 |
if is_cross ; then
|
| 125 |
BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER}
|
| 126 |
else
|
| 127 |
BINPATH=/usr/${CTARGET}/binutils-bin/${BVER}
|
| 128 |
fi
|
| 129 |
|
| 130 |
tc-binutils_unpack() {
|
| 131 |
case ${BTYPE} in
|
| 132 |
cvs) cvs_src_unpack ;;
|
| 133 |
git) git-2_src_unpack ;;
|
| 134 |
*) unpacker ${A} ;;
|
| 135 |
esac
|
| 136 |
mkdir -p "${MY_BUILDDIR}"
|
| 137 |
[[ -d ${WORKDIR}/patch ]] && mkdir "${WORKDIR}"/patch/skip
|
| 138 |
}
|
| 139 |
|
| 140 |
# In case the ebuild wants to add a few of their own.
|
| 141 |
PATCHES=()
|
| 142 |
|
| 143 |
tc-binutils_apply_patches() {
|
| 144 |
cd "${S}"
|
| 145 |
|
| 146 |
if ! use vanilla ; then
|
| 147 |
[[ ${SYMLINK_LIB} != "yes" ]] && EPATCH_EXCLUDE+=" 65_all_binutils-*-amd64-32bit-path.patch"
|
| 148 |
if [[ -n ${PATCHVER} ]] ; then
|
| 149 |
EPATCH_SOURCE=${WORKDIR}/patch
|
| 150 |
if [[ ${CTARGET} == mips* ]] ; then
|
| 151 |
# remove gnu-hash for mips (bug #233233)
|
| 152 |
EPATCH_EXCLUDE+=" 77_all_generate-gnu-hash.patch"
|
| 153 |
fi
|
| 154 |
[[ -n $(ls "${EPATCH_SOURCE}"/*.bz2 2>/dev/null) ]] \
|
| 155 |
&& EPATCH_SUFFIX="patch.bz2" \
|
| 156 |
|| EPATCH_SUFFIX="patch"
|
| 157 |
epatch
|
| 158 |
fi
|
| 159 |
if [[ -n ${UCLIBC_PATCHVER} ]] ; then
|
| 160 |
EPATCH_SOURCE=${WORKDIR}/uclibc-patches
|
| 161 |
[[ -n $(ls "${EPATCH_SOURCE}"/*.bz2 2>/dev/null) ]] \
|
| 162 |
&& EPATCH_SUFFIX="patch.bz2" \
|
| 163 |
|| EPATCH_SUFFIX="patch"
|
| 164 |
EPATCH_MULTI_MSG="Applying uClibc fixes ..." \
|
| 165 |
epatch
|
| 166 |
elif [[ ${CTARGET} == *-uclibc* ]] ; then
|
| 167 |
# starting with binutils-2.17.50.0.17, we no longer need
|
| 168 |
# uClibc patchsets :D
|
| 169 |
if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
|
| 170 |
die "sorry, but this binutils doesn't yet support uClibc :("
|
| 171 |
fi
|
| 172 |
fi
|
| 173 |
[[ ${#PATCHES[@]} -gt 0 ]] && epatch "${PATCHES[@]}"
|
| 174 |
epatch_user
|
| 175 |
fi
|
| 176 |
|
| 177 |
# fix locale issues if possible #122216
|
| 178 |
if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
|
| 179 |
einfo "Fixing misc issues in configure files"
|
| 180 |
for f in $(grep -l 'autoconf version 2.13' $(find "${S}" -name configure)) ; do
|
| 181 |
ebegin " Updating ${f/${S}\/}"
|
| 182 |
patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
|
| 183 |
|| eerror "Please file a bug about this"
|
| 184 |
eend $?
|
| 185 |
done
|
| 186 |
fi
|
| 187 |
# fix conflicts with newer glibc #272594
|
| 188 |
if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
|
| 189 |
sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
|
| 190 |
fi
|
| 191 |
|
| 192 |
# Fix po Makefile generators
|
| 193 |
sed -i \
|
| 194 |
-e '/^datadir = /s:$(prefix)/@DATADIRNAME@:@datadir@:' \
|
| 195 |
-e '/^gnulocaledir = /s:$(prefix)/share:$(datadir):' \
|
| 196 |
*/po/Make-in || die "sed po's failed"
|
| 197 |
|
| 198 |
# Run misc portage update scripts
|
| 199 |
gnuconfig_update
|
| 200 |
elibtoolize --portage --no-uclibc
|
| 201 |
}
|
| 202 |
|
| 203 |
toolchain-binutils_src_unpack() {
|
| 204 |
tc-binutils_unpack
|
| 205 |
tc-binutils_apply_patches
|
| 206 |
}
|
| 207 |
|
| 208 |
toolchain-binutils_src_compile() {
|
| 209 |
# prevent makeinfo from running in releases. it may not always be
|
| 210 |
# installed, and older binutils may fail with newer texinfo.
|
| 211 |
# besides, we never patch the doc files anyways, so regenerating
|
| 212 |
# in the first place is useless. #193364
|
| 213 |
find . '(' -name '*.info' -o -name '*.texi' ')' -print0 | xargs -0 touch -r .
|
| 214 |
|
| 215 |
# make sure we filter $LINGUAS so that only ones that
|
| 216 |
# actually work make it through #42033
|
| 217 |
strip-linguas -u */po
|
| 218 |
|
| 219 |
# keep things sane
|
| 220 |
strip-flags
|
| 221 |
|
| 222 |
local x
|
| 223 |
echo
|
| 224 |
for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
|
| 225 |
einfo "$(printf '%10s' ${x}:) ${!x}"
|
| 226 |
done
|
| 227 |
echo
|
| 228 |
|
| 229 |
cd "${MY_BUILDDIR}"
|
| 230 |
local myconf=()
|
| 231 |
|
| 232 |
# enable gold if available (installed as ld.gold)
|
| 233 |
if use cxx ; then
|
| 234 |
if grep -q 'enable-gold=default' "${S}"/configure ; then
|
| 235 |
myconf+=( --enable-gold )
|
| 236 |
# old ways - remove when 2.21 is stable
|
| 237 |
elif grep -q 'enable-gold=both/ld' "${S}"/configure ; then
|
| 238 |
myconf+=( --enable-gold=both/ld )
|
| 239 |
elif grep -q 'enable-gold=both/bfd' "${S}"/configure ; then
|
| 240 |
myconf+=( --enable-gold=both/bfd )
|
| 241 |
fi
|
| 242 |
if grep -q -e '--enable-plugins' "${S}"/ld/configure ; then
|
| 243 |
myconf+=( --enable-plugins )
|
| 244 |
fi
|
| 245 |
fi
|
| 246 |
|
| 247 |
use nls \
|
| 248 |
&& myconf+=( --without-included-gettext ) \
|
| 249 |
|| myconf+=( --disable-nls )
|
| 250 |
|
| 251 |
if in_iuse zlib ; then
|
| 252 |
# older versions did not have an explicit configure flag
|
| 253 |
export ac_cv_search_zlibVersion=$(usex zlib -lz no)
|
| 254 |
myconf+=( $(use_with zlib) )
|
| 255 |
fi
|
| 256 |
|
| 257 |
use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
|
| 258 |
[[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
|
| 259 |
is_cross && myconf+=( --with-sysroot=/usr/${CTARGET} )
|
| 260 |
|
| 261 |
# glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
|
| 262 |
# on everyone in alpha (for now), we'll just enable it when possible
|
| 263 |
has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
|
| 264 |
has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
|
| 265 |
|
| 266 |
myconf+=(
|
| 267 |
--prefix=/usr
|
| 268 |
--host=${CHOST}
|
| 269 |
--target=${CTARGET}
|
| 270 |
--datadir=${DATAPATH}
|
| 271 |
--infodir=${DATAPATH}/info
|
| 272 |
--mandir=${DATAPATH}/man
|
| 273 |
--bindir=${BINPATH}
|
| 274 |
--libdir=${LIBPATH}
|
| 275 |
--libexecdir=${LIBPATH}
|
| 276 |
--includedir=${INCPATH}
|
| 277 |
--enable-obsolete
|
| 278 |
--enable-shared
|
| 279 |
--enable-threads
|
| 280 |
--disable-werror
|
| 281 |
--with-bugurl=http://bugs.gentoo.org/
|
| 282 |
$(use_enable static-libs static)
|
| 283 |
${EXTRA_ECONF}
|
| 284 |
)
|
| 285 |
echo ./configure "${myconf[@]}"
|
| 286 |
"${S}"/configure "${myconf[@]}" || die
|
| 287 |
|
| 288 |
emake all || die "emake failed"
|
| 289 |
|
| 290 |
# only build info pages if we user wants them, and if
|
| 291 |
# we have makeinfo (may not exist when we bootstrap)
|
| 292 |
if type -p makeinfo > /dev/null ; then
|
| 293 |
emake info || die "make info failed"
|
| 294 |
fi
|
| 295 |
# we nuke the manpages when we're left with junk
|
| 296 |
# (like when we bootstrap, no perl -> no manpages)
|
| 297 |
find . -name '*.1' -a -size 0 | xargs rm -f
|
| 298 |
|
| 299 |
# elf2flt only works on some arches / targets
|
| 300 |
if [[ -n ${ELF2FLT_VER} ]] && [[ ${CTARGET} == *linux* || ${CTARGET} == *-elf* ]] ; then
|
| 301 |
cd "${WORKDIR}"/elf2flt-${ELF2FLT_VER}
|
| 302 |
|
| 303 |
local x supported_arches=$(sed -n '/defined(TARGET_/{s:^.*TARGET_::;s:)::;p}' elf2flt.c | sort -u)
|
| 304 |
for x in ${supported_arches} UNSUPPORTED ; do
|
| 305 |
[[ ${CTARGET} == ${x}* ]] && break
|
| 306 |
done
|
| 307 |
|
| 308 |
if [[ ${x} != "UNSUPPORTED" ]] ; then
|
| 309 |
append-flags -I"${S}"/include
|
| 310 |
myconf+=(
|
| 311 |
--with-bfd-include-dir=${MY_BUILDDIR}/bfd
|
| 312 |
--with-libbfd=${MY_BUILDDIR}/bfd/libbfd.a
|
| 313 |
--with-libiberty=${MY_BUILDDIR}/libiberty/libiberty.a
|
| 314 |
--with-binutils-ldscript-dir=${LIBPATH}/ldscripts
|
| 315 |
)
|
| 316 |
echo ./configure "${myconf[@]}"
|
| 317 |
./configure "${myconf[@]}" || die
|
| 318 |
emake || die "make elf2flt failed"
|
| 319 |
fi
|
| 320 |
fi
|
| 321 |
}
|
| 322 |
|
| 323 |
toolchain-binutils_src_test() {
|
| 324 |
cd "${MY_BUILDDIR}"
|
| 325 |
emake -k check || die "check failed :("
|
| 326 |
}
|
| 327 |
|
| 328 |
toolchain-binutils_src_install() {
|
| 329 |
local x d
|
| 330 |
|
| 331 |
cd "${MY_BUILDDIR}"
|
| 332 |
emake DESTDIR="${D}" tooldir="${LIBPATH}" install || die
|
| 333 |
rm -rf "${D}"/${LIBPATH}/bin
|
| 334 |
use static-libs || find "${D}" -name '*.la' -delete
|
| 335 |
|
| 336 |
# Newer versions of binutils get fancy with ${LIBPATH} #171905
|
| 337 |
cd "${D}"/${LIBPATH}
|
| 338 |
for d in ../* ; do
|
| 339 |
[[ ${d} == ../${BVER} ]] && continue
|
| 340 |
mv ${d}/* . || die
|
| 341 |
rmdir ${d} || die
|
| 342 |
done
|
| 343 |
|
| 344 |
# Now we collect everything intp the proper SLOT-ed dirs
|
| 345 |
# When something is built to cross-compile, it installs into
|
| 346 |
# /usr/$CHOST/ by default ... we have to 'fix' that :)
|
| 347 |
if is_cross ; then
|
| 348 |
cd "${D}"/${BINPATH}
|
| 349 |
for x in * ; do
|
| 350 |
mv ${x} ${x/${CTARGET}-}
|
| 351 |
done
|
| 352 |
|
| 353 |
if [[ -d ${D}/usr/${CHOST}/${CTARGET} ]] ; then
|
| 354 |
mv "${D}"/usr/${CHOST}/${CTARGET}/include "${D}"/${INCPATH}
|
| 355 |
mv "${D}"/usr/${CHOST}/${CTARGET}/lib/* "${D}"/${LIBPATH}/
|
| 356 |
rm -r "${D}"/usr/${CHOST}/{include,lib}
|
| 357 |
fi
|
| 358 |
fi
|
| 359 |
insinto ${INCPATH}
|
| 360 |
local libiberty_headers=(
|
| 361 |
# Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
|
| 362 |
demangle.h
|
| 363 |
dyn-string.h
|
| 364 |
fibheap.h
|
| 365 |
hashtab.h
|
| 366 |
libiberty.h
|
| 367 |
objalloc.h
|
| 368 |
splay-tree.h
|
| 369 |
)
|
| 370 |
doins "${libiberty_headers[@]/#/${S}/include/}" || die
|
| 371 |
if [[ -d ${D}/${LIBPATH}/lib ]] ; then
|
| 372 |
mv "${D}"/${LIBPATH}/lib/* "${D}"/${LIBPATH}/
|
| 373 |
rm -r "${D}"/${LIBPATH}/lib
|
| 374 |
fi
|
| 375 |
|
| 376 |
# Insert elf2flt where appropriate
|
| 377 |
if [[ -x ${WORKDIR}/elf2flt-${ELF2FLT_VER}/elf2flt ]] ; then
|
| 378 |
cd "${WORKDIR}"/elf2flt-${ELF2FLT_VER}
|
| 379 |
insinto ${LIBPATH}/ldscripts
|
| 380 |
doins elf2flt.ld || die "doins elf2flt.ld failed"
|
| 381 |
exeinto ${BINPATH}
|
| 382 |
doexe elf2flt flthdr || die "doexe elf2flt flthdr failed"
|
| 383 |
mv "${D}"/${BINPATH}/{ld,ld.real} || die
|
| 384 |
newexe ld-elf2flt ld || die "doexe ld-elf2flt failed"
|
| 385 |
newdoc README README.elf2flt
|
| 386 |
fi
|
| 387 |
|
| 388 |
# Now, some binutils are tricky and actually provide
|
| 389 |
# for multiple TARGETS. Really, we're talking just
|
| 390 |
# 32bit/64bit support (like mips/ppc/sparc). Here
|
| 391 |
# we want to tell binutils-config that it's cool if
|
| 392 |
# it generates multiple sets of binutil symlinks.
|
| 393 |
# e.g. sparc gets {sparc,sparc64}-unknown-linux-gnu
|
| 394 |
local targ=${CTARGET/-*} src="" dst=""
|
| 395 |
local FAKE_TARGETS=${CTARGET}
|
| 396 |
case ${targ} in
|
| 397 |
mips*) src="mips" dst="mips64";;
|
| 398 |
powerpc*) src="powerpc" dst="powerpc64";;
|
| 399 |
s390*) src="s390" dst="s390x";;
|
| 400 |
sparc*) src="sparc" dst="sparc64";;
|
| 401 |
esac
|
| 402 |
case ${targ} in
|
| 403 |
mips64*|powerpc64*|s390x*|sparc64*) targ=${src} src=${dst} dst=${targ};;
|
| 404 |
esac
|
| 405 |
[[ -n ${src}${dst} ]] && FAKE_TARGETS="${FAKE_TARGETS} ${CTARGET/${src}/${dst}}"
|
| 406 |
|
| 407 |
# Generate an env.d entry for this binutils
|
| 408 |
cd "${S}"
|
| 409 |
insinto /etc/env.d/binutils
|
| 410 |
cat <<-EOF > env.d
|
| 411 |
TARGET="${CTARGET}"
|
| 412 |
VER="${BVER}"
|
| 413 |
LIBPATH="${LIBPATH}"
|
| 414 |
FAKE_TARGETS="${FAKE_TARGETS}"
|
| 415 |
EOF
|
| 416 |
newins env.d ${CTARGET}-${BVER}
|
| 417 |
|
| 418 |
# Handle documentation
|
| 419 |
if ! is_cross ; then
|
| 420 |
cd "${S}"
|
| 421 |
dodoc README
|
| 422 |
docinto bfd
|
| 423 |
dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
|
| 424 |
docinto binutils
|
| 425 |
dodoc binutils/ChangeLog binutils/NEWS binutils/README
|
| 426 |
docinto gas
|
| 427 |
dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
|
| 428 |
docinto gprof
|
| 429 |
dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
|
| 430 |
docinto ld
|
| 431 |
dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
|
| 432 |
docinto libiberty
|
| 433 |
dodoc libiberty/ChangeLog* libiberty/README
|
| 434 |
docinto opcodes
|
| 435 |
dodoc opcodes/ChangeLog*
|
| 436 |
fi
|
| 437 |
# Remove shared info pages
|
| 438 |
rm -f "${D}"/${DATAPATH}/info/{dir,configure.info,standards.info}
|
| 439 |
# Trim all empty dirs
|
| 440 |
find "${D}" -type d | xargs rmdir >& /dev/null
|
| 441 |
}
|
| 442 |
|
| 443 |
toolchain-binutils_pkg_postinst() {
|
| 444 |
# Make sure this ${CTARGET} has a binutils version selected
|
| 445 |
[[ -e ${ROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
|
| 446 |
binutils-config ${CTARGET}-${BVER}
|
| 447 |
}
|
| 448 |
|
| 449 |
toolchain-binutils_pkg_postrm() {
|
| 450 |
local current_profile=$(binutils-config -c ${CTARGET})
|
| 451 |
|
| 452 |
# If no other versions exist, then uninstall for this
|
| 453 |
# target ... otherwise, switch to the newest version
|
| 454 |
# Note: only do this if this version is unmerged. We
|
| 455 |
# rerun binutils-config if this is a remerge, as
|
| 456 |
# we want the mtimes on the symlinks updated (if
|
| 457 |
# it is the same as the current selected profile)
|
| 458 |
if [[ ! -e ${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then
|
| 459 |
local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
|
| 460 |
choice=${choice//$'\n'/ }
|
| 461 |
choice=${choice/* }
|
| 462 |
if [[ -z ${choice} ]] ; then
|
| 463 |
env -i ROOT="${ROOT}" binutils-config -u ${CTARGET}
|
| 464 |
else
|
| 465 |
binutils-config ${choice}
|
| 466 |
fi
|
| 467 |
elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${BVER} ]] ; then
|
| 468 |
binutils-config ${CTARGET}-${BVER}
|
| 469 |
fi
|
| 470 |
}
|