diff options
author | midipix <writeonce@midipix.org> | 2021-06-04 14:27:27 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2021-06-04 19:47:09 +0000 |
commit | 5dc03c4b10f350691d781153b8aa994c6f93a5e7 (patch) | |
tree | ec382655652db26487762a10c53a5d0e3bd7e382 /sofort/ccenv/ccenv.sh | |
parent | 282fe96a05198c8ed29d83a232d4d90f9a5f69f6 (diff) | |
download | slibtool-5dc03c4b10f350691d781153b8aa994c6f93a5e7.tar.bz2 slibtool-5dc03c4b10f350691d781153b8aa994c6f93a5e7.tar.xz |
build system: ccenv: added ccenv_set_cc_switch_vars().
Diffstat (limited to 'sofort/ccenv/ccenv.sh')
-rw-r--r-- | sofort/ccenv/ccenv.sh | 51 |
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() |