/[gentoo-x86]/eclass/toolchain-funcs.eclass
Gentoo

Diff of /eclass/toolchain-funcs.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.92 Revision 1.96
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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.92 2009/08/15 15:11:17 grobian Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.96 2009/11/27 21:31:29 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
86tc-getFC() { tc-getPROG FC gfortran "$@"; } 86tc-getFC() { tc-getPROG FC gfortran "$@"; }
87# @FUNCTION: tc-getGCJ 87# @FUNCTION: tc-getGCJ
88# @USAGE: [toolchain prefix] 88# @USAGE: [toolchain prefix]
89# @RETURN: name of the java compiler 89# @RETURN: name of the java compiler
90tc-getGCJ() { tc-getPROG GCJ gcj "$@"; } 90tc-getGCJ() { tc-getPROG GCJ gcj "$@"; }
91# @FUNCTION: tc-getPKG_CONFIG
92# @USAGE: [toolchain prefix]
93# @RETURN: name of the pkg-config tool
94tc-getPKG_CONFIG() { tc-getPROG PKG_CONFIG pkg-config "$@"; }
91 95
92# @FUNCTION: tc-getBUILD_CC 96# @FUNCTION: tc-getBUILD_CC
93# @USAGE: [toolchain prefix] 97# @USAGE: [toolchain prefix]
94# @RETURN: name of the C compiler for building binaries to run on the build machine 98# @RETURN: name of the C compiler for building binaries to run on the build machine
95tc-getBUILD_CC() { 99tc-getBUILD_CC() {
469 # Since we moved the lib from usr/lib into lib this reference is 473 # Since we moved the lib from usr/lib into lib this reference is
470 # wrong. Hence, we update it here. We don't configure with 474 # wrong. Hence, we update it here. We don't configure with
471 # libdir=/lib because that messes up libtool files. 475 # libdir=/lib because that messes up libtool files.
472 # Make sure we don't lose the specific version, so just modify the 476 # Make sure we don't lose the specific version, so just modify the
473 # existing install_name 477 # existing install_name
478 if [[ ! -w "${ED}/${libdir}/${tlib}" ]] ; then
479 chmod u+w "${ED}${libdir}/${tlib}" # needed to write to it
480 local nowrite=yes
481 fi
474 install_name_tool \ 482 install_name_tool \
475 -id "${EPREFIX}"/${libdir}/${tlib} \ 483 -id "${EPREFIX}"/${libdir}/${tlib} \
476 "${ED}"/${libdir}/${tlib} 484 "${ED}"/${libdir}/${tlib} || die "install_name_tool failed"
485 [[ -n ${nowrite} ]] && chmod u-w "${ED}${libdir}/${tlib}"
477 # Now as we don't use GNU binutils and our linker doesn't 486 # Now as we don't use GNU binutils and our linker doesn't
478 # understand linker scripts, just create a symlink. 487 # understand linker scripts, just create a symlink.
479 pushd "${ED}/usr/${libdir}" > /dev/null 488 pushd "${ED}/usr/${libdir}" > /dev/null
480 ln -snf "../../${libdir}/${tlib}" "${lib}" 489 ln -snf "../../${libdir}/${tlib}" "${lib}"
481 popd > /dev/null 490 popd > /dev/null
482 ;; 491 ;;
483 *-aix*|*-irix*|*-hpux*|*-interix*|*-winnt*) 492 *-aix*|*-irix*|*64*-hpux*|*-interix*|*-winnt*)
484 if ${auto} ; then 493 if ${auto} ; then
485 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die 494 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die
486 # no way to retrieve soname on these platforms (?) 495 # no way to retrieve soname on these platforms (?)
487 tlib=$(readlink "${ED}"/${libdir}/${lib}) 496 tlib=$(readlink "${ED}"/${libdir}/${lib})
488 tlib=${tlib##*/} 497 tlib=${tlib##*/}
512 # command line by itself). 521 # command line by itself).
513 pushd "${ED}/usr/${libdir}" > /dev/null 522 pushd "${ED}/usr/${libdir}" > /dev/null
514 ln -snf "../../${libdir}/${tlib}" "${lib}" 523 ln -snf "../../${libdir}/${tlib}" "${lib}"
515 popd > /dev/null 524 popd > /dev/null
516 ;; 525 ;;
526 hppa*-hpux*) # PA-RISC 32bit (SOM) only, others (ELF) match *64*-hpux* above.
527 if ${auto} ; then
528 tlib=$(chatr "${ED}"/usr/${libdir}/${lib} | sed -n '/internal name:/{n;s/^ *//;p;q}')
529 [[ -z ${tlib} ]] && tlib=${lib}
530 tlib=${tlib##*/} # 'internal name' can have a path component
531 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die
532 # some SONAMEs are funky: they encode a version before the .so
533 if [[ ${tlib} != ${lib}* ]] ; then
534 mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die
535 fi
536 [[ ${tlib} != ${lib} ]] &&
537 rm -f "${ED}"/${libdir}/${lib}
538 else
539 tlib=$(chatr "${ED}"/${libdir}/${lib} | sed -n '/internal name:/{n;s/^ *//;p;q}')
540 [[ -z ${tlib} ]] && tlib=${lib}
541 tlib=${tlib##*/} # 'internal name' can have a path component
542 fi
543 pushd "${ED}"/usr/${libdir} >/dev/null
544 ln -snf "../../${libdir}/${tlib}" "${lib}"
545 # need the internal name in usr/lib too, to be available at runtime
546 # when linked with /path/to/lib.sl (hardcode_direct_absolute=yes)
547 [[ ${tlib} != ${lib} ]] &&
548 ln -snf "../../${libdir}/${tlib}" "${tlib}"
549 popd >/dev/null
550 ;;
517 *) 551 *)
518 if ${auto} ; then 552 if ${auto} ; then
519 tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) 553 tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib})
520 [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}" 554 [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}"
521 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die 555 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die

Legend:
Removed from v.1.92  
changed lines
  Added in v.1.96

  ViewVC Help
Powered by ViewVC 1.1.20