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