Better handle the second pass core gcc build, differentiating between gcc prior to 4.3 with gcc from 4.3.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Sep 30 18:19:18 2008 +0000 (2008-09-30)
changeset 892187d34a9adf4
parent 891 4d770d1f65a0
child 893 c4f2c434448c
Better handle the second pass core gcc build, differentiating between gcc prior to 4.3 with gcc from 4.3.
Simplify detecting wether gcc is 4.3 and later, or older than 4.3 (we already know from .config).

/trunk/scripts/build/cc/gcc.sh | 22 13 9 0 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
scripts/build/cc/gcc.sh
     1.1 --- a/scripts/build/cc/gcc.sh	Mon Sep 29 20:51:16 2008 +0000
     1.2 +++ b/scripts/build/cc/gcc.sh	Tue Sep 30 18:19:18 2008 +0000
     1.3 @@ -43,12 +43,20 @@
     1.4  do_cc_core_pass_2() {
     1.5      # In case we're building for bare metal, do nothing, we already have
     1.6      # our compiler.
     1.7 -    # In case we're NPTL, build the shared core gcc.
     1.8 -    # In any other case, build the static core gcc and the target libgcc.
     1.9 +    # In case we're NPTL, build the shared core gcc and the target libgcc.
    1.10 +    # In any other case, build the static core gcc and, if using gcc-4.3+,
    1.11 +    # also build the target libgcc.
    1.12      case "${CT_BARE_METAL},${CT_THREADS}" in
    1.13          y,*)    ;;
    1.14 -        ,nptl)  do_cc_core mode=shared build_libgcc=yes;;
    1.15 -        *)      do_cc_core mode=static build_libgcc=no;;
    1.16 +        ,nptl)
    1.17 +            do_cc_core mode=shared build_libgcc=yes
    1.18 +            ;;
    1.19 +        *)  if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
    1.20 +                do_cc_core mode=static build_libgcc=yes
    1.21 +            else
    1.22 +                do_cc_core mode=static build_libgcc=no
    1.23 +            fi
    1.24 +            ;;
    1.25      esac
    1.26  }
    1.27  
    1.28 @@ -171,11 +179,7 @@
    1.29          # Starting with GCC 4.3, libgcc.mk is no longer built,
    1.30          # and libgcc.mvars is used instead.
    1.31  
    1.32 -        gcc_version_major=$(echo ${CT_CC_VERSION} |sed -r -e 's/^([^\.]+)\..*/\1/')
    1.33 -        gcc_version_minor=$(echo ${CT_CC_VERSION} |sed -r -e 's/^[^\.]+\.([^.]+).*/\1/')
    1.34 -
    1.35 -        if [    ${gcc_version_major} -eq 4 -a ${gcc_version_minor} -ge 3    \
    1.36 -             -o ${gcc_version_major} -gt 4                                  ]; then
    1.37 +        if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
    1.38              libgcc_rule="libgcc.mvars"
    1.39              build_rules="all-gcc all-target-libgcc"
    1.40              install_rules="install-gcc install-target-libgcc"