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

Diff of /eclass/multilib.eclass

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

Revision 1.78 Revision 1.82
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.78 2010/05/20 08:22:15 haubi Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.82 2011/03/10 04:26:38 vapier 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
579 x86_64*) 579 x86_64*)
580 export CFLAGS_x86=${CFLAGS_x86--m32} 580 export CFLAGS_x86=${CFLAGS_x86--m32}
581 export CHOST_x86=${CTARGET/x86_64/i686} 581 export CHOST_x86=${CTARGET/x86_64/i686}
582 export CTARGET_x86=${CHOST_x86} 582 export CTARGET_x86=${CHOST_x86}
583 export CDEFINE_x86="__i386__" 583 export CDEFINE_x86="__i386__"
584 export LIBDIR_x86="lib" 584 export LIBDIR_x86="lib32"
585 585
586 export CFLAGS_amd64=${CFLAGS_amd64--m64} 586 export CFLAGS_amd64=${CFLAGS_amd64--m64}
587 export CHOST_amd64=${CTARGET} 587 export CHOST_amd64=${CTARGET}
588 export CTARGET_amd64=${CHOST_amd64} 588 export CTARGET_amd64=${CHOST_amd64}
589 export CDEFINE_amd64="__x86_64__" 589 export CDEFINE_amd64="__x86_64__"
590 export LIBDIR_amd64="lib64" 590 export LIBDIR_amd64="lib64"
591 591
592 export CFLAGS_x32=${CFLAGS_x32--mx32}
593 export CHOST_x32=${CTARGET}
594 export CTARGET_x32=${CHOST_x32}
595 export CDEFINE_x32="__i386__"
596 export LIBDIR_x32="libx32"
597
592 export MULTILIB_ABIS="amd64 x86" 598 : ${MULTILIB_ABIS=amd64 x86}
593 export DEFAULT_ABI="amd64" 599 : ${DEFAULT_ABI=amd64}
594 ;; 600 ;;
595 mips64*) 601 mips64*)
596 export CFLAGS_o32=${CFLAGS_o32--mabi=32} 602 export CFLAGS_o32=${CFLAGS_o32--mabi=32}
597 export CHOST_o32=${CTARGET/mips64/mips} 603 export CHOST_o32=${CTARGET/mips64/mips}
598 export CTARGET_o32=${CHOST_o32} 604 export CTARGET_o32=${CHOST_o32}
609 export CHOST_n64=${CTARGET} 615 export CHOST_n64=${CTARGET}
610 export CTARGET_n64=${CHOST_n64} 616 export CTARGET_n64=${CHOST_n64}
611 export CDEFINE_n64="_MIPS_SIM == _ABI64" 617 export CDEFINE_n64="_MIPS_SIM == _ABI64"
612 export LIBDIR_n64="lib64" 618 export LIBDIR_n64="lib64"
613 619
614 export MULTILIB_ABIS="n64 n32 o32" 620 : ${MULTILIB_ABIS=n64 n32 o32}
615 export DEFAULT_ABI="n32" 621 : ${DEFAULT_ABI=n32}
616 ;; 622 ;;
617 powerpc64*) 623 powerpc64*)
618 export CFLAGS_ppc=${CFLAGS_ppc--m32} 624 export CFLAGS_ppc=${CFLAGS_ppc--m32}
619 export CHOST_ppc=${CTARGET/powerpc64/powerpc} 625 export CHOST_ppc=${CTARGET/powerpc64/powerpc}
620 export CTARGET_ppc=${CHOST_ppc} 626 export CTARGET_ppc=${CHOST_ppc}
625 export CHOST_ppc64=${CTARGET} 631 export CHOST_ppc64=${CTARGET}
626 export CTARGET_ppc64=${CHOST_ppc64} 632 export CTARGET_ppc64=${CHOST_ppc64}
627 export CDEFINE_ppc64="__powerpc64__" 633 export CDEFINE_ppc64="__powerpc64__"
628 export LIBDIR_ppc64="lib64" 634 export LIBDIR_ppc64="lib64"
629 635
630 export MULTILIB_ABIS="ppc64 ppc" 636 : ${MULTILIB_ABIS=ppc64 ppc}
631 export DEFAULT_ABI="ppc64" 637 : ${DEFAULT_ABI=ppc64}
632 ;; 638 ;;
633 s390x*) 639 s390x*)
634 export CFLAGS_s390=${CFLAGS_s390--m31} # the 31 is not a typo 640 export CFLAGS_s390=${CFLAGS_s390--m31} # the 31 is not a typo
635 export CHOST_s390=${CTARGET/s390x/s390} 641 export CHOST_s390=${CTARGET/s390x/s390}
636 export CTARGET_s390=${CHOST_s390} 642 export CTARGET_s390=${CHOST_s390}
641 export CHOST_s390x=${CTARGET} 647 export CHOST_s390x=${CTARGET}
642 export CTARGET_s390x=${CHOST_s390x} 648 export CTARGET_s390x=${CHOST_s390x}
643 export CDEFINE_s390x="__s390x__" 649 export CDEFINE_s390x="__s390x__"
644 export LIBDIR_s390x="lib64" 650 export LIBDIR_s390x="lib64"
645 651
646 export MULTILIB_ABIS="s390x s390" 652 : ${MULTILIB_ABIS=s390x s390}
647 export DEFAULT_ABI="s390x" 653 : ${DEFAULT_ABI=s390x}
648 ;; 654 ;;
649 sparc*) 655 sparc*)
650 export CFLAGS_sparc32=${CFLAGS_sparc32} 656 export CFLAGS_sparc32=${CFLAGS_sparc32}
651 export CHOST_sparc32=${CTARGET/sparc64/sparc} 657 export CHOST_sparc32=${CTARGET/sparc64/sparc}
652 export CTARGET_sparc32=${CHOST_sparc32} 658 export CTARGET_sparc32=${CHOST_sparc32}
657 export CHOST_sparc64=${CTARGET} 663 export CHOST_sparc64=${CTARGET}
658 export CTARGET_sparc64=${CHOST_sparc64} 664 export CTARGET_sparc64=${CHOST_sparc64}
659 export CDEFINE_sparc64="__arch64__" 665 export CDEFINE_sparc64="__arch64__"
660 export LIBDIR_sparc64="lib64" 666 export LIBDIR_sparc64="lib64"
661 667
662 export MULTILIB_ABIS="${MULTILIB_ABIS-sparc64 sparc32}" 668 : ${MULTILIB_ABIS=sparc64 sparc32}
663 export DEFAULT_ABI="${DEFAULT_ABI-sparc64}" 669 : ${DEFAULT_ABI=sparc64}
664 ;; 670 ;;
665 *) 671 *)
666 export MULTILIB_ABIS="default" 672 : ${MULTILIB_ABIS=default}
667 export DEFAULT_ABI="default" 673 : ${DEFAULT_ABI=default}
668 ;; 674 ;;
669 esac 675 esac
676
677 export MULTILIB_ABIS MULTILIB_ABI
670} 678}
671 679
672# @FUNCTION: multilib_toolchain_setup 680# @FUNCTION: multilib_toolchain_setup
673# @DESCRIPTION: 681# @DESCRIPTION:
674# Hide multilib details here for packages which are forced to be compiled for a 682# Hide multilib details here for packages which are forced to be compiled for a
676multilib_toolchain_setup() { 684multilib_toolchain_setup() {
677 local v vv 685 local v vv
678 686
679 export ABI=$1 687 export ABI=$1
680 688
689 # First restore any saved state we have laying around.
690 if [[ ${__DEFAULT_ABI_SAVED} == "true" ]] ; then
691 for v in CHOST CBUILD AS CC CXX LD ; do
692 vv="__abi_saved_${v}"
693 export ${v}="${!vv}"
694 unset ${vv}
695 done
696 unset __DEFAULT_ABI_SAVED
697 fi
698
681 # We want to avoid the behind-the-back magic of gcc-config as it 699 # We want to avoid the behind-the-back magic of gcc-config as it
682 # screws up ccache and distcc. See #196243 for more info. 700 # screws up ccache and distcc. See #196243 for more info.
683 if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then 701 if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then
684 if [[ ${DEFAULT_ABI_SAVED} != "true" ]] ; then 702 # Back that multilib-ass up so we can restore it later
685 for v in CHOST CBUILD AS CC CXX LD ; do 703 for v in CHOST CBUILD AS CC CXX LD ; do
686 export __abi_saved_${v}="${!v}" 704 export __abi_saved_${v}="${!v}"
687 done 705 done
688 export DEFAULT_ABI_SAVED="true" 706 export __DEFAULT_ABI_SAVED="true"
689 fi
690 707
691 # Set the CHOST native first so that we pick up the native 708 # Set the CHOST native first so that we pick up the native
692 # toolchain and not a cross-compiler by accident #202811. 709 # toolchain and not a cross-compiler by accident #202811.
693 export CHOST=$(get_abi_CHOST ${DEFAULT_ABI}) 710 export CHOST=$(get_abi_CHOST ${DEFAULT_ABI})
694 export AS="$(tc-getAS) $(get_abi_ASFLAGS)" 711 export AS="$(tc-getAS) $(get_abi_ASFLAGS)"
695 export CC="$(tc-getCC) $(get_abi_CFLAGS)" 712 export CC="$(tc-getCC) $(get_abi_CFLAGS)"
696 export CXX="$(tc-getCXX) $(get_abi_CFLAGS)" 713 export CXX="$(tc-getCXX) $(get_abi_CFLAGS)"
697 export LD="$(tc-getLD) $(get_abi_LDFLAGS)" 714 export LD="$(tc-getLD) $(get_abi_LDFLAGS)"
698 export CHOST=$(get_abi_CHOST $1) 715 export CHOST=$(get_abi_CHOST $1)
699 export CBUILD=$(get_abi_CHOST $1) 716 export CBUILD=$(get_abi_CHOST $1)
700
701 elif [[ ${DEFAULT_ABI_SAVED} == "true" ]] ; then
702 for v in CHOST CBUILD AS CC CXX LD ; do
703 vv="__abi_saved_${v}"
704 export ${v}=${!vv}
705 done
706 fi 717 fi
707} 718}

Legend:
Removed from v.1.78  
changed lines
  Added in v.1.82

  ViewVC Help
Powered by ViewVC 1.1.20