From 4f906926d0af8278575cf6b03e87da59c9dcc186 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 13 Jun 2021 09:09:23 +0000 Subject: project: cfgdefs.sh: cfgdefs_bootstrap(): enhanced output and logging. --- config.project | 2 +- project/config/cfgdefs.sh | 48 ++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/config.project b/config.project index 51cf470..2ab3f98 100644 --- a/config.project +++ b/config.project @@ -70,5 +70,5 @@ mb_default_ldflags_last= mb_default_ldflags_once= # native -mb_default_native_cflags="\$(_NATIVE_CFLAGS_std_c99) -D_XOPEN_SOURCE=700 -D_GNU_SOURCE" +mb_default_native_cflags="-D_XOPEN_SOURCE=700 -D_GNU_SOURCE" mb_default_native_ldflags= diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh index 42096ef..34bd609 100644 --- a/project/config/cfgdefs.sh +++ b/project/config/cfgdefs.sh @@ -40,49 +40,79 @@ cfgdefs_bootstrap() cfgdefs_sources="$cfgdefs_sources lst.c main.c make_malloc.c meta.c metachar.c parse.c" cfgdefs_sources="$cfgdefs_sources str.c suff.c targ.c trace.c util.c var.c" - cfgdefs_cflags="-I${mb_source_dir}/src/internal" + cfgdefs_cflags= + cfgdefs_cflags="$cfgdefs_cflags -I${mb_source_dir}/src/internal" cfgdefs_cflags="$cfgdefs_cflags -D_PATH_DEFSYSPATH=\"${mb_source_dir}/mk\"" cfgdefs_cflags="$cfgdefs_cflags $cfgdefs_added_defs" + cfgtest_native_section + + if cfgtest_compiler_switch -std=c99; then + cfgdefs_cflags="$cfgdefs_cflags -std=c99" + fi + cfgdefs_make="$mb_pwd/bootstrap/make" mkdir -p "$mb_pwd/bootstrap" - printf '\n\n' + output_section_break + output_script_status 'bootstrapping' './bootstrap/make' for src in $cfgdefs_utilsrc; do obj=${src%%.c}.o cfgdefs_objs="$cfgdefs_objs $mb_pwd/bootstrap/${obj}" - set -x + output_step_prolog 'compiling' "./bootstrap/${obj}" + + printf '\n$ %s %s\n' "$mb_native_cc $cfgdefs_cflags" '\' >&3 + printf '\t-c %s %s\n' "$mb_source_dir/src/${src}" '\' >&3 + printf '\t-o %s %s\n\n\n' "$mb_pwd/bootstrap/${obj}" >&3 "$mb_native_cc" $mb_native_cflags $cfgdefs_cflags \ -c "$mb_source_dir/src/${src}" \ - -o "$mb_pwd/bootstrap/${obj}" + -o "$mb_pwd/bootstrap/${obj}" \ + 2>&3 - set +x + output_step_epilog done for src in $cfgdefs_sources; do obj=${src%%.c}.o cfgdefs_objs="$cfgdefs_objs $mb_pwd/bootstrap/${obj}" - set -x + output_step_prolog 'compiling' "./bootstrap/${obj}" + + printf '\n$ %s %s\n' "$mb_native_cc $cfgdefs_cflags" '\' >&3 + printf '\t-c %s %s\n' "$mb_source_dir/src/logic/${src}" '\' >&3 + printf '\t-o %s %s\n\n\n' "$mb_pwd/bootstrap/${obj}" >&3 "$mb_native_cc" $mb_native_cflags $cfgdefs_cflags \ -c "$mb_source_dir/src/logic/${src}" \ - -o "$mb_pwd/bootstrap/${obj}" + -o "$mb_pwd/bootstrap/${obj}" \ + 2>&3 - set +x + output_step_epilog done + output_step_prolog 'linking' './bootstrap/make' + + printf '\n$ %s %s\n' "$mb_native_cc $cfgdefs_cflags" '\' >&3 + printf '\t %s %s\n' "$mb_native_ldflags" '\' >&3 + printf '\t %s %s\n' "$cfgdefs_objs" '\' >&3 + printf '\t-o %s %s\n\n\n' "$cfgdefs_make" >&3 + "$mb_native_cc" $mb_native_cflags $cfgdefs_cflags \ $mb_native_ldflags $cfgdefs_objs \ - -o "$cfgdefs_make" + -o "$cfgdefs_make" \ + 2>&3 + + output_step_epilog mb_make="$cfgdefs_make" cfgdefs_bootstrap_done='yes' + + output_section_break } -- cgit v1.2.3