summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-07-25 17:04:00 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-07-25 17:04:00 (GMT)
commit4a8daa02e39e234aa03833287fcec3401d9932a4 (patch)
tree4c5c469fd28ee4b69d1bb6165cc34f3ff7edf6c0
parentae3b564fb808cd89098dbcab444b49b742ab53b2 (diff)
cc/gcc: cleanup the frontends
A few noop fix-ups: - fix the comments in core pass-1 - commonalise settings that can be Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rw-r--r--scripts/build/cc/gcc.sh56
1 files changed, 21 insertions, 35 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index 3d2cb5d..d1bb274 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -58,15 +58,13 @@ do_cc_core_pass_1() {
local -a core_opts
local do_core
- # If we're building for bare metal, build the static core gcc,
- # with libgcc.
- # In case we're not bare metal and building a canadian compiler, do nothing
- # In case we're not bare metal, and we're NPTL, build the static core gcc.
- # In any other case, do nothing.
- case "${CT_BARE_METAL},${CT_CANADIAN},${CT_THREADS}" in
- ,y,*)
+ # Do nothing for canadian-crosses, we already have a target compiler.
+ # We only need a pass-1 core gcc if the threading model is NPTL.
+ # For all other cases, it is not used.
+ case "${CT_CANADIAN},${CT_THREADS}" in
+ y,*)
;;
- ,,nptl)
+ ,nptl)
do_core=y
core_opts+=( "mode=static" )
core_opts+=( "host=${CT_BUILD}" )
@@ -74,8 +72,6 @@ do_cc_core_pass_1() {
core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
;;
- *)
- ;;
esac
if [ "${do_core}" = "y" ]; then
@@ -94,44 +90,34 @@ do_cc_core_pass_2() {
local -a core_opts
local do_core
- # In case we're building for bare metal, do nothing, we already have
- # our compiler.
- # In case we're not bare metal and building a canadian compiler, do nothing
- # In case we're NPTL, build the shared core gcc and the target libgcc.
- # In any other case, build the static core gcc and, if using gcc-4.3+,
- # also build the target libgcc.
+ # Common options:
+ core_opts+=( "host=${CT_BUILD}" )
core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
- case "${CT_BARE_METAL},${CT_CANADIAN},${CT_THREADS}" in
- y,*,*)
- do_core=y
- core_opts+=( "host=${CT_BUILD}" )
- core_opts+=( "mode=static" )
- core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
- core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
+ core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
+ core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
+
+ # Do nothing for canadian-crosses, we already have a target compiler.
+ # Different conditions are at stake here:
+ # - In case the threading model is NPTL, we need a shared-capable core
+ # gcc; in all other cases, we need a static-only core gcc.
+ # - In case the threading model is NPTL or win32, or gcc is 4.3 or
+ # later, we need to build libgcc
+ case "${CT_CANADIAN},${CT_THREADS}" in
+ y,*)
;;
- ,y,*) ;;
- ,,nptl)
+ ,nptl)
do_core=y
core_opts+=( "mode=shared" )
- core_opts+=( "host=${CT_BUILD}" )
core_opts+=( "build_libgcc=yes" )
- core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
- core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
;;
- ,,win32)
+ ,win32)
do_core=y
core_opts+=( "mode=static" )
- core_opts+=( "host=${CT_BUILD}" )
core_opts+=( "build_libgcc=yes" )
- core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
- core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
;;
*)
do_core=y
core_opts+=( "mode=static" )
- core_opts+=( "host=${CT_BUILD}" )
- core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
- core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
core_opts+=( "build_libgcc=yes" )
fi