Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 78027 - ARCH should be calculated rather than hardcode
Summary: ARCH should be calculated rather than hardcode
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-14 15:45 UTC by SpanKY
Modified: 2005-02-16 04:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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