Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 78027

Summary: ARCH should be calculated rather than hardcode
Product: Portage Development Reporter: SpanKY <vapier>
Component: Core - ConfigurationAssignee: Portage team <dev-portage>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: embedded
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description SpanKY gentoo-dev 2005-01-14 15:45:36 UTC
i propose !

if $ARCH is not defined in the normal envvar lookup path (make.conf/profile/environment/etc..), then it should be calculated ... first based upon CTARGET (if defined) or CHOST (if CTARGET is not defined)

rational being that currently, when one is cross-compiling, `use $ARCH` and `$ARCH == ""` statements could add/remove code/features when it shouldnt be

here's a simple bash case statement to do this (note, this assumes linux based systems at the moment, but these are the only systems where we will be punting $ARCH for now ... non-linux systems will have to continue setting $ARCH):
case ${CTARGET:-${CHOST}} in
    alpha*)     ARCH=alpha;;
    arm*)       ARCH=arm;;
    hppa*)      ARCH=hppa;;
    i?86*)      ARCH=x86;;
    ia64*)      ARCH=ia64;;
    powerpc64*) ARCH=ppc64;;
    powerpc*)   ARCH=ppc;;
    sparc*)     ARCH=sparc;;
    s390*)      ARCH=s390;;
    sh*)        ARCH=sh;;
    x86_64*)    ARCH=amd64;;
esac
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2005-01-14 15:59:16 UTC
I think what you really want is make.conf to be "selectable" and
the profile to be "selectable".

So that when cross compiling you can use an alternate configuration
and profile that suits the target.
Comment 2 SpanKY gentoo-dev 2005-01-14 16:05:49 UTC
yes, that would work too ... however, it's been my impression that that kind of feature support is a long way off

this is realizable now (i've switched our toolchain to using $(tc-arch) which parses ${CHOST} with a similar case statement to what ive shown here)
Comment 3 SpanKY gentoo-dev 2005-02-16 04:04:29 UTC
we'll categorize this under the 'specify profile for build' bug