diff options
author | midipix <writeonce@midipix.org> | 2021-04-17 10:00:59 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2021-04-17 13:49:29 +0000 |
commit | 81cdcf4073f7b53ce06fb07a7636d430a1cb913b (patch) | |
tree | b685ef53c5b1466896e24aa8fd3db0c8ef644136 | |
parent | 858b3f87610827aa33bbe5118b35e606b5ef8a04 (diff) | |
download | apimagic-81cdcf4073f7b53ce06fb07a7636d430a1cb913b.tar.bz2 apimagic-81cdcf4073f7b53ce06fb07a7636d430a1cb913b.tar.xz |
build system: configure: config_copy(): enhanced Makefile generation.
-rwxr-xr-x | configure | 33 |
1 files changed, 21 insertions, 12 deletions
@@ -715,19 +715,28 @@ config_copy() { output_step_prolog ${mb_script} 'config_copy' + mb_var_defs= + mb_sed_substs= + mb_vars=$(cut -d'=' -f1 "$sfrt_config_vars" "$sfrt_opt_vars" \ - | grep -v '^#') - - mb_sed_substs=" \ - $(for __var in $(printf '%s' "$mb_vars"); do \ - printf '%s"$%s"%s' "-e 's^@$__var@^'" \ - "mb_$__var" "'^g' "; \ - done)" - - eval sed $mb_sed_substs \ - $mb_project_dir/Makefile.in \ - | sed -e 's/[[:blank:]]*$//g' \ - > $mb_pwd/Makefile.tmp + | grep -v '^#'); + + for __var in $(printf '%s' "$mb_vars"); do + mb_sed_subst=$(printf '%s %s%s%s' \ + '-e' "'s^@$__var@" \ + "^___${__var}___" \ + "^g'") + + mb_sed_substs="$mb_sed_substs $mb_sed_subst" + + mb_var_def=$(printf '%s%s="${%s}"' "-D" "___${__var}___" "mb_${__var}") + eval mb_var_defs='"$mb_var_defs "$mb_var_def' + done + + eval sed $mb_sed_substs $mb_project_dir/Makefile.in \ + | eval m4 $mb_var_defs - \ + | sed -e 's/[[:blank:]]*$//g' \ + > $mb_pwd/Makefile.tmp output_step_epilog } |