summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-17 10:00:59 +0000
committermidipix <writeonce@midipix.org>2021-04-17 13:49:37 +0000
commitb8b6e8076321d61845308f87d0b5855c1329239d (patch)
tree09621c1090d9b1a168b6f6d670993afec07f5a49
parent035c67415fb731dfde8c0ff2d58c0f30b26d7a62 (diff)
downloadu16ports-b8b6e8076321d61845308f87d0b5855c1329239d.tar.bz2
u16ports-b8b6e8076321d61845308f87d0b5855c1329239d.tar.xz
build system: configure: config_copy(): enhanced Makefile generation.
-rwxr-xr-xconfigure33
1 files changed, 21 insertions, 12 deletions
diff --git a/configure b/configure
index a95494c..a100d6d 100755
--- a/configure
+++ b/configure
@@ -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
}