scripts/build/cc/gcc.sh
changeset 965 45ddf096def1
parent 887 0a8cc9d782de
child 1007 ed04e10c2d76
     1.1 --- a/scripts/build/cc/gcc.sh	Mon Sep 29 12:02:47 2008 +0000
     1.2 +++ b/scripts/build/cc/gcc.sh	Thu Oct 23 13:45:48 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"