/[gentoo-x86]/eclass/multilib.eclass
Gentoo

Diff of /eclass/multilib.eclass

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

Revision 1.66 Revision 1.73
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 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/multilib.eclass,v 1.66 2008/06/01 01:38:09 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.73 2009/04/04 18:02:33 grobian Exp $
4 4
5# @ECLASS: multilib.eclass 5# @ECLASS: multilib.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# amd64@gentoo.org 7# amd64@gentoo.org
8# toolchain@gentoo.org 8# toolchain@gentoo.org
337 done 337 done
338 338
339 if is_final_abi; then 339 if is_final_abi; then
340 base=${T}/gentoo-multilib 340 base=${T}/gentoo-multilib
341 pushd "${base}" 341 pushd "${base}"
342 find . | tar -c -T - -f - | tar -x --no-same-owner -f - -C ${D} 342 find . | tar -c -T - -f - | tar -x --no-same-owner -f - -C "${D}"
343 popd 343 popd
344 344
345 # This 'set' stuff is required by mips profiles to properly pass 345 # This 'set' stuff is required by mips profiles to properly pass
346 # CDEFINE's (which have spaces) to sub-functions 346 # CDEFINE's (which have spaces) to sub-functions
347 set -- 347 set --
481 dodir ${dest} 481 dodir ${dest}
482 482
483 local basedir 483 local basedir
484 for basedir in ${basedirs}; do 484 for basedir in ${basedirs}; do
485 local dir 485 local dir
486 for dir in $(find ${D}/${basedir} -type d); do 486 for dir in $(find "${D}"/${basedir} -type d); do
487 dodir ${dest}/${dir/${D}\/${basedir}/} 487 dodir ${dest}/${dir/${D}\/${basedir}/}
488 done 488 done
489 done 489 done
490} 490}
491 491
516} 516}
517 517
518# @FUNCTION: get_libname 518# @FUNCTION: get_libname
519# @USAGE: [version] 519# @USAGE: [version]
520# @DESCRIPTION: 520# @DESCRIPTION:
521# Returns libname with proper suffix {.so,.dylib} and optionally supplied version 521# Returns libname with proper suffix {.so,.dylib,.dll,etc} and optionally
522# for ELF/MACH-O shared objects 522# supplied version for the current platform identified by CHOST.
523# 523#
524# Example: 524# Example:
525# get_libname libfoo ${PV} 525# get_libname libfoo ${PV}
526# Returns: libfoo.so.${PV} (ELF) || libfoo.${PV}.dylib (MACH) 526# Returns: libfoo.so.${PV} (ELF) || libfoo.${PV}.dylib (MACH) || ...
527get_libname() { 527get_libname() {
528 local libname 528 local libname
529 local ver=$1 529 local ver=$1
530 case ${CHOST} in 530 case ${CHOST} in
531 mingw*|*-mingw*) libname="dll";; 531 *-cygwin|mingw*|*-mingw*) libname="dll";;
532 *-darwin*) libname="dylib";; 532 *-darwin*) libname="dylib";;
533 *-aix*) libname="a";;
534 *-mint*) libname="irrelevant";;
533 *) libname="so";; 535 *) libname="so";;
534 esac 536 esac
535 537
536 if [[ -z $* ]] ; then 538 if [[ -z $* ]] ; then
537 echo ".${libname}" 539 echo ".${libname}"
538 else 540 else
539 for ver in "$@" ; do 541 for ver in "$@" ; do
540 case ${CHOST} in 542 case ${CHOST} in
541 *-darwin*) echo ".${ver}.${libname}";; 543 *-darwin*) echo ".${ver}.${libname}";;
544 *-aix*) echo ".${libname}";;
545 *-mint*) echo ".${libname}";;
542 *) echo ".${libname}.${ver}";; 546 *) echo ".${libname}.${ver}";;
543 esac 547 esac
544 done 548 done
545 fi 549 fi
546} 550}
619 export LIBDIR_s390x="lib64" 623 export LIBDIR_s390x="lib64"
620 624
621 export MULTILIB_ABIS="s390x s390" 625 export MULTILIB_ABIS="s390x s390"
622 export DEFAULT_ABI="s390x" 626 export DEFAULT_ABI="s390x"
623 ;; 627 ;;
624 sparc64*) 628 sparc*)
625 export CFLAGS_sparc32=${CFLAGS_sparc32--m32} 629 export CFLAGS_sparc32=${CFLAGS_sparc32}
626 export CHOST_sparc32=${CTARGET/sparc64/sparc} 630 export CHOST_sparc32=${CTARGET/sparc64/sparc}
627 export CTARGET_sparc32=${CHOST_sparc32} 631 export CTARGET_sparc32=${CHOST_sparc32}
628 export CDEFINE_sparc32="!__arch64__" 632 export CDEFINE_sparc32="!__arch64__"
629 export LIBDIR_sparc32="lib" 633 export LIBDIR_sparc32="lib"
630 634
632 export CHOST_sparc64=${CTARGET} 636 export CHOST_sparc64=${CTARGET}
633 export CTARGET_sparc64=${CHOST_sparc64} 637 export CTARGET_sparc64=${CHOST_sparc64}
634 export CDEFINE_sparc64="__arch64__" 638 export CDEFINE_sparc64="__arch64__"
635 export LIBDIR_sparc64="lib64" 639 export LIBDIR_sparc64="lib64"
636 640
637 export MULTILIB_ABIS="sparc64 sparc32" 641 export MULTILIB_ABIS="${MULTILIB_ABIS-sparc64 sparc32}"
638 export DEFAULT_ABI="sparc64" 642 export DEFAULT_ABI="${DEFAULT_ABI-sparc64}"
639 ;; 643 ;;
640 *) 644 *)
641 export MULTILIB_ABIS="default" 645 export MULTILIB_ABIS="default"
642 export DEFAULT_ABI="default" 646 export DEFAULT_ABI="default"
643 ;; 647 ;;
647# @FUNCTION: multilib_toolchain_setup 651# @FUNCTION: multilib_toolchain_setup
648# @DESCRIPTION: 652# @DESCRIPTION:
649# Hide multilib details here for packages which are forced to be compiled for a 653# Hide multilib details here for packages which are forced to be compiled for a
650# specific ABI when run on another ABI (like x86-specific packages on amd64) 654# specific ABI when run on another ABI (like x86-specific packages on amd64)
651multilib_toolchain_setup() { 655multilib_toolchain_setup() {
656 local v vv
657
652 export ABI=$1 658 export ABI=$1
653 659
654 if has_version app-admin/eselect-compiler ; then 660 # We want to avoid the behind-the-back magic of gcc-config as it
655 # Binutils doesn't have wrappers for ld and as (yet). Eventually it 661 # screws up ccache and distcc. See #196243 for more info.
656 # will, and all this can just be handled with CHOST. 662 if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then
657 export LD="ld $(get_abi_LDFLAGS $1)" 663 if [[ ${DEFAULT_ABI_SAVED} != "true" ]] ; then
664 for v in CHOST CBUILD AS CC CXX LD ; do
665 export __abi_saved_${v}="${!v}"
666 done
667 export DEFAULT_ABI_SAVED="true"
668 fi
669
670 # Set the CHOST native first so that we pick up the native
671 # toolchain and not a cross-compiler by accident #202811.
672 export CHOST=$(get_abi_CHOST ${DEFAULT_ABI})
658 export AS="as $(get_abi_ASFLAGS $1)" 673 export AS="$(tc-getAS) $(get_abi_ASFLAGS)"
659 674 export CC="$(tc-getCC) $(get_abi_CFLAGS)"
675 export CXX="$(tc-getCXX) $(get_abi_CFLAGS)"
676 export LD="$(tc-getLD) $(get_abi_LDFLAGS)"
660 export CHOST=$(get_abi_CHOST $1) 677 export CHOST=$(get_abi_CHOST $1)
661 export CBUILD=$(get_abi_CHOST $1) 678 export CBUILD=$(get_abi_CHOST $1)
662 else 679
663 tc-export CC 680 elif [[ ${DEFAULT_ABI_SAVED} == "true" ]] ; then
681 for v in CHOST CBUILD AS CC CXX LD ; do
682 vv="__abi_saved_${v}"
683 export ${v}=${!vv}
684 done
664 fi 685 fi
665} 686}

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.73

  ViewVC Help
Powered by ViewVC 1.1.20