summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions40
1 files changed, 34 insertions, 6 deletions
diff --git a/scripts/functions b/scripts/functions
index f11ce23..b8b4913 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -318,10 +318,24 @@ CT_DoExecLog() {
local level="$1"
local cur_cmd
local ret
+ local cmd_seen
shift
+
(
for i in "$@"; do
- cur_cmd+="'${i}' "
+ case "${i}" in
+ *=*)
+ if [ -z "${cmd_seen}" ]; then
+ cur_cmd+=" ${i%%=*}='${i#*=}'"
+ else
+ cur_cmd+=" '${i}'"
+ fi
+ ;;
+ *)
+ cur_cmd+=" '${i}'"
+ cmd_seen=y
+ ;;
+ esac
done
while true; do
case "${1}" in
@@ -851,23 +865,33 @@ CT_EnvModify() {
# sample saving sequence.
CT_DoBuildTargetTuple() {
# Set the endianness suffix, and the default endianness gcc option
+ target_endian_eb=
+ target_endian_be=
+ target_endian_el=
+ target_endian_le=
case "${CT_ARCH_ENDIAN}" in
big)
target_endian_eb=eb
target_endian_be=be
- target_endian_el=
- target_endian_le=
CT_ARCH_ENDIAN_CFLAG="-mbig-endian"
CT_ARCH_ENDIAN_LDFLAG="-Wl,-EB"
;;
little)
- target_endian_eb=
- target_endian_be=
target_endian_el=el
target_endian_le=le
CT_ARCH_ENDIAN_CFLAG="-mlittle-endian"
CT_ARCH_ENDIAN_LDFLAG="-Wl,-EL"
;;
+ # big,little and little,big do not need to pass the flags;
+ # gcc is expected to be configured for that as default.
+ big,little)
+ target_endian_eb=eb
+ target_endian_be=be
+ ;;
+ little,big)
+ target_endian_el=el
+ target_endian_le=le
+ ;;
esac
# Set the bitness suffix
@@ -902,7 +926,7 @@ CT_DoBuildTargetTuple() {
# Set the default values for ARCH, ABI, CPU, TUNE, FPU and FLOAT
unset CT_ARCH_ARCH_CFLAG CT_ARCH_ABI_CFLAG CT_ARCH_CPU_CFLAG CT_ARCH_TUNE_CFLAG CT_ARCH_FPU_CFLAG CT_ARCH_FLOAT_CFLAG
- unset CT_ARCH_WITH_ARCH CT_ARCH_WITH_ABI CT_ARCH_WITH_CPU CT_ARCH_WITH_TUNE CT_ARCH_WITH_FPU CT_ARCH_WITH_FLOAT
+ unset CT_ARCH_WITH_ARCH CT_ARCH_WITH_ABI CT_ARCH_WITH_CPU CT_ARCH_WITH_TUNE CT_ARCH_WITH_FPU CT_ARCH_WITH_FLOAT CT_ARCH_WITH_ENDIAN
[ "${CT_ARCH_ARCH}" ] && { CT_ARCH_ARCH_CFLAG="-march=${CT_ARCH_ARCH}"; CT_ARCH_WITH_ARCH="--with-arch=${CT_ARCH_ARCH}"; }
[ "${CT_ARCH_ABI}" ] && { CT_ARCH_ABI_CFLAG="-mabi=${CT_ARCH_ABI}"; CT_ARCH_WITH_ABI="--with-abi=${CT_ARCH_ABI}"; }
[ "${CT_ARCH_CPU}" ] && { CT_ARCH_CPU_CFLAG="-mcpu=${CT_ARCH_CPU}"; CT_ARCH_WITH_CPU="--with-cpu=${CT_ARCH_CPU}"; }
@@ -924,6 +948,10 @@ CT_DoBuildTargetTuple() {
;;
esac
+ if [ "${CT_ARCH_SUPPORTS_WITH_ENDIAN}" = "y" ]; then
+ CT_ARCH_WITH_ENDIAN="--with-endian=${CT_ARCH_ENDIAN}"
+ fi
+
# Build the default kernel tuple part
CT_TARGET_KERNEL="${CT_KERNEL}"