Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 478434 | Differences between
and this patch

Collapse All | Expand All

(-)tauon.orig/toolchain-binutils.eclass (-28 / +28 lines)
Lines 264-268 Link Here
264
	[[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
266
	[[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
265
	is_cross && myconf+=( --with-sysroot=/usr/${CTARGET} )
267
	is_cross && myconf+=( --with-sysroot="${EPREFIX}"/usr/${CTARGET} )
266
268
267
	# glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
269
	# glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
268
	# on everyone in alpha (for now), we'll just enable it when possible
270
	# on everyone in alpha (for now), we'll just enable it when possible
Lines 270-285 Link Here
270
	has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
272
	has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
271
273
272
	myconf+=(
274
	myconf+=(
273
		--prefix=/usr
275
		--prefix="${EPREFIX}"/usr
274
		--host=${CHOST}
276
		--host=${CHOST}
275
		--target=${CTARGET}
277
		--target=${CTARGET}
276
		--datadir=${DATAPATH}
278
		--datadir="${EPREFIX}"${DATAPATH}
277
		--infodir=${DATAPATH}/info
279
		--infodir="${EPREFIX}"${DATAPATH}/info
278
		--mandir=${DATAPATH}/man
280
		--mandir="${EPREFIX}"${DATAPATH}/man
279
		--bindir=${BINPATH}
281
		--bindir="${EPREFIX}"${BINPATH}
280
		--libdir=${LIBPATH}
282
		--libdir="${EPREFIX}"${LIBPATH}
281
		--libexecdir=${LIBPATH}
283
		--libexecdir="${EPREFIX}"${LIBPATH}
282
		--includedir=${INCPATH}
284
		--includedir="${EPREFIX}"${INCPATH}
283
		--enable-obsolete
285
		--enable-obsolete
284
		--enable-shared
286
		--enable-shared
285
		--enable-threads
287
		--enable-threads
Lines 317-323 Link Here
317
				--with-bfd-include-dir=${MY_BUILDDIR}/bfd
319
				--with-bfd-include-dir=${MY_BUILDDIR}/bfd
318
				--with-libbfd=${MY_BUILDDIR}/bfd/libbfd.a
320
				--with-libbfd=${MY_BUILDDIR}/bfd/libbfd.a
319
				--with-libiberty=${MY_BUILDDIR}/libiberty/libiberty.a
321
				--with-libiberty=${MY_BUILDDIR}/libiberty/libiberty.a
320
				--with-binutils-ldscript-dir=${LIBPATH}/ldscripts
322
				--with-binutils-ldscript-dir="${EPREFIX}"${LIBPATH}/ldscripts
321
			)
323
			)
322
			echo ./configure "${myconf[@]}"
324
			echo ./configure "${myconf[@]}"
323
			./configure "${myconf[@]}" || die
325
			./configure "${myconf[@]}" || die
Lines 335-346 Link Here
335
	local x d
337
	local x d
336
338
337
	cd "${MY_BUILDDIR}"
339
	cd "${MY_BUILDDIR}"
338
	emake DESTDIR="${D}" tooldir="${LIBPATH}" install || die
340
	emake DESTDIR="${D}" tooldir="${EPREFIX}/${LIBPATH}" install || die
339
	rm -rf "${D}"/${LIBPATH}/bin
341
	rm -rf "${ED}"/${LIBPATH}/bin
340
	use static-libs || find "${D}" -name '*.la' -delete
342
	use static-libs || find "${ED}" -name '*.la' -delete
341
343
342
	# Newer versions of binutils get fancy with ${LIBPATH} #171905
344
	# Newer versions of binutils get fancy with ${LIBPATH} #171905
343
	cd "${D}"/${LIBPATH}
345
	cd "${ED}"/${LIBPATH}
344
	for d in ../* ; do
346
	for d in ../* ; do
345
		[[ ${d} == ../${BVER} ]] && continue
347
		[[ ${d} == ../${BVER} ]] && continue
346
		mv ${d}/* . || die
348
		mv ${d}/* . || die
Lines 351-365 Link Here
351
	# When something is built to cross-compile, it installs into
353
	# When something is built to cross-compile, it installs into
352
	# /usr/$CHOST/ by default ... we have to 'fix' that :)
354
	# /usr/$CHOST/ by default ... we have to 'fix' that :)
353
	if is_cross ; then
355
	if is_cross ; then
354
		cd "${D}"/${BINPATH}
356
		cd "${ED}"/${BINPATH}
355
		for x in * ; do
357
		for x in * ; do
356
			mv ${x} ${x/${CTARGET}-}
358
			mv ${x} ${x/${CTARGET}-}
357
		done
359
		done
358
360
359
		if [[ -d ${D}/usr/${CHOST}/${CTARGET} ]] ; then
361
		if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
360
			mv "${D}"/usr/${CHOST}/${CTARGET}/include "${D}"/${INCPATH}
362
			mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
361
			mv "${D}"/usr/${CHOST}/${CTARGET}/lib/* "${D}"/${LIBPATH}/
363
			mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
362
			rm -r "${D}"/usr/${CHOST}/{include,lib}
364
			rm -r "${ED}"/usr/${CHOST}/{include,lib}
363
		fi
365
		fi
364
	fi
366
	fi
365
	insinto ${INCPATH}
367
	insinto ${INCPATH}
Lines 374-382 Link Here
374
		splay-tree.h
376
		splay-tree.h
375
	)
377
	)
376
	doins "${libiberty_headers[@]/#/${S}/include/}" || die
378
	doins "${libiberty_headers[@]/#/${S}/include/}" || die
377
	if [[ -d ${D}/${LIBPATH}/lib ]] ; then
379
	if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
378
		mv "${D}"/${LIBPATH}/lib/* "${D}"/${LIBPATH}/
380
		mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
379
		rm -r "${D}"/${LIBPATH}/lib
381
		rm -r "${ED}"/${LIBPATH}/lib
380
	fi
382
	fi
381
383
382
	# Insert elf2flt where appropriate
384
	# Insert elf2flt where appropriate
Lines 386-392 Link Here
386
		doins elf2flt.ld || die "doins elf2flt.ld failed"
388
		doins elf2flt.ld || die "doins elf2flt.ld failed"
387
		exeinto ${BINPATH}
389
		exeinto ${BINPATH}
388
		doexe elf2flt flthdr || die "doexe elf2flt flthdr failed"
390
		doexe elf2flt flthdr || die "doexe elf2flt flthdr failed"
389
		mv "${D}"/${BINPATH}/{ld,ld.real} || die
391
		mv "${ED}"/${BINPATH}/{ld,ld.real} || die
390
		newexe ld-elf2flt ld || die "doexe ld-elf2flt failed"
392
		newexe ld-elf2flt ld || die "doexe ld-elf2flt failed"
391
		newdoc README README.elf2flt
393
		newdoc README README.elf2flt
392
	fi
394
	fi
Lines 416-422 Link Here
416
	cat <<-EOF > env.d
418
	cat <<-EOF > env.d
417
		TARGET="${CTARGET}"
419
		TARGET="${CTARGET}"
418
		VER="${BVER}"
420
		VER="${BVER}"
419
		LIBPATH="${LIBPATH}"
421
		LIBPATH="${EPREFIX}/${LIBPATH}"
420
		FAKE_TARGETS="${FAKE_TARGETS}"
422
		FAKE_TARGETS="${FAKE_TARGETS}"
421
	EOF
423
	EOF
422
	newins env.d ${CTARGET}-${BVER}
424
	newins env.d ${CTARGET}-${BVER}
Lines 441-454 Link Here
441
		dodoc opcodes/ChangeLog*
443
		dodoc opcodes/ChangeLog*
442
	fi
444
	fi
443
	# Remove shared info pages
445
	# Remove shared info pages
444
	rm -f "${D}"/${DATAPATH}/info/{dir,configure.info,standards.info}
446
	rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
445
	# Trim all empty dirs
447
	# Trim all empty dirs
446
	find "${D}" -type d | xargs rmdir >& /dev/null
448
	find "${ED}" -type d | xargs rmdir >& /dev/null
447
}
449
}
448
450
449
toolchain-binutils_pkg_postinst() {
451
toolchain-binutils_pkg_postinst() {
450
	# Make sure this ${CTARGET} has a binutils version selected
452
	# Make sure this ${CTARGET} has a binutils version selected
451
	[[ -e ${ROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
453
	[[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
452
	binutils-config ${CTARGET}-${BVER}
454
	binutils-config ${CTARGET}-${BVER}
453
}
455
}
454
456
Lines 461-467 Link Here
461
	#       rerun binutils-config if this is a remerge, as
463
	#       rerun binutils-config if this is a remerge, as
462
	#       we want the mtimes on the symlinks updated (if
464
	#       we want the mtimes on the symlinks updated (if
463
	#       it is the same as the current selected profile)
465
	#       it is the same as the current selected profile)
464
	if [[ ! -e ${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then
466
	if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then
465
		local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
467
		local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
466
		choice=${choice//$'\n'/ }
468
		choice=${choice//$'\n'/ }
467
		choice=${choice/* }
469
		choice=${choice/* }

Return to bug 478434