From 6f265407392a9740c45c935aedeaa16e808e6b07 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 3 Jan 2020 23:57:22 +0000 Subject: build system: config.log: initial implementation. --- configure | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 607a974..1ce2ee8 100755 --- a/configure +++ b/configure @@ -52,6 +52,8 @@ output_step_prolog() mb_line_dots="${mb_line_dots}${mb_line_dots}" mb_step_desc="${mb_package} : ${1##*/} : ${2}() " mb_step_dlen="$((${#mb_line_dots} - ${#mb_step_desc}))" + + printf "configure step: ${2}()\n" >&3 printf "%s%${mb_step_dlen}.${mb_step_dlen}s " "${mb_step_desc}" "${mb_line_dots}" } @@ -64,6 +66,8 @@ output_script_status() { mb_step_name="${1##*/} : ${2}" mb_step_desc="${mb_package} : ${mb_step_name}" + + printf "configure info: ${2}\n" >&3 printf "%s\n" "${mb_step_desc}" } @@ -87,6 +91,20 @@ verify_safe_path() esac } +init_log() +{ + exec 3> config.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() { mb_project_dir=$(cd -- "${mb_script%/*}/" ; pwd -P) @@ -506,7 +524,7 @@ config_custom() if [ _$mb_use_custom_cfgdefs = _yes ]; then output_section_break output_script_status ${mb_script} \ - 'invoking project-specific cfgdefs.sh ==>' + 'invoking project-specific cfgdefs.sh' eval . $mb_project_dir/project/config/cfgdefs.sh \ "$mb_custom_cfgdefs_args" @@ -518,7 +536,7 @@ config_custom() if [ _$mb_use_custom_usrdefs = _yes ]; then output_section_break output_script_status ${mb_scirpt} \ - 'invoking project-specific usrdefs.sh ==>' + 'invoking project-specific usrdefs.sh' . $mb_project_dir/project/usrdefs.sh output_section_break @@ -574,6 +592,8 @@ config_failure() return 0 fi + printf 'configure info: exiting due to an error.\n' >&3 + if [ -f Makefile ]; then mb_error='failed to use the generated Makefile.' printf '\n%s: error: %s\n' "${0}" "$mb_error" >&2 @@ -593,6 +613,16 @@ config_success() # one: init +mb_args= +mb_args_space= + +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=' ' +done + +init_log init_vars verify_build_directory -- cgit v1.2.3