cc-gcc: the frontends are responsible for mkdir/chdir
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 24 19:35:24 2011 +0200 (2011-07-24)
changeset 2900369e2fbe9010
parent 2899 0b594b10c63b
child 2901 4fcedd2c14b2
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" <yann.morin.1998@anciens.enib.fr>
scripts/build/cc/gcc.sh
     1.1 --- a/scripts/build/cc/gcc.sh	Sun Jan 01 17:35:10 2012 +0100
     1.2 +++ b/scripts/build/cc/gcc.sh	Sun Jul 24 19:35:24 2011 +0200
     1.3 @@ -79,7 +79,13 @@
     1.4      esac
     1.5  
     1.6      if [ "${do_core}" = "y" ]; then
     1.7 +        CT_DoStep INFO "Installing pass-1 core C compiler"
     1.8 +        CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-core-pass-1"
     1.9 +
    1.10          do_cc_core_backend "${core_opts[@]}"
    1.11 +
    1.12 +        CT_Popd
    1.13 +        CT_EndStep
    1.14      fi
    1.15  }
    1.16  
    1.17 @@ -136,7 +142,13 @@
    1.18      esac
    1.19  
    1.20      if [ "${do_core}" = "y" ]; then
    1.21 +        CT_DoStep INFO "Installing pass-2 core C compiler"
    1.22 +        CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-core-pass-2"
    1.23 +
    1.24          do_cc_core_backend "${core_opts[@]}"
    1.25 +
    1.26 +        CT_Popd
    1.27 +        CT_EndStep
    1.28      fi
    1.29  }
    1.30  
    1.31 @@ -177,6 +189,8 @@
    1.32          eval "${arg// /\\ }"
    1.33      done
    1.34  
    1.35 +    CT_DoLog EXTRA "Configuring core C compiler"
    1.36 +
    1.37      lang_opt=c
    1.38      case "${mode}" in
    1.39          static)
    1.40 @@ -202,10 +216,6 @@
    1.41              ;;
    1.42      esac
    1.43  
    1.44 -    CT_DoStep INFO "Installing ${mode} core C compiler"
    1.45 -    mkdir -p "${CT_BUILD_DIR}/build-cc-core-${mode}"
    1.46 -    cd "${CT_BUILD_DIR}/build-cc-core-${mode}"
    1.47 -
    1.48      if [ "${CT_CC_GCC_HAS_PKGVERSION_BUGURL}" = "y" ]; then
    1.49          # Bare metal delivers the core compiler as final compiler, so add version info and bugurl
    1.50          extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
    1.51 @@ -217,8 +227,6 @@
    1.52          CT_DoExecLog ALL cp -a "${CT_HEADERS_DIR}" "${prefix}/${CT_TARGET}/include"
    1.53      fi
    1.54  
    1.55 -    CT_DoLog EXTRA "Configuring ${mode} core C compiler"
    1.56 -
    1.57      for tmp in ARCH ABI CPU TUNE FPU FLOAT; do
    1.58          eval tmp="\${CT_ARCH_WITH_${tmp}}"
    1.59          if [ -n "${tmp}" ]; then
    1.60 @@ -434,10 +442,10 @@
    1.61          core_targets+=( target-libstdc++-v3 )
    1.62      fi
    1.63  
    1.64 -    CT_DoLog EXTRA "Building ${mode} core C compiler"
    1.65 +    CT_DoLog EXTRA "Building core C compiler"
    1.66      CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/all-}"
    1.67  
    1.68 -    CT_DoLog EXTRA "Installing ${mode} core C compiler"
    1.69 +    CT_DoLog EXTRA "Installing core C compiler"
    1.70      CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/install-}"
    1.71  
    1.72      if [ "${build_manuals}" = "yes" ]; then
    1.73 @@ -468,8 +476,6 @@
    1.74              CT_DoLog WARN "gcc configured for multilib, but none available"
    1.75          fi
    1.76      fi
    1.77 -
    1.78 -    CT_EndStep
    1.79  }
    1.80  
    1.81  #------------------------------------------------------------------------------
    1.82 @@ -497,7 +503,13 @@
    1.83          final_backend=do_cc_backend
    1.84      fi
    1.85  
    1.86 +    CT_DoStep INFO "Installing final compiler"
    1.87 +    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-final"
    1.88 +
    1.89      "${final_backend}" "${final_opts[@]}"
    1.90 +
    1.91 +    CT_Popd
    1.92 +    CT_EndStep
    1.93  }
    1.94  
    1.95  #------------------------------------------------------------------------------
    1.96 @@ -521,15 +533,10 @@
    1.97      local tmp
    1.98      local arg
    1.99  
   1.100 -    CT_DoStep INFO "Installing final compiler"
   1.101 -
   1.102      for arg in "$@"; do
   1.103          eval "${arg// /\\ }"
   1.104      done
   1.105  
   1.106 -    mkdir -p "${CT_BUILD_DIR}/build-cc"
   1.107 -    cd "${CT_BUILD_DIR}/build-cc"
   1.108 -
   1.109      CT_DoLog EXTRA "Configuring final compiler"
   1.110  
   1.111      # Enable selected languages
   1.112 @@ -784,6 +791,4 @@
   1.113              CT_DoLog WARN "gcc configured for multilib, but none available"
   1.114          fi
   1.115      fi
   1.116 -
   1.117 -    CT_EndStep
   1.118  }