summaryrefslogtreecommitdiffhomepage
path: root/configure
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-17 07:58:05 +0000
committermidipix <writeonce@midipix.org>2021-04-17 08:20:05 +0000
commitd196b79b2ca6a6e77fc1c2def1be7892b85ab70e (patch)
treea30bfb8456e201be2fde4d5f70888cd9083099e2 /configure
parenta4b8e34b6dba7a80fcec72c00b1178da894e97ee (diff)
downloadntux-d196b79b2ca6a6e77fc1c2def1be7892b85ab70e.tar.bz2
ntux-d196b79b2ca6a6e77fc1c2def1be7892b85ab70e.tar.xz
build system: configure: enhanced and corrected cmdline logging.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure39
1 files changed, 27 insertions, 12 deletions
diff --git a/configure b/configure
index 510dc3d..a95494c 100755
--- a/configure
+++ b/configure
@@ -100,12 +100,6 @@ init_log()
printf "This is config.log, generated by sofort's configure script.\n\n" >&3
printf '$ %s' "$mb_script" >&3
-
- for arg in $mb_args; do
- printf ' %s' "$arg" >&3
- done
-
- printf '\n\n' >&3
}
init_vars()
@@ -847,16 +841,37 @@ config_success()
# one: init
-mb_args=
-mb_args_space=
+mb_args_defs=
+mb_args_text=
+mb_args_idx=0
+
+init_log
for arg ; do
- mb_escaped_arg=\'$(printf '%s\n' "$arg" | sed -e "s/'/'\\\\''/g")\'
- mb_args="$mb_args$mb_args_space$mb_escaped_arg"
- mb_args_space=' '
+ mb_args_idx=$((mb_args_idx+1))
+
+ mb_arg_def=$(printf '%s%s="${%s}"' "-D_" "${mb_args_idx}" "${mb_args_idx}")
+ eval mb_args_defs='"$mb_args_defs "$mb_arg_def'
+
+ mb_args_text="$mb_args_text '_$((mb_args_idx))'"
done
-init_log
+printf "$mb_args_text\n\n" | eval m4 $mb_args_defs - >&3
+
+if [ $mb_args_idx -gt 1 ]; then
+ printf '$ %s' "$mb_script" >&3
+
+ mb_args_idx=0
+ mb_args_text=
+
+ for arg; do
+ mb_args_idx=$((mb_args_idx+1))
+ mb_args_text="$mb_args_text"$(printf ' \\\\\n\t%s_%d%s' "'" "$mb_args_idx" "'")
+ done
+
+ printf "$mb_args_text\n\n" | eval m4 $mb_args_defs - >&3
+fi
+
init_vars
verify_build_directory