summaryrefslogtreecommitdiffhomepage
path: root/sofort/ccenv
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-17 13:38:34 +0000
committermidipix <writeonce@midipix.org>2021-04-17 13:49:32 +0000
commite52cd7baab85ed6564892c7acaabeac9197dd4a2 (patch)
tree4f7efa7ea39a8effed5cd70df1fe7d2f96d26b5b /sofort/ccenv
parentc5a84713628e32da720023f9942d167ad1148873 (diff)
downloadmmglue-e52cd7baab85ed6564892c7acaabeac9197dd4a2.tar.bz2
mmglue-e52cd7baab85ed6564892c7acaabeac9197dd4a2.tar.xz
build system: ccenv_output_defs(): enhanced makefile generation.
Diffstat (limited to 'sofort/ccenv')
-rw-r--r--sofort/ccenv/ccenv.sh26
1 files changed, 18 insertions, 8 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index 5aa1554..67b5720 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -1279,19 +1279,29 @@ ccenv_output_defs()
unset ccenv_tmp
fi
+ ccenv_var_defs=
+ ccenv_sed_substs=
+
ccenv_vars=$(cut -d'=' -f1 "$mb_project_dir/sofort/ccenv/ccenv.vars" \
- | grep -v '^#')
+ | grep -v '^#');
ccenv_exvars="ccenv_cfgtype ccenv_makevar_prefix"
- ccenv_sed_substs=" \
- $(for __var in $(printf '%s' "$ccenv_vars $ccenv_exvars"); do \
- printf '%s"$%s"%s' "-e 's/@$__var@/'" \
- "$__var" "'/g' "; \
- done)"
+ for __var in $(printf '%s' "$ccenv_vars $ccenv_exvars"); do
+ ccenv_sed_subst=$(printf '%s %s%s%s' \
+ '-e' "'s^@$__var@" \
+ "^___${__var}___" \
+ "^g'")
+
+ ccenv_sed_substs="$ccenv_sed_substs $ccenv_sed_subst"
+
+ ccenv_var_def=$(printf '%s%s="${%s}"' "-D" "___${__var}___" "${__var}")
+ eval ccenv_var_defs='"$ccenv_var_defs "$ccenv_var_def'
+ done
- eval sed $ccenv_sed_substs $ccenv_in \
- | sed -e 's/[[:blank:]]*$//g' \
+ eval sed $ccenv_sed_substs $(printf '%s ' $ccenv_in) \
+ | eval m4 $ccenv_var_defs - \
+ | sed -e 's/[[:blank:]]*$//g' \
> "$ccenv_mk"
if [ "$ccenv_cfgtype" = 'host' ]; then