Mercurial > hg > aboriginal
diff sources/functions.sh @ 1090:affef1edbdba
Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 21 May 2010 22:26:25 -0500 |
parents | b52ba5df878d |
children | fb9423e8bd09 |
line wrap: on
line diff
--- a/sources/functions.sh Fri May 21 22:25:10 2010 -0500 +++ b/sources/functions.sh Fri May 21 22:26:25 2010 -0500 @@ -4,12 +4,14 @@ source sources/utility_functions.sh -# Output the first cross compiler (static or basic) that's installed. +# Output path to cross compiler. cc_path() { local i + # Output cross it if exists, else simple. If neither exists, output simple. + for i in "$BUILD"/{,simple-}cross-compiler-"$1/bin" do [ -e "$i/$1-cc" ] && break @@ -46,29 +48,15 @@ # during root-filesystem.sh, and the host compiler links binaries against the # wrong libc.) export_if_blank CROSS_HOST=`uname -m`-walrus-linux - if [ -z "$CROSS_TARGET" ] - then - export CROSS_TARGET=${ARCH}-unknown-linux - else - [ -z "$FROM_HOST" ] && FROM_HOST="${CROSS_TARGET}" - fi - - # Override FROM_ARCH to perform a canadian cross in root-filesystem.sh - - if [ -z "$FROM_ARCH" ] - then - FROM_ARCH="${ARCH}" - else - [ -z "$PROGRAM_PREFIX" ] && PROGRAM_PREFIX="${ARCH}-" - fi - export_if_blank FROM_HOST="${FROM_ARCH}-thingy-linux" + export_if_blank CROSS_TARGET=${ARCH}-unknown-linux # Setup directories and add the cross compiler to the start of the path. STAGE_DIR="$BUILD/${STAGE_NAME}-${ARCH_NAME}" export PATH="$(cc_path "$ARCH")$PATH" - [ "$FROM_ARCH" != "$ARCH" ] && PATH="$(cc_path "$FROM_ARCH")$PATH" + [ ! -z "$HOST_ARCH" ] && [ "$HOST_ARCH" != "$ARCH" ] && + PATH="$(cc_path "$HOST_ARCH")$PATH" DO_CROSS="CROSS_COMPILE=${ARCH}-"