summaryrefslogtreecommitdiff
path: root/sofort/ccenv/ccenv.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sofort/ccenv/ccenv.sh')
-rw-r--r--sofort/ccenv/ccenv.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index 8fc5033..868ad1a 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -1435,6 +1435,55 @@ ccenv_output_defs()
eval 'ccenv_'${ccenv_cfgtype}'_cc'=\'$ccenv_cc\'
}
+ccenv_set_cc_switch_vars()
+{
+ if [ -f $mb_project_dir/project/config/ccswitch.strs ]; then
+ ccenv_switch_vars=$(grep -v '^#' \
+ $mb_project_dir/sofort/ccenv/ccswitch.strs \
+ $mb_project_dir/project/config/ccswitch.strs \
+ | sort -u)
+ else
+ ccenv_switch_vars=$(grep -v '^#' \
+ $mb_project_dir/sofort/ccenv/ccswitch.strs \
+ | sort -u)
+ fi
+
+ if [ $ccenv_cfgtype = 'host' ]; then
+ # ccenv_host_cc="$ccenv_cc"
+ ccenv_makevar_prefix='_CFLAGS_'
+ cfgtest_host_section
+ else
+ # ccenv_native_cc="$ccenv_cc"
+ ccenv_makevar_prefix='_NATIVE_CFLAGS_'
+ cfgtest_native_section
+ fi
+
+ for ccenv_switch_var in $(printf '%s' "$ccenv_switch_vars"); do
+ ccenv_make_var=${ccenv_switch_var%=}
+ ccenv_make_var=${ccenv_make_var%,}
+
+ ccenv_make_var=${ccenv_make_var##---}
+ ccenv_make_var=${ccenv_make_var##--}
+ ccenv_make_var=${ccenv_make_var##-}
+
+ ccenv_make_var=$(printf '%s' "$ccenv_make_var" \
+ | sed -e 's/=/_/g' -e 's/-/_/g' -e 's/,/_/g')
+
+ ccenv_make_var="${ccenv_makevar_prefix}${ccenv_make_var}"
+
+ if cfgtest_compiler_switch "$ccenv_switch_var"; then
+ ccenv_switch_var=${ccenv_switch_var%=}
+ ccenv_switch_var=${ccenv_switch_var%,}
+
+ printf '%-31s = %s\n' "${ccenv_make_var}" "${ccenv_switch_var}" \
+ >> "$ccenv_mk"
+ else
+ printf '%-31s =\n' "${ccenv_make_var}" \
+ >> "$ccenv_mk"
+ fi
+ done
+}
+
ccenv_dso_verify()
{
ccenv_str='int foo(int x){return ++x;}'
@@ -1544,6 +1593,8 @@ ccenv_set_toolchain_variables()
ccenv_output_defs
ccenv_clean_up
+
+ ccenv_set_cc_switch_vars
}
ccenv_set_host_variables()