| 1 | # Copyright 1999-2011 Gentoo Foundation |
1 | # Copyright 1999-2011 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.113 2012/07/21 16:11:01 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.114 2012/07/25 18:27:56 vapier Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: toolchain-funcs.eclass |
5 | # @ECLASS: toolchain-funcs.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Toolchain Ninjas <toolchain@gentoo.org> |
7 | # Toolchain Ninjas <toolchain@gentoo.org> |
| 8 | # @BLURB: functions to query common info about the toolchain |
8 | # @BLURB: functions to query common info about the toolchain |
| … | |
… | |
| 613 | tc-is-static-only && return |
613 | tc-is-static-only && return |
| 614 | |
614 | |
| 615 | # Eventually we'd like to get rid of this func completely #417451 |
615 | # Eventually we'd like to get rid of this func completely #417451 |
| 616 | case ${CTARGET:-${CHOST}} in |
616 | case ${CTARGET:-${CHOST}} in |
| 617 | *-darwin*) ;; |
617 | *-darwin*) ;; |
|
|
618 | *linux*|*-freebsd*) |
| 618 | *linux*) use prefix && return 0 ;; |
619 | use prefix && return 0 ;; |
| 619 | *) return 0 ;; |
620 | *) return 0 ;; |
| 620 | esac |
621 | esac |
| 621 | |
622 | |
| 622 | # Just make sure it exists |
623 | # Just make sure it exists |
| 623 | dodir /usr/${libdir} |
624 | dodir /usr/${libdir} |
| … | |
… | |
| 683 | # understand linker scripts, just create a symlink. |
684 | # understand linker scripts, just create a symlink. |
| 684 | pushd "${ED}/usr/${libdir}" > /dev/null |
685 | pushd "${ED}/usr/${libdir}" > /dev/null |
| 685 | ln -snf "../../${libdir}/${tlib}" "${lib}" |
686 | ln -snf "../../${libdir}/${tlib}" "${lib}" |
| 686 | popd > /dev/null |
687 | popd > /dev/null |
| 687 | ;; |
688 | ;; |
| 688 | *linux*) |
689 | *) |
| 689 | if ${auto} ; then |
690 | if ${auto} ; then |
| 690 | tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) |
691 | tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) |
| 691 | [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}" |
692 | [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}" |
| 692 | mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die |
693 | mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die |
| 693 | # some SONAMEs are funky: they encode a version before the .so |
694 | # some SONAMEs are funky: they encode a version before the .so |