/[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.91 Revision 1.94
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.91 2009/05/24 07:25:48 grobian Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.94 2009/09/02 09:00:08 grobian 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
455 [[ -z ${tlib} ]] && die "unable to read install_name from ${lib}" 455 [[ -z ${tlib} ]] && die "unable to read install_name from ${lib}"
456 tlib=${tlib##*/} 456 tlib=${tlib##*/}
457 457
458 if ${auto} ; then 458 if ${auto} ; then
459 mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die 459 mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die
460 # some install_names are funky: they encode a version
461 if [[ ${tlib} != ${lib%${suffix}}.*${suffix#.} ]] ; then
462 mv "${ED}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die
463 fi
460 rm -f "${ED}"/${libdir}/${lib} 464 rm -f "${ED}"/${libdir}/${lib}
461 fi 465 fi
462 466
463 # Mach-O files have an id, which is like a soname, it tells how 467 # Mach-O files have an id, which is like a soname, it tells how
464 # another object linking against this lib should reference it. 468 # another object linking against this lib should reference it.
465 # Since we moved the lib from usr/lib into lib this reference is 469 # Since we moved the lib from usr/lib into lib this reference is
466 # wrong. Hence, we update it here. We don't configure with 470 # wrong. Hence, we update it here. We don't configure with
467 # libdir=/lib because that messes up libtool files. 471 # libdir=/lib because that messes up libtool files.
468 # Make sure we don't lose the specific version, so just modify the 472 # Make sure we don't lose the specific version, so just modify the
469 # existing install_name 473 # existing install_name
474 if [[ ! -w "${ED}/${libdir}/${tlib}" ]] ; then
475 fperms u+w "${libdir}/${tlib}" # needed to write to it
476 local nowrite=yes
477 fi
470 install_name_tool \ 478 install_name_tool \
471 -id "${EPREFIX}"/${libdir}/${tlib} \ 479 -id "${EPREFIX}"/${libdir}/${tlib} \
472 "${ED}"/${libdir}/${tlib} 480 "${ED}"/${libdir}/${tlib} || die "install_name_tool failed"
481 [[ -n ${nowrite} ]] && fperms u-w "${libdir}/${tlib}"
473 # Now as we don't use GNU binutils and our linker doesn't 482 # Now as we don't use GNU binutils and our linker doesn't
474 # understand linker scripts, just create a symlink. 483 # understand linker scripts, just create a symlink.
475 pushd "${ED}/usr/${libdir}" > /dev/null 484 pushd "${ED}/usr/${libdir}" > /dev/null
476 ln -snf "../../${libdir}/${tlib}" "${lib}" 485 ln -snf "../../${libdir}/${tlib}" "${lib}"
477 popd > /dev/null 486 popd > /dev/null
478 ;; 487 ;;
479 *-aix*|*-irix*|*-hpux*|*-interix*|*-winnt*) 488 *-aix*|*-irix*|*64*-hpux*|*-interix*|*-winnt*)
480 if ${auto} ; then 489 if ${auto} ; then
481 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die 490 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die
482 # no way to retrieve soname on these platforms (?) 491 # no way to retrieve soname on these platforms (?)
483 tlib=$(readlink "${ED}"/${libdir}/${lib}) 492 tlib=$(readlink "${ED}"/${libdir}/${lib})
484 tlib=${tlib##*/} 493 tlib=${tlib##*/}
508 # command line by itself). 517 # command line by itself).
509 pushd "${ED}/usr/${libdir}" > /dev/null 518 pushd "${ED}/usr/${libdir}" > /dev/null
510 ln -snf "../../${libdir}/${tlib}" "${lib}" 519 ln -snf "../../${libdir}/${tlib}" "${lib}"
511 popd > /dev/null 520 popd > /dev/null
512 ;; 521 ;;
522 hppa*-hpux*) # PA-RISC 32bit (SOM) only, others (ELF) match *64*-hpux* above.
523 if ${auto} ; then
524 tlib=$(chatr "${ED}"/usr/${libdir}/${lib} | sed -n '/internal name:/{n;s/^ *//;p;q}')
525 [[ -z ${tlib} ]] && tlib=${lib}
526 tlib=${tlib##*/} # 'internal name' can have a path component
527 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die
528 # some SONAMEs are funky: they encode a version before the .so
529 if [[ ${tlib} != ${lib}* ]] ; then
530 mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die
531 fi
532 [[ ${tlib} != ${lib} ]] &&
533 rm -f "${ED}"/${libdir}/${lib}
534 else
535 tlib=$(chatr "${ED}"/${libdir}/${lib} | sed -n '/internal name:/{n;s/^ *//;p;q}')
536 [[ -z ${tlib} ]] && tlib=${lib}
537 tlib=${tlib##*/} # 'internal name' can have a path component
538 fi
539 pushd "${ED}"/usr/${libdir} >/dev/null
540 ln -snf "../../${libdir}/${tlib}" "${lib}"
541 # need the internal name in usr/lib too, to be available at runtime
542 # when linked with /path/to/lib.sl (hardcode_direct_absolute=yes)
543 [[ ${tlib} != ${lib} ]] &&
544 ln -snf "../../${libdir}/${tlib}" "${tlib}"
545 popd >/dev/null
546 ;;
513 *) 547 *)
514 if ${auto} ; then 548 if ${auto} ; then
515 tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) 549 tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib})
516 [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}" 550 [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}"
517 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die 551 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die

Legend:
Removed from v.1.91  
changed lines
  Added in v.1.94

  ViewVC Help
Powered by ViewVC 1.1.20