summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-07-24 17:35:24 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-07-24 17:35:24 (GMT)
commitfec8e7b5661eaf31bdba2cb2d5b86998cacf0cb3 (patch)
treeaed9ad6406ddc780e00bf6d4bbf3283317d9012d /scripts
parent21b1d797066270d85bfe13eef1eff4fde7f14d48 (diff)
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/cc/gcc.sh39
1 files changed, 22 insertions, 17 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index b9f6c8e..a74500f 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -79,7 +79,13 @@ do_cc_core_pass_1() {
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 @@ do_cc_core_pass_2() {
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 @@ do_cc_core_backend() {
eval "${arg// /\\ }"
done
+ CT_DoLog EXTRA "Configuring core C compiler"
+
lang_opt=c
case "${mode}" in
static)
@@ -202,10 +216,6 @@ do_cc_core_backend() {
;;
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 @@ do_cc_core_backend() {
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 @@ do_cc_core_backend() {
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 @@ do_cc_core_backend() {
CT_DoLog WARN "gcc configured for multilib, but none available"
fi
fi
-
- CT_EndStep
}
#------------------------------------------------------------------------------
@@ -497,7 +503,13 @@ do_cc() {
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 @@ do_cc_backend() {
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 @@ do_cc_backend() {
CT_DoLog WARN "gcc configured for multilib, but none available"
fi
fi
-
- CT_EndStep
}