diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2006-07-22 01:53:42 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2006-07-22 01:53:42 +0000 |
commit | 33920adb4bffc0dab8cd41470b2cf1b0f07438d5 (patch) | |
tree | f631d34171fcd63259478dbea15beec95639ad12 | |
parent | system headers with a spu workaround (diff) | |
download | lu_zero-33920adb4bffc0dab8cd41470b2cf1b0f07438d5.tar.gz lu_zero-33920adb4bffc0dab8cd41470b2cf1b0f07438d5.tar.bz2 lu_zero-33920adb4bffc0dab8cd41470b2cf1b0f07438d5.zip |
cell, ppu, spu target support
svn path=/; revision=20
-rw-r--r-- | sys-devel/crossdev/Manifest | 11 | ||||
-rw-r--r-- | sys-devel/crossdev/crossdev-0.9.15-r2.ebuild | 20 | ||||
-rwxr-xr-x | sys-devel/crossdev/files/crossdev | 596 | ||||
-rw-r--r-- | sys-devel/crossdev/files/digest-crossdev-0.9.15-r1 | 1 |
4 files changed, 628 insertions, 0 deletions
diff --git a/sys-devel/crossdev/Manifest b/sys-devel/crossdev/Manifest new file mode 100644 index 0000000..cd887d4 --- /dev/null +++ b/sys-devel/crossdev/Manifest @@ -0,0 +1,11 @@ +AUX crossdev 17204 RMD160 004726569cbd753481a9de4f5a066f30c9bddac3 SHA1 6ddbb5f67046fdb6e86f67b22eadc2ab5916a4e4 SHA256 3a515625c3c5eed50bd012f71910782f0eca75bdf7a484c641790e6316eab47e +MD5 a066224129da559e78ab26690c76653e files/crossdev 17204 +RMD160 004726569cbd753481a9de4f5a066f30c9bddac3 files/crossdev 17204 +SHA256 3a515625c3c5eed50bd012f71910782f0eca75bdf7a484c641790e6316eab47e files/crossdev 17204 +EBUILD crossdev-0.9.15-r2.ebuild 593 RMD160 0a675e4b467678387366bcfb3c41211b826ce3ba SHA1 c08169baee6c7346251a369f853c88385dd7ffd8 SHA256 4dfb38b0a842791d696cd64ff397e9225746bf1c977d519aa12a8d1c3b901c8e +MD5 66124941ea71be0dd8eeeab241ea32fa crossdev-0.9.15-r2.ebuild 593 +RMD160 0a675e4b467678387366bcfb3c41211b826ce3ba crossdev-0.9.15-r2.ebuild 593 +SHA256 4dfb38b0a842791d696cd64ff397e9225746bf1c977d519aa12a8d1c3b901c8e crossdev-0.9.15-r2.ebuild 593 +MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-crossdev-0.9.15-r2 1 +RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-crossdev-0.9.15-r2 1 +SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-crossdev-0.9.15-r2 1 diff --git a/sys-devel/crossdev/crossdev-0.9.15-r2.ebuild b/sys-devel/crossdev/crossdev-0.9.15-r2.ebuild new file mode 100644 index 0000000..1e6e1c0 --- /dev/null +++ b/sys-devel/crossdev/crossdev-0.9.15-r2.ebuild @@ -0,0 +1,20 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/crossdev/crossdev-0.9.15-r1.ebuild,v 1.3 2006/06/25 01:28:25 vapier Exp $ + +DESCRIPTION="Gentoo Cross-toolchain generator" +HOMEPAGE="http://www.gentoo.org/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd" +IUSE="" + +RDEPEND=">=sys-apps/portage-2.1 + app-shells/bash" + +src_install() { + dosbin "${FILESDIR}"/crossdev || die + dosed "s:GENTOO_PV:${PV}:" /usr/sbin/crossdev +} diff --git a/sys-devel/crossdev/files/crossdev b/sys-devel/crossdev/files/crossdev new file mode 100755 index 0000000..15e28a0 --- /dev/null +++ b/sys-devel/crossdev/files/crossdev @@ -0,0 +1,596 @@ +#!/bin/bash +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/crossdev/files/crossdev,v 1.68 2006/06/27 08:08:10 vapier Exp $ + +cd / + +if [[ ${ROOT:-/} != "/" ]] ; then + echo "Sorry, but crossdev does not support ROOT." + exit 2 +fi + +source /sbin/functions.sh || exit 1 +esyslog() { :; } +die() { + echo + eerror $* + eerror If you file a bug, please attach the following logfiles: + eerror ${PORT_LOGDIR}/cross-${CTARGET}-info.log + eerror ${logfile} + exit 1 +} + +usage() { + local exit_status=${1:-0} + shift +cat << EOF +Usage: ${HILITE}crossdev${NORMAL} ${GOOD}[options]${NORMAL} ${BRACKET}--target TARGET${NORMAL} + +Options: + ${GOOD}--b, --binutils${NORMAL} ver Specify version of binutils to use + ${GOOD}--g, --gcc${NORMAL} ver Specify version of gcc to use + ${GOOD}--k, --kernel${NORMAL} ver Specify version of kernel headers to use + ${GOOD}--l, --libc${NORMAL} ver Specify version of libc to use + ${GOOD}-C, --clean${NORMAL} target Uninstall specified target + ${GOOD}-b, -d, -p, -v, -q${NORMAL} Options to pass to emerge (see emerge(1)) +Stage Options: + ${GOOD}-s0, --stage0${NORMAL} Build just binutils + ${GOOD}-s1, --stage1${NORMAL} Also build a C compiler (no libc/C++) + ${GOOD}-s2, --stage2${NORMAL} Also build kernel headers + ${GOOD}-s3, --stage3${NORMAL} Also build the C library (no C++) + ${GOOD}-s4, --stage4${NORMAL} Also build a C++ compiler [default] +Extra Fun (must be run after above stages): + ${GOOD}--ex-only${NORMAL} Skip the stage steps above + ${GOOD}--ex-gcc${NORMAL} Build extra gcc targets (gcj/ada/etc...) + ${GOOD}--ex-gdb${NORMAL} Build a cross gdb + +${BRACKET}Target (-t)${NORMAL}: takes the form: ${BRACKET}ARCH-VENDOR-OS-LIBC${NORMAL} + Run 'crossdev -t help' for examples +EOF + [[ -n $* ]] && echo && eerror "Error: $*" + exit ${exit_status} +} +STAGE_BINUTILS=0 +STAGE_C_ONLY=1 +STAGE_C_KERNEL=2 +STAGE_LIBC=3 +STAGE_C_CPP=4 +STAGE_DISP=( "binutils" "C compiler only" "kernel headers" "C compiler & libc" "C/C++ compiler" ) + +parse_target() { + [[ -z $1 ]] && usage 1 + CTARGET=${1#cross-} + local CPRE=${CTARGET%%-*} CPOST=${CTARGET#*-} + + # Did they give us just an ARCH or the full TARGET ? + if [[ ${CTARGET/-} == ${CTARGET} || -z ${CPOST} ]] ; then + case ${CPRE} in + cris*) CPOST="axis-linux-gnu";; + x86|i?86*|amd64|x86_64*) CPOST="pc-linux-gnu";; + s390*) CPOST="ibm-linux-gnu";; + bfin*|nios2*|spu*) CPOST="elf";; + *) CPOST="unknown-linux-gnu";; + esac + fi + + # Let's accept ARCH in both the portage and the standard forms ... + # CTARGET is in the standard form while TARCH is in the portage form + case ${CPRE} in + + ##################### + ### linux targets ### + alpha*) TARCH=alpha;; + arm*) TARCH=arm;; + hppa*) TARCH=hppa;; + parisc) TARCH=hppa; CPRE="hppa";; + ia64*) TARCH=ia64 WITH_DEF_HEADERS="yes";; + i?86*) TARCH=x86;; + x86) TARCH=x86; CPRE="i386";; + m68*) TARCH=m68k;; + mips*) TARCH=mips ; KPKG="mips-headers";; + powerpc64*) TARCH=ppc64;; + ppc64) TARCH=ppc64; CPRE="powerpc64";; + powerpc*) TARCH=ppc;; + ppc) TARCH=ppc; CPRE="powerpc";; + sparc*) TARCH=sparc;; + s390*) TARCH=s390;; + sh*) TARCH=sh;; + x86_64*) TARCH=amd64;; + amd64) TARCH=amd64; CPRE="x86_64";; + + ##################### + ### other targets ### + avr*) TARCH=${HARCH}; CPOST=""; + KPKG="[none]"; STAGE=${STAGE_LIBC}; + LCAT="dev-embedded"; LPKG="avr-libc"; + GVER="3.4.6"; BVER="2.16.1-r2"; + GUSE=${GUSE_DISABLE};; + + bfin*) + TARCH=${HARCH}; + BPKG="binutils-bfin"; + GPKG="gcc-bfin"; + LPKG="uclibc";; + + cris*) + TARCH=${HARCH}; + LPKG="uclibc";; + + msp430) + TARCH=${HARCH}; CPOST=""; + STAGE=${STAGE_BINUTILS};; + + nios2*) + TARCH=${HARCH}; + BPKG="binutils-nios2"; + GPKG="gcc-nios2"; + LPKG="uclibc";; + spu*) + TARCH=ppc64 + GPKG="gcc-cell"; + LPKG="newlib";; + ppu*) CPRE=powerpc64 #till ppu isn't supported by binutils... + TARCH=ppc64 + GPKG="gcc-cell";; + + vax*) TARCH=${HARCH}; + LPKG="uclibc";; + + ps2*) einfo "The ps2 target is really an alias for the ee/iop/dvp targets" + ${CROSSDEV} -t ee || exit 1 + ${CROSSDEV} -t iop || exit 1 + ${CROSSDEV} -t dvp || exit 1 + exit 0;; + ee*) TARCH=${HARCH}; CPOST=""; + KPKG="[none]" + GVER="3.2.2"; BVER="2.14"; + STAGE=${STAGE_C_ONLY}; + GUSE=${GUSE_DISABLE};; + iop*) TARCH=${HARCH}; CPOST=""; + GVER="3.2.2"; BVER="2.14"; + STAGE=${STAGE_C_ONLY}; + GUSE=${GUSE_DISABLE};; + dvp*) TARCH=${HARCH}; CPOST=""; + GVER="3.2.2"; BVER="2.14"; + STAGE=${STAGE_BINUTILS};; + cell*) einfo "The cell target is really an alias for the spu/ppu targets" + ${CROSSDEV} -t ppu || exit 1 + ${CROSSDEV} -t spu-elf || exit 1 + exit 0;; + ############ + ### help ### + help) + cat <<-EOF + Supported Architectures: + - alpha - arm / armeb + - hppa (parisc) - ia64 + - i386 / i486 / i586 / i686 (x86) - m68k + - mips / mipsel / mips64 / mips64el + - powerpc (ppc) / powerpc64 (ppc64) + - sparc / sparc64 - s390 / s390x + - sh / sh[1-5] / sh64 - x86_64 (amd64) + Supported C Libraries: + - gnu (glibc) + - klibc [prob wont work] + - uclibc [not all arches are ported] + Special Targets: + - avr http://www.nongnu.org/avr-libc/ + - bfin http://blackfin.uclinux.org/ + - msp430 http://mspgcc.sourceforge.net/ + - nios2 http://www.altera.com/products/ip/processors/nios2/ni2-index.html + - ee / iop / dvp (ps2) [Playstation 2 targets] + Softfloat toolchains: + Set the 'vendor' field to 'softfloat' + e.g. armeb-softfloat-linux-uclibc + powerpc-softfloat-linux-gnu + EOF + exit 0 + ;; + + ####################### + ### unknown targets ### + *) usage 1 "Unknown target '$1'; bug vapier@gentoo.org to add it" ;; + esac + + CTARGET=${CPRE} + [[ -n ${CPOST} ]] && CTARGET=${CTARGET}-${CPOST} + + # Tweak packages based upon CTARGET + case ${CTARGET} in + # Normal Linux host, just diff libc + *-dietlibc) LPKG="dietlibc";; + *-klibc) LPKG="klibc";; + *-uclibc) LPKG="uclibc";; + *-gnu*) LPKG="glibc";; + + # Now for the BSDs ... + *-freebsd*) + TARCH="${TARCH}-fbsd" + LCAT="sys-freebsd" LPKG="freebsd-lib" + KPKG="[none]" + ;; + esac +} + +setup_portage_vars() { + PORTDIR_OVERLAYS=$(portageq envvar PORTDIR_OVERLAY) + PORTDIR_OVERLAY=${PORTDIR_OVERLAYS%% *} + PORTDIR=$(portageq envvar PORTDIR) + PORT_LOGDIR=$(portageq envvar PORT_LOGDIR) + PORT_LOGDIR=${PORT_LOGDIR:-/var/log/portage} + export PKGDIR=$(portageq envvar PKGDIR)/cross/${CTARGET} + export PORTAGE_TMPDIR=$(portageq envvar PORTAGE_TMPDIR)/cross/${CTARGET} + [[ ! -d ${PORT_LOGDIR} ]] && mkdir -p ${PORT_LOGDIR} + [[ ! -d ${PORTAGE_TMPDIR} ]] && mkdir -p ${PORTAGE_TMPDIR} +} + +uninstall() { + setup_portage_vars + + ewarn "Uninstalling target '${CTARGET}' ..." + + [[ -d ${PORTDIR_OVERLAY}/cross-${CTARGET} ]] \ + && rm -r ${PORTDIR_OVERLAY}/cross-${CTARGET} + for f in package.{mask,keywords,use} categories ; do + f="/etc/portage/${f}" + [[ ! -e ${f} ]] && continue + sed -i -e "/cross-${CTARGET}\//d" "${f}" + done + + if [[ ! -d /var/db/pkg/cross-${CTARGET} ]] ; then + eerror "${CTARGET} is not installed." + exit 1 + fi + + export CLEAN_DELAY=0 + cd /var/db/pkg + for p in cross-${CTARGET}/* ; do + emerge -C =${p} || exit 1 + done + for b in addr2line ar as c++filt ld nm objcopy objdump ranlib readelf size strings strip ; do + rm -f /usr/bin/${CTARGET}-${b} /usr/${CTARGET}/bin/${b} + done + rm -f /usr/${CTARGET}/{sys-include,usr} + rm -f /usr/bin/${CTARGET}-{gcc,{c,g}++} + rmdir /usr/${CTARGET}/{include/asm,include} &> /dev/null + for d in /usr/${CTARGET} /usr/lib/gcc{,-lib}/${CTARGET} ; do + if [[ ! -d ${d} ]] ; then + rm -f "${d}" &> /dev/null + else + rmdir "${d}" &> /dev/null && continue + rm -ri "${d}" + fi + done + rm -f /etc/env.d/{binutils,gcc}/config-${CTARGET} + rmdir /var/db/pkg/cross-${CTARGET} + + exit 0 +} + +set_withval() { + local withval varname + varname=${*#--with-} + varname=${varname#--without-} + varname=${varname%%=*} + if [[ $* == *=* ]] ; then + withval=${*#*=} + else + [[ $* == --with-* ]] && withval="yes" || withval="no" + fi + + echo WITH_`echo ${varname} | tr '[:lower:]' '[:upper:]'`=\"${withval}\" +} + +is_stage() { [[ ${STAGE} -ge $1 ]] ; } +is_s0() { is_stage 0 ; } +is_s1() { is_stage 1 ; } +is_s2() { is_stage 2 ; } +is_s3() { is_stage 3 ; } +is_s4() { is_stage 4 ; } +is_s5() { is_stage 5 ; } + +with_headers() { [[ ${WITH_HEADERS} == "yes" ]] ; } + +ex_fast() { [[ ${EX_FAST} == "yes" ]] ; } +ex_gcc() { [[ ${EX_GCC} == "yes" ]] ; } +ex_gdb() { [[ ${EX_GDB} == "yes" ]] ; } + +hr() { + local c=${COLUMNS:-0} + if [[ ${c} -eq 0 ]] ; then + c=$(stty size 2> /dev/null) + [[ -z ${c} ]] \ + && c=50 \ + || c=${c##* } + fi + local ext=${1:- _ - ~ -} br="" + while [[ ${#br} -lt ${c} ]] ; do + br=${br}${ext} + done + echo "${br:0:${c}}" +} + +################## +### setup vars ### +CROSSDEV=$0 +EOPTS= +UOPTS= +TARCH= +HARCH=$(unset ARCH ; portageq envvar ARCH) +CTARGET= +STAGE="COW" +BCAT="sys-devel" ; BPKG="binutils" ; BVER="[latest]" ; BUSE="" +GCAT="sys-devel" ; GPKG="gcc" ; GVER="[latest]" ; GUSE="" +KCAT="sys-kernel" ; KPKG="linux-headers" ; KVER="[latest]" ; KUSE="" +LCAT="sys-libs" ; LPKG="" ; LVER="[latest]" ; LUSE="" +GUSE_DISABLE="-boundschecking -fortran -gtk -gcj -mudflap -objc -objc++ -objc-gc" +GUSE_DISABLE_STAGE_2=${GUSE_DISABLE/-fortran} +WITH_HEADERS="COW" WITH_DEF_HEADERS="no" +EX_FAST="no" +EX_GCC="no" +EX_GDB="no" +SET_X="no" + +while [[ $# -gt 0 ]] ; do + case $1 in + -V|--version) echo "crossdev-GENTOO_PV"; exit 0;; + -t|--target) shift; parse_target $1;; + --b|--binutils) shift; BVER=$1;; + --g|--gcc) shift; GVER=$1;; + --k|--kernel) shift; KVER=$1;; + --l|--libc) shift; LVER=$1;; + -C|--clean) shift; parse_target $1; uninstall;; + -s?|--stage?) [[ ${STAGE} == "COW" ]] && STAGE=${1:0-1};; + --ex-only) EX_FAST="yes";; + --ex-gcc) EX_GCC="yes";; + --ex-gdb) EX_GDB="yes";; + --with-*) eval $(set_withval $1);; + --without-*) eval $(set_withval $1);; + -x) SET_X="yes";; + -b|-d|-p|-v|-q) UOPTS="${UOPTS} $1";; + -pv|-vp) UOPTS="${UOPTS} -p -v";; + -h|--help) usage;; + -*) eerror "UNKNOWN OPTION: '$1'" ; usage 1;; + *) parse_target $1;; + esac + shift +done +[[ ${SET_X} == "yes" ]] && set -x + +[[ -z ${CTARGET} ]] && usage 1 +[[ ${STAGE} == "COW" ]] && STAGE=${STAGE_C_CPP} +for with in HEADERS ; do + var=WITH_${with} defvar=WITH_DEF_${with} + [[ ${!var} == "COW" ]] && eval ${var}=${!defvar} +done + +##################### +### sanity checks ### +if ! binutils-config --version &> /dev/null ; then + eerror "Sorry, but your host system needs to have binutils-config" + eerror "in order to keep from screwing things up." + eerror "That means you must be running unstable versions of" + eerror "both binutils and binutils-config." + exit 1 +fi +if ! egrep -qs 'inherit.*toolchain( |$)' /var/db/pkg/sys-devel/gcc-*/*.ebuild ; then + eerror "Sorry, but your host system needs to have" + eerror "an unstable version of gcc in order to" + eerror "keep from screwing things up." + exit 1 +fi + +setup_portage_vars +if [[ -z ${PORTDIR_OVERLAY} ]] ; then + eerror "You need to set PORTDIR_OVERLAY in your make.conf." + eerror "A standard setting is /usr/local/portage" + exit 1 +fi + +if [[ $(unset CHOST ; portageq envvar CHOST) == ${CTARGET} ]] ; then + eerror "Refusing to create a cross-compiler using the same" + eerror "target name as your host utils." + exit 1 +fi + +# grab user settings +for v in ABI UCLIBC_CPU USE BVER GVER KVER LVER STAGE CFLAGS LDFLAGS ASFLAGS ; do + if [[ -e /etc/portage/crossdev/${CTARGET}/${v} ]] ; then + # yes, quotes are needed in this instance (export $var="...") + export ${v}="$(</etc/portage/crossdev/${CTARGET}/${v})" + einfo "Restoring user setting '${v}' to '${!v}'" + fi + if [[ -e /etc/portage/crossdev/${CTARGET}/env ]] ; then + einfo "Restoring generic user env settings" + source /etc/portage/crossdev/${CTARGET}/env + fi +done + +##################### +### do the emerge ### +( +hr - +einfo "Host Portage ARCH: ${HARCH}" +einfo "Target Portage ARCH: ${TARCH}" +einfo "Target System: ${CTARGET}" +einfo "Stage: ${STAGE} (${STAGE_DISP[${STAGE}]})" +echo +ex_fast || { +is_s0 && { +einfo "binutils: ${BPKG}-${BVER}" +} +is_s1 && { +einfo "gcc: ${GPKG}-${GVER}" +} +is_s2 && { +[[ ${KPKG} != "[none]" ]] && \ +einfo "headers: ${KPKG}-${KVER}" +} +is_s3 && { +einfo "libc: ${LPKG}-${LVER}" +} +} +ex_gcc && { +einfo "Extra: gcc pass: DO IT" +} +ex_gdb && { +einfo "Extra: gdb: DO IT" +} +echo +einfo "PORTDIR_OVERLAY: ${PORTDIR_OVERLAY}" +einfo "PORT_LOGDIR: ${PORT_LOGDIR}" +einfo "PKGDIR: ${PKGDIR}" +einfo "PORTAGE_TMPDIR: ${PORTAGE_TMPDIR}" +hr +) >& ${PORT_LOGDIR}/cross-${CTARGET}-info.log || exit 1 +cat ${PORT_LOGDIR}/cross-${CTARGET}-info.log +emerge --info >> ${PORT_LOGDIR}/cross-${CTARGET}-info.log + +#################################### +### Fix up portage files / paths ### + +set_keywords() { + local pkg=$1 ver=$2 + [[ -z ${pkg} ]] && return 0 + sed -i -e "/^cross-${CTARGET}\/${pkg} /d" package.keywords + if [[ ${ver} == "[latest]" ]] || [[ -z ${ver} ]] ; then + echo "cross-${CTARGET}/${pkg} $TARCH ~$TARCH" >> package.keywords + else + sed -i -e "/cross-${CTARGET}\/${pkg}/d" package.mask + echo ">cross-${CTARGET}/${pkg}-${ver}" >> package.mask + echo "cross-${CTARGET}/${pkg} * ~* -*" >> package.keywords + fi +} +set_use() { + local pkg=$1 + shift + local use=$@ + [[ -z ${use} ]] && return 0 + sed -i -e "/cross-${CTARGET}\/${pkg}/d" package.use + echo "cross-${CTARGET}/${pkg} ${use}" >> package.use +} +set_links() { + local cat=$1 pkg=$2 + local s srcdir=${PORTDIR} + rm -f "${PORTDIR_OVERLAY}"/cross-${CTARGET}/${pkg} + for s in ${PORTDIR_OVERLAYS} ; do + if [[ -d ${s}/${cat}/${pkg} ]] ; then + einfo "Using ${cat}/${pkg} from ${s} instead of ${PORTDIR}" + srcdir=${s} + break + fi + done + ln -s "${srcdir}"/${cat}/${pkg} "${PORTDIR_OVERLAY}"/cross-${CTARGET}/${pkg} +} +set_portage() { + local cat=$1 pkg=$2 ver=$3 + shift ; shift ; shift + local use=$@ + + [[ ${pkg} == "[none]" ]] && return 0 + + set_keywords ${pkg} ${ver} + set_use ${pkg} ${use} + set_links ${cat} ${pkg} +} + +mkdir -p /etc/portage +grep -qs "^cross-${CTARGET}$" /etc/portage/categories \ + || echo cross-${CTARGET} >> /etc/portage/categories +mkdir -p "${PORTDIR_OVERLAY}"/cross-${CTARGET} +cd /etc/portage +touch package.{keywords,mask,use} + +set_portage ${BCAT} ${BPKG} ${BVER} +set_portage ${GCAT} ${GPKG} ${GVER} +set_portage ${KCAT} ${KPKG} ${KVER} +set_portage ${LCAT} ${LPKG} ${LVER} +set_portage sys-devel gdb + +################# +emerged_with_use() { + local pkg=$1 use=$2 + grep -qs ${use} /var/db/pkg/cross-${CTARGET}/${pkg}-*/USE +} +set_eopts_on_pkg_status() { + emerged_with_use "$@" \ + && EOPTS=${EOPTS_DEF} \ + || EOPTS=${EOPTS_UP} +} +doemerge() { + [[ $1 == "[none]" ]] && return 0 + + local logfile=${PORT_LOGDIR}/cross-${CTARGET} + [[ -z $2 ]] \ + && logfile=${logfile}-$1.log \ + || logfile=${logfile}-$2.log + + einfo "Log: ${logfile}" + ebegin "Emerging cross-${2:-$1}" + + set_use $1 ${USE} + + if [[ ${UOPTS/-v} != ${UOPTS} ]] ; then + emerge cross-${CTARGET}/$1 ${EOPTS} \ + 2>&1 | tee ${logfile} + else + emerge cross-${CTARGET}/$1 ${EOPTS} \ + >& ${logfile} + fi + local _pipestatus=${PIPESTATUS[*]} + [[ "${_pipestatus// /}" -eq 0 ]] || die "$1 failed :(" + eend 0 +} + +# we include the '-u' so that we don't re-emerge packages +EOPTS_DEF="${UOPTS} --nodeps --oneshot" +EOPTS_UP="${EOPTS_DEF} -u" +EOPTS=${EOPTS_UP} + +# make sure multilib crap doesn't screw us over +export ABI=${ABI:-pos} LIBDIR_pos="lib" CFLAGS_pos="" LDFLAGS_pos="" + +# only allow UCLIBC_CPU from env, not from make.conf/profile +export UCLIBC_CPU=${UCLIBC_CPU} + +ex_fast || { + +ebegin "Forcing the latest versions of binutils-config/gcc-config" +emerge {binutils,gcc}-config -qu --ignore-default-opts &> /dev/null +eend $? || exit 1 + +doemerge ${BPKG} + +is_s1 || exit 0 +if with_headers ; then +USE="${KUSE} ${USE} _E_CROSS_HEADERS_ONLY" \ + doemerge ${KPKG} ${KPKG}-quick +USE="${LUSE} ${USE} _E_CROSS_HEADERS_ONLY" \ + doemerge ${LPKG} ${LPKG}-headers +fi +USE="${GUSE} ${USE} ${GUSE_DISABLE} nocxx _E_CROSS_BOOTSTRAP" \ + doemerge ${GPKG} ${GPKG}-stage1 + +is_s2 || exit 0 +set_eopts_on_pkg_status ${KPKG} _E_CROSS_HEADERS_ONLY +USE="${KUSE} ${USE} -_E_CROSS_HEADERS_ONLY" \ + doemerge ${KPKG} + +is_s3 || exit 0 +set_eopts_on_pkg_status ${LPKG} _E_CROSS_HEADERS_ONLY +USE="${LUSE} ${USE} -_E_CROSS_HEADERS_ONLY" \ + doemerge ${LPKG} + +is_s4 || exit 0 +set_eopts_on_pkg_status ${GPKG} _E_CROSS_BOOTSTRAP +USE="${GUSE} ${USE} ${GUSE_DISABLE_STAGE_2}" \ + doemerge ${GPKG} ${GPKG}-stage2 + +} + +EOPTS=${EOPTS_UP} +ex_gcc && USE="${GUSE} ${USE}" doemerge ${GPKG} ${GPKG}-extra +ex_gdb && doemerge gdb + +exit 0 diff --git a/sys-devel/crossdev/files/digest-crossdev-0.9.15-r1 b/sys-devel/crossdev/files/digest-crossdev-0.9.15-r1 new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/sys-devel/crossdev/files/digest-crossdev-0.9.15-r1 @@ -0,0 +1 @@ + |