1 |
commit: f0a55611c0ed6a9d77ee58d3f07b6018b2838f6a |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 30 21:43:09 2020 +0000 |
4 |
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 30 21:45:24 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0a55611 |
7 |
|
8 |
sys-devel/binutils-hppa64: 2.35.1 patchset bump |
9 |
|
10 |
Package-Manager: Portage-3.0.8, Repoman-3.0.2 |
11 |
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org> |
12 |
|
13 |
sys-devel/binutils-hppa64/Manifest | 1 + |
14 |
.../binutils-hppa64-2.35.1-r1.ebuild | 430 +++++++++++++++++++++ |
15 |
2 files changed, 431 insertions(+) |
16 |
|
17 |
diff --git a/sys-devel/binutils-hppa64/Manifest b/sys-devel/binutils-hppa64/Manifest |
18 |
index 089a85714e6..3a92df3667a 100644 |
19 |
--- a/sys-devel/binutils-hppa64/Manifest |
20 |
+++ b/sys-devel/binutils-hppa64/Manifest |
21 |
@@ -5,4 +5,5 @@ DIST binutils-2.33.1.tar.xz 21490848 BLAKE2B c336a8412938dc8c224f40a763a8bea9937 |
22 |
DIST binutils-2.34-patches-6.tar.xz 103028 BLAKE2B d0e866d0941d2b550c7d7f23530c6ee393fa13b4f2f27832f07790989476f11d1beddb5ad5a9be5c65c1d4dff9d4598d21adcb00c1d0490f69a99127f4527447 SHA512 e05ed8886acb5cb95a3e97c5bc0564215f7d44b604610f5c4545997fd9625d6de909c37063127e819926cd1548a48d3529dd3e82e98ee6a5dbaced028c57355d |
23 |
DIST binutils-2.34.tar.xz 21637796 BLAKE2B 07dd23916a7d27f71c3f160c8c16abe2bd4fce294c738c665a012a3be6a87dbe8160d0c38740524f9025e01d438e99b2a94bcf9f9f79ee214f5dd033de8aad3d SHA512 2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd |
24 |
DIST binutils-2.35.1-patches-1.tar.xz 10088 BLAKE2B fa4b0c417b6452757f90243921c60b2406c9bf60d1aaa393654fb23ce52e32fb3e7ed90f6d59286786dd95398a10d008c75bfdca065d704025cc828ff65b225f SHA512 dccb4407f4f2a8b38488f9f42638c10777ee344239cf5d4fcc8f580df3e8ff15d03211dc51ef18d905c326a71771da4b38f47381d6d549422a8353b5da0e7b0b |
25 |
+DIST binutils-2.35.1-patches-2.tar.xz 72236 BLAKE2B 584cb3edbda28c69171ed64e941535f992150d86f25201cadd07b63daaa36bf76b07dc0aa8a4837da17d1672feb47a7b15f83efdeec5409e695965a10142147a SHA512 b704ebe82c4402f058f9c96991a89256a6b369d28f844bf020ed2c77766894d9a2ca0596cd609de7b389fa8cd52bfab674b6deb10ea2096e50aa57921be2083e |
26 |
DIST binutils-2.35.1.tar.xz 22031720 BLAKE2B d3468da90b75e9b5fa7fbd64d3fdb0a4bc445e4cb7da5ae058f73a1e9d948b3e9438bc9f1b5b351db369b76a25960c9c1f58f828fd2c7646f555de45fa3c052b SHA512 94ff72708403413b70b247f3af4099ebaa882b6659249869f1ed9941a0f1912e313f08357d470f9fd2359e7f5e5b0eb86285e5eaf883fa8187789d6b1bd304eb |
27 |
|
28 |
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.35.1-r1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.35.1-r1.ebuild |
29 |
new file mode 100644 |
30 |
index 00000000000..d277e1a234b |
31 |
--- /dev/null |
32 |
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.35.1-r1.ebuild |
33 |
@@ -0,0 +1,430 @@ |
34 |
+# Copyright 1999-2020 Gentoo Authors |
35 |
+# Distributed under the terms of the GNU General Public License v2 |
36 |
+ |
37 |
+EAPI=7 |
38 |
+ |
39 |
+export CTARGET=hppa64-${CHOST#*-} |
40 |
+ |
41 |
+inherit eutils libtool flag-o-matic gnuconfig multilib toolchain-funcs |
42 |
+ |
43 |
+DESCRIPTION="Tools necessary to build programs" |
44 |
+HOMEPAGE="https://sourceware.org/binutils/" |
45 |
+LICENSE="GPL-3+" |
46 |
+IUSE="default-gold doc +gold multitarget +nls +plugins static-libs test" |
47 |
+REQUIRED_USE="default-gold? ( gold )" |
48 |
+ |
49 |
+# Variables that can be set here: |
50 |
+# PATCH_VER - the patchset version |
51 |
+# Default: empty, no patching |
52 |
+# PATCH_BINUTILS_VER - the binutils version in the patchset name |
53 |
+# - Default: PV |
54 |
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/... |
55 |
+# for the patchsets |
56 |
+ |
57 |
+PATCH_VER=2 |
58 |
+PATCH_DEV=dilfridge |
59 |
+ |
60 |
+case ${PV} in |
61 |
+ 9999) |
62 |
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git" |
63 |
+ inherit git-r3 |
64 |
+ S=${WORKDIR}/binutils |
65 |
+ EGIT_CHECKOUT_DIR=${S} |
66 |
+ SLOT=${PV} |
67 |
+ ;; |
68 |
+ *) |
69 |
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz" |
70 |
+ SLOT=$(ver_cut 1-2) |
71 |
+ # KEYWORDS="-* ~hppa" |
72 |
+ ;; |
73 |
+esac |
74 |
+ |
75 |
+# |
76 |
+# The Gentoo patchset |
77 |
+# |
78 |
+PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}} |
79 |
+PATCH_DEV=${PATCH_DEV:-slyfox} |
80 |
+ |
81 |
+[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI} |
82 |
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz" |
83 |
+ |
84 |
+# |
85 |
+# The cross-compile logic |
86 |
+# |
87 |
+export CTARGET=${CTARGET:-${CHOST}} |
88 |
+if [[ ${CTARGET} == ${CHOST} ]] ; then |
89 |
+ if [[ ${CATEGORY} == cross-* ]] ; then |
90 |
+ export CTARGET=${CATEGORY#cross-} |
91 |
+ fi |
92 |
+fi |
93 |
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } |
94 |
+ |
95 |
+# |
96 |
+# The dependencies |
97 |
+# |
98 |
+RDEPEND=" |
99 |
+ >=sys-devel/binutils-config-3 |
100 |
+ sys-libs/zlib |
101 |
+" |
102 |
+DEPEND="${RDEPEND}" |
103 |
+BDEPEND=" |
104 |
+ doc? ( sys-apps/texinfo ) |
105 |
+ test? ( dev-util/dejagnu ) |
106 |
+ nls? ( sys-devel/gettext ) |
107 |
+ sys-devel/flex |
108 |
+ virtual/yacc |
109 |
+" |
110 |
+ |
111 |
+RESTRICT="!test? ( test )" |
112 |
+ |
113 |
+MY_BUILDDIR=${WORKDIR}/build |
114 |
+S=${WORKDIR}/${P/-hppa64/} |
115 |
+ |
116 |
+src_unpack() { |
117 |
+ case ${PV} in |
118 |
+ *9999) |
119 |
+ git-r3_src_unpack |
120 |
+ ;; |
121 |
+ *) |
122 |
+ ;; |
123 |
+ esac |
124 |
+ default |
125 |
+ mkdir -p "${MY_BUILDDIR}" |
126 |
+} |
127 |
+ |
128 |
+src_prepare() { |
129 |
+ if [[ ! -z ${PATCH_VER} ]] ; then |
130 |
+ einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}" |
131 |
+ eapply "${WORKDIR}/patch"/*.patch |
132 |
+ fi |
133 |
+ |
134 |
+ # This check should probably go somewhere else, like pkg_pretend. |
135 |
+ if [[ ${CTARGET} == *-uclibc* ]] ; then |
136 |
+ if grep -qs 'linux-gnu' "${S}"/ltconfig ; then |
137 |
+ die "sorry, but this binutils doesn't yet support uClibc :(" |
138 |
+ fi |
139 |
+ fi |
140 |
+ |
141 |
+ # Make sure our explicit libdir paths don't get clobbered. #562460 |
142 |
+ sed -i \ |
143 |
+ -e 's:@bfdlibdir@:@libdir@:g' \ |
144 |
+ -e 's:@bfdincludedir@:@includedir@:g' \ |
145 |
+ {bfd,opcodes}/Makefile.in || die |
146 |
+ |
147 |
+ # Fix locale issues if possible #122216 |
148 |
+ if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then |
149 |
+ einfo "Fixing misc issues in configure files" |
150 |
+ for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do |
151 |
+ ebegin " Updating ${f/${S}\/}" |
152 |
+ patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \ |
153 |
+ || eerror "Please file a bug about this" |
154 |
+ eend $? |
155 |
+ done |
156 |
+ fi |
157 |
+ |
158 |
+ # Fix conflicts with newer glibc #272594 |
159 |
+ if [[ -e libiberty/testsuite/test-demangle.c ]] ; then |
160 |
+ sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c |
161 |
+ fi |
162 |
+ |
163 |
+ # Apply things from PATCHES and user dirs |
164 |
+ default |
165 |
+ |
166 |
+ # Run misc portage update scripts |
167 |
+ gnuconfig_update |
168 |
+ elibtoolize --portage --no-uclibc |
169 |
+} |
170 |
+ |
171 |
+toolchain-binutils_bugurl() { |
172 |
+ printf "https://bugs.gentoo.org/" |
173 |
+} |
174 |
+toolchain-binutils_pkgversion() { |
175 |
+ printf "Gentoo ${PV}" |
176 |
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}" |
177 |
+} |
178 |
+ |
179 |
+src_configure() { |
180 |
+ # Setup some paths |
181 |
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV} |
182 |
+ INCPATH=${LIBPATH}/include |
183 |
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV} |
184 |
+ if is_cross ; then |
185 |
+ TOOLPATH=/usr/${CHOST}/${CTARGET} |
186 |
+ else |
187 |
+ TOOLPATH=/usr/${CTARGET} |
188 |
+ fi |
189 |
+ BINPATH=${TOOLPATH}/binutils-bin/${PV} |
190 |
+ |
191 |
+ # Make sure we filter $LINGUAS so that only ones that |
192 |
+ # actually work make it through #42033 |
193 |
+ strip-linguas -u */po |
194 |
+ |
195 |
+ # Keep things sane |
196 |
+ strip-flags |
197 |
+ |
198 |
+ local x |
199 |
+ echo |
200 |
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do |
201 |
+ einfo "$(printf '%10s' ${x}:) ${!x}" |
202 |
+ done |
203 |
+ echo |
204 |
+ |
205 |
+ cd "${MY_BUILDDIR}" |
206 |
+ local myconf=() |
207 |
+ |
208 |
+ if use plugins ; then |
209 |
+ myconf+=( --enable-plugins ) |
210 |
+ fi |
211 |
+ # enable gold (installed as ld.gold) and ld's plugin architecture |
212 |
+ if use gold ; then |
213 |
+ myconf+=( --enable-gold ) |
214 |
+ if use default-gold; then |
215 |
+ myconf+=( --enable-gold=default ) |
216 |
+ fi |
217 |
+ fi |
218 |
+ |
219 |
+ if use nls ; then |
220 |
+ myconf+=( --without-included-gettext ) |
221 |
+ else |
222 |
+ myconf+=( --disable-nls ) |
223 |
+ fi |
224 |
+ |
225 |
+ myconf+=( --with-system-zlib ) |
226 |
+ |
227 |
+ # For bi-arch systems, enable a 64bit bfd. This matches |
228 |
+ # the bi-arch logic in toolchain.eclass. #446946 |
229 |
+ # We used to do it for everyone, but it's slow on 32bit arches. #438522 |
230 |
+ case $(tc-arch) in |
231 |
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;; |
232 |
+ esac |
233 |
+ |
234 |
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd ) |
235 |
+ |
236 |
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} ) |
237 |
+ |
238 |
+ is_cross && myconf+=( |
239 |
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET} |
240 |
+ --enable-poison-system-directories |
241 |
+ ) |
242 |
+ |
243 |
+ # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+ |
244 |
+ # on everyone in alpha (for now), we'll just enable it when possible |
245 |
+ has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt ) |
246 |
+ has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt ) |
247 |
+ |
248 |
+ # mips can't do hash-style=gnu ... |
249 |
+ if [[ $(tc-arch) != mips ]] ; then |
250 |
+ myconf+=( --enable-default-hash-style=gnu ) |
251 |
+ fi |
252 |
+ |
253 |
+ myconf+=( |
254 |
+ --prefix="${EPREFIX}"/usr |
255 |
+ --host=${CHOST} |
256 |
+ --target=${CTARGET} |
257 |
+ --datadir="${EPREFIX}"${DATAPATH} |
258 |
+ --datarootdir="${EPREFIX}"${DATAPATH} |
259 |
+ --infodir="${EPREFIX}"${DATAPATH}/info |
260 |
+ --mandir="${EPREFIX}"${DATAPATH}/man |
261 |
+ --bindir="${EPREFIX}"${BINPATH} |
262 |
+ --libdir="${EPREFIX}"${LIBPATH} |
263 |
+ --libexecdir="${EPREFIX}"${LIBPATH} |
264 |
+ --includedir="${EPREFIX}"${INCPATH} |
265 |
+ --enable-obsolete |
266 |
+ --enable-shared |
267 |
+ --enable-threads |
268 |
+ # Newer versions (>=2.27) offer a configure flag now. |
269 |
+ --enable-relro |
270 |
+ # Newer versions (>=2.24) make this an explicit option. #497268 |
271 |
+ --enable-install-libiberty |
272 |
+ --disable-werror |
273 |
+ --with-bugurl="$(toolchain-binutils_bugurl)" |
274 |
+ --with-pkgversion="$(toolchain-binutils_pkgversion)" |
275 |
+ $(use_enable static-libs static) |
276 |
+ ${EXTRA_ECONF} |
277 |
+ # Disable modules that are in a combined binutils/gdb tree. #490566 |
278 |
+ --disable-{gdb,libdecnumber,readline,sim} |
279 |
+ # Strip out broken static link flags. |
280 |
+ # https://gcc.gnu.org/PR56750 |
281 |
+ --without-stage1-ldflags |
282 |
+ # Change SONAME to avoid conflict across |
283 |
+ # {native,cross}/binutils, binutils-libs. #666100 |
284 |
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st) |
285 |
+ ) |
286 |
+ echo ./configure "${myconf[@]}" |
287 |
+ "${S}"/configure "${myconf[@]}" || die |
288 |
+ |
289 |
+ # Prevent makeinfo from running if doc is unset. |
290 |
+ if ! use doc ; then |
291 |
+ sed -i \ |
292 |
+ -e '/^MAKEINFO/s:=.*:= true:' \ |
293 |
+ Makefile || die |
294 |
+ fi |
295 |
+} |
296 |
+ |
297 |
+src_compile() { |
298 |
+ cd "${MY_BUILDDIR}" |
299 |
+ # see Note [tooldir hack for ldscripts] |
300 |
+ emake tooldir="${EPREFIX}${TOOLPATH}" all |
301 |
+ |
302 |
+ # only build info pages if the user wants them |
303 |
+ if use doc ; then |
304 |
+ emake info |
305 |
+ fi |
306 |
+ |
307 |
+ # we nuke the manpages when we're left with junk |
308 |
+ # (like when we bootstrap, no perl -> no manpages) |
309 |
+ find . -name '*.1' -a -size 0 -delete |
310 |
+} |
311 |
+ |
312 |
+src_test() { |
313 |
+ cd "${MY_BUILDDIR}" |
314 |
+ # bug 637066 |
315 |
+ filter-flags -Wall -Wreturn-type |
316 |
+ emake -k check |
317 |
+} |
318 |
+ |
319 |
+src_install() { |
320 |
+ local x d |
321 |
+ |
322 |
+ cd "${MY_BUILDDIR}" |
323 |
+ # see Note [tooldir hack for ldscripts] |
324 |
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install |
325 |
+ rm -rf "${ED}"/${LIBPATH}/bin |
326 |
+ use static-libs || find "${ED}" -name '*.la' -delete |
327 |
+ |
328 |
+ # Newer versions of binutils get fancy with ${LIBPATH} #171905 |
329 |
+ cd "${ED}"/${LIBPATH} |
330 |
+ for d in ../* ; do |
331 |
+ [[ ${d} == ../${PV} ]] && continue |
332 |
+ mv ${d}/* . || die |
333 |
+ rmdir ${d} || die |
334 |
+ done |
335 |
+ |
336 |
+ # Now we collect everything intp the proper SLOT-ed dirs |
337 |
+ # When something is built to cross-compile, it installs into |
338 |
+ # /usr/$CHOST/ by default ... we have to 'fix' that :) |
339 |
+ if is_cross ; then |
340 |
+ cd "${ED}"/${BINPATH} |
341 |
+ for x in * ; do |
342 |
+ mv ${x} ${x/${CTARGET}-} |
343 |
+ done |
344 |
+ |
345 |
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then |
346 |
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH} |
347 |
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/ |
348 |
+ rm -r "${ED}"/usr/${CHOST}/{include,lib} |
349 |
+ fi |
350 |
+ fi |
351 |
+ insinto ${INCPATH} |
352 |
+ local libiberty_headers=( |
353 |
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir. |
354 |
+ demangle.h |
355 |
+ dyn-string.h |
356 |
+ fibheap.h |
357 |
+ hashtab.h |
358 |
+ libiberty.h |
359 |
+ objalloc.h |
360 |
+ splay-tree.h |
361 |
+ ) |
362 |
+ doins "${libiberty_headers[@]/#/${S}/include/}" |
363 |
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then |
364 |
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ |
365 |
+ rm -r "${ED}"/${LIBPATH}/lib |
366 |
+ fi |
367 |
+ |
368 |
+ # Generate an env.d entry for this binutils |
369 |
+ insinto /etc/env.d/binutils |
370 |
+ cat <<-EOF > "${T}"/env.d |
371 |
+ TARGET="${CTARGET}" |
372 |
+ VER="${PV}" |
373 |
+ LIBPATH="${EPREFIX}${LIBPATH}" |
374 |
+ EOF |
375 |
+ newins "${T}"/env.d ${CTARGET}-${PV} |
376 |
+ |
377 |
+ # Handle documentation |
378 |
+ if ! is_cross ; then |
379 |
+ cd "${S}" |
380 |
+ dodoc README |
381 |
+ docinto bfd |
382 |
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO |
383 |
+ docinto binutils |
384 |
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README |
385 |
+ docinto gas |
386 |
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README* |
387 |
+ docinto gprof |
388 |
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl |
389 |
+ docinto ld |
390 |
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO |
391 |
+ docinto libiberty |
392 |
+ dodoc libiberty/ChangeLog* libiberty/README |
393 |
+ docinto opcodes |
394 |
+ dodoc opcodes/ChangeLog* |
395 |
+ fi |
396 |
+ |
397 |
+ # Remove shared info pages |
398 |
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info} |
399 |
+ |
400 |
+ # Trim all empty dirs |
401 |
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null |
402 |
+ |
403 |
+ # the hppa64 hack; this should go into 9999 as a PN-conditional |
404 |
+ # tweak the default fake list a little bit |
405 |
+ cd "${D}"/etc/env.d/binutils |
406 |
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die |
407 |
+} |
408 |
+ |
409 |
+pkg_postinst() { |
410 |
+ # Make sure this ${CTARGET} has a binutils version selected |
411 |
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0 |
412 |
+ binutils-config ${CTARGET}-${PV} |
413 |
+} |
414 |
+ |
415 |
+pkg_postrm() { |
416 |
+ local current_profile=$(binutils-config -c ${CTARGET}) |
417 |
+ |
418 |
+ # If no other versions exist, then uninstall for this |
419 |
+ # target ... otherwise, switch to the newest version |
420 |
+ # Note: only do this if this version is unmerged. We |
421 |
+ # rerun binutils-config if this is a remerge, as |
422 |
+ # we want the mtimes on the symlinks updated (if |
423 |
+ # it is the same as the current selected profile) |
424 |
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then |
425 |
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}') |
426 |
+ choice=${choice//$'\n'/ } |
427 |
+ choice=${choice/* } |
428 |
+ if [[ -z ${choice} ]] ; then |
429 |
+ binutils-config -u ${CTARGET} |
430 |
+ else |
431 |
+ binutils-config ${choice} |
432 |
+ fi |
433 |
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then |
434 |
+ binutils-config ${CTARGET}-${PV} |
435 |
+ fi |
436 |
+} |
437 |
+# Note [slotting support] |
438 |
+# ----------------------- |
439 |
+# Gentoo's layout for binutils files is non-standard as Gentoo |
440 |
+# supports slotted installation for binutils. Many tools |
441 |
+# still expect binutils to reside in known locations. |
442 |
+# binutils-config package restores symlinks into known locations, |
443 |
+# like: |
444 |
+# /usr/bin/${CTARGET}-<tool> |
445 |
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips |
446 |
+# /usr/include/ |
447 |
+# |
448 |
+# Note [tooldir hack for ldscripts] |
449 |
+# --------------------------------- |
450 |
+# Build system does not allow ./configure to tweak every location |
451 |
+# we need for slotting binutils hence all the shuffling in |
452 |
+# src_install(). This note is about SCRIPTDIR define handling. |
453 |
+# |
454 |
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value |
455 |
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib' |
456 |
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time. |
457 |
+# Thus we can't just move files around after compilation finished. |
458 |
+# |
459 |
+# Our goal is the following: |
460 |
+# - at build-time set scriptdir to point to symlinked location: |
461 |
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case) |
462 |
+# - at install-time set scriptdir to point to slotted location: |
463 |
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV} |