Mercurial > hg > aboriginal
comparison sources/functions.sh @ 1812:acaa88463c0c draft
Add CROSS_COMPILER_PATH and CC_PREFIX knobs.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 12 Nov 2015 07:55:05 -0600 |
parents | d8ea81a06fdd |
children | fb05f99ffcce |
comparison
equal
deleted
inserted
replaced
1811:f326dbd73bee | 1812:acaa88463c0c |
---|---|
5 # Output path to cross compiler. | 5 # Output path to cross compiler. |
6 | 6 |
7 cc_path() | 7 cc_path() |
8 { | 8 { |
9 local i | 9 local i |
10 | |
11 if [ ! -z "$CROSS_COMPILER_PATH" ] | |
12 then | |
13 [ -z "$CC_PREFIX" ] && | |
14 echo "CROSS_COMPILER_PATH without CC_PREFIX" >&2 && | |
15 dienow | |
16 echo -n "$CROSS_COMPILER_PATH:" | |
17 return | |
18 fi | |
10 | 19 |
11 # Output cross it if exists, else simple. If neither exists, output simple. | 20 # Output cross it if exists, else simple. If neither exists, output simple. |
12 | 21 |
13 for i in "$BUILD"/{,simple-}cross-compiler-"$1/bin" | 22 for i in "$BUILD"/{,simple-}cross-compiler-"$1/bin" |
14 do | 23 do |
68 | 77 |
69 export PATH="$(cc_path "$ARCH")$PATH" | 78 export PATH="$(cc_path "$ARCH")$PATH" |
70 [ ! -z "$HOST_ARCH" ] && [ "$HOST_ARCH" != "$ARCH" ] && | 79 [ ! -z "$HOST_ARCH" ] && [ "$HOST_ARCH" != "$ARCH" ] && |
71 PATH="$(cc_path "$HOST_ARCH")$PATH" | 80 PATH="$(cc_path "$HOST_ARCH")$PATH" |
72 | 81 |
73 DO_CROSS="CROSS_COMPILE=${ARCH}-" | 82 export_if_blank CC_PREFIX="${ARCH}-" |
83 DO_CROSS="CROSS_COMPILE=$CC_PREFIX" | |
74 | 84 |
75 return 0 | 85 return 0 |
76 } | 86 } |
77 | 87 |
78 # Note that this sources the file, rather than calling it as a separate | 88 # Note that this sources the file, rather than calling it as a separate |