# HG changeset patch # User "Yann E. MORIN" # Date 1311528924 -7200 # Node ID 369e2fbe9010a1911d61b56c977d2c94949daef9 # Parent 0b594b10c63bb4272c7d530515f82d9b177a232f cc-gcc: the frontends are responsible for mkdir/chdir The build dir are created depending on the host (host for that specific backend, not host for the toolchain). Only the frontends know what host this is, so only the frontends can create non-ambiguous dirs. Signed-off-by: "Yann E. MORIN" diff -r 0b594b10c63b -r 369e2fbe9010 scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Sun Jan 01 17:35:10 2012 +0100 +++ b/scripts/build/cc/gcc.sh Sun Jul 24 19:35:24 2011 +0200 @@ -79,7 +79,13 @@ esac if [ "${do_core}" = "y" ]; then + CT_DoStep INFO "Installing pass-1 core C compiler" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-core-pass-1" + do_cc_core_backend "${core_opts[@]}" + + CT_Popd + CT_EndStep fi } @@ -136,7 +142,13 @@ esac if [ "${do_core}" = "y" ]; then + CT_DoStep INFO "Installing pass-2 core C compiler" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-core-pass-2" + do_cc_core_backend "${core_opts[@]}" + + CT_Popd + CT_EndStep fi } @@ -177,6 +189,8 @@ eval "${arg// /\\ }" done + CT_DoLog EXTRA "Configuring core C compiler" + lang_opt=c case "${mode}" in static) @@ -202,10 +216,6 @@ ;; esac - CT_DoStep INFO "Installing ${mode} core C compiler" - mkdir -p "${CT_BUILD_DIR}/build-cc-core-${mode}" - cd "${CT_BUILD_DIR}/build-cc-core-${mode}" - if [ "${CT_CC_GCC_HAS_PKGVERSION_BUGURL}" = "y" ]; then # Bare metal delivers the core compiler as final compiler, so add version info and bugurl extra_config+=("--with-pkgversion=${CT_PKGVERSION}") @@ -217,8 +227,6 @@ CT_DoExecLog ALL cp -a "${CT_HEADERS_DIR}" "${prefix}/${CT_TARGET}/include" fi - CT_DoLog EXTRA "Configuring ${mode} core C compiler" - for tmp in ARCH ABI CPU TUNE FPU FLOAT; do eval tmp="\${CT_ARCH_WITH_${tmp}}" if [ -n "${tmp}" ]; then @@ -434,10 +442,10 @@ core_targets+=( target-libstdc++-v3 ) fi - CT_DoLog EXTRA "Building ${mode} core C compiler" + CT_DoLog EXTRA "Building core C compiler" CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/all-}" - CT_DoLog EXTRA "Installing ${mode} core C compiler" + CT_DoLog EXTRA "Installing core C compiler" CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/install-}" if [ "${build_manuals}" = "yes" ]; then @@ -468,8 +476,6 @@ CT_DoLog WARN "gcc configured for multilib, but none available" fi fi - - CT_EndStep } #------------------------------------------------------------------------------ @@ -497,7 +503,13 @@ final_backend=do_cc_backend fi + CT_DoStep INFO "Installing final compiler" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-final" + "${final_backend}" "${final_opts[@]}" + + CT_Popd + CT_EndStep } #------------------------------------------------------------------------------ @@ -521,15 +533,10 @@ local tmp local arg - CT_DoStep INFO "Installing final compiler" - for arg in "$@"; do eval "${arg// /\\ }" done - mkdir -p "${CT_BUILD_DIR}/build-cc" - cd "${CT_BUILD_DIR}/build-cc" - CT_DoLog EXTRA "Configuring final compiler" # Enable selected languages @@ -784,6 +791,4 @@ CT_DoLog WARN "gcc configured for multilib, but none available" fi fi - - CT_EndStep }