Backport #633 from trunk: 1.1
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu May 15 21:00:06 2008 +0000 (2008-05-15)
branch1.1
changeset 5133a50cce6d3ce
parent 512 be875e19bc28
child 514 c39968cde052
Backport #633 from trunk:
Sanitise and use CT_CC_NATIVE.
Comment inclusion of scripts/functions.

/branches/1.1/scripts/build/cc_gcc.sh | 6 6 0 0 ++++++
/branches/1.1/scripts/crosstool.sh | 7 6 1 0 ++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
scripts/build/cc_gcc.sh
scripts/crosstool.sh
     1.1 --- a/scripts/build/cc_gcc.sh	Thu May 15 20:56:53 2008 +0000
     1.2 +++ b/scripts/build/cc_gcc.sh	Thu May 15 21:00:06 2008 +0000
     1.3 @@ -65,6 +65,7 @@
     1.4      CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
     1.5  
     1.6      # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
     1.7 +    CC_FOR_BUILD="${CT_CC_NATIVE}"                  \
     1.8      CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
     1.9      "${CT_SRC_DIR}/${CT_CC_FILE}/configure"         \
    1.10          ${CT_CANADIAN_OPT}                          \
    1.11 @@ -81,6 +82,7 @@
    1.12          --enable-symvers=gnu                        \
    1.13          --enable-languages=c                        \
    1.14          --disable-shared                            \
    1.15 +        --enable-target-optspace                    \
    1.16          ${CT_CC_CORE_EXTRA_CONFIG}                  2>&1 |CT_DoLog ALL
    1.17  
    1.18      if [ "${CT_CANADIAN}" = "y" ]; then
    1.19 @@ -117,6 +119,7 @@
    1.20  
    1.21      CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
    1.22  
    1.23 +    CC_FOR_BUILD="${CT_CC_NATIVE}"                  \
    1.24      CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    1.25      "${CT_SRC_DIR}/${CT_CC_FILE}/configure"         \
    1.26          ${CT_CANADIAN_OPT}                          \
    1.27 @@ -131,6 +134,7 @@
    1.28          --enable-symvers=gnu                        \
    1.29          --enable-languages=c                        \
    1.30          --enable-shared                             \
    1.31 +        --enable-target-optspace                    \
    1.32          ${CT_CC_CORE_EXTRA_CONFIG}                  2>&1 |CT_DoLog ALL
    1.33  
    1.34      # HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or
    1.35 @@ -225,6 +229,7 @@
    1.36      # detection problem only matters for gcc-3.2.x and later, I think.
    1.37      # --disable-nls to work around crash bug on ppc405, but also because
    1.38      # embedded systems don't really need message catalogs...
    1.39 +    CC_FOR_BUILD="${CT_CC_NATIVE}"              \
    1.40      CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
    1.41      TARGET_CFLAGS="${CT_TARGET_CFLAGS}"         \
    1.42      "${CT_SRC_DIR}/${CT_CC_FILE}/configure"     \
    1.43 @@ -239,6 +244,7 @@
    1.44          --enable-symvers=gnu                    \
    1.45          --enable-c99                            \
    1.46          --enable-long-long                      \
    1.47 +        --enable-target-optspace                \
    1.48          ${CT_CC_EXTRA_CONFIG}                   2>&1 |CT_DoLog ALL
    1.49  
    1.50      if [ "${CT_CANADIAN}" = "y" ]; then
     2.1 --- a/scripts/crosstool.sh	Thu May 15 20:56:53 2008 +0000
     2.2 +++ b/scripts/crosstool.sh	Thu May 15 21:00:06 2008 +0000
     2.3 @@ -13,6 +13,11 @@
     2.4  # and builds the tools.
     2.5  
     2.6  # Parse the common functions
     2.7 +# Note: some initialisation and sanitizing is done while parsing this file,
     2.8 +# most notably:
     2.9 +#  - set trap handler on errors,
    2.10 +#  - don't hash commands lookups,
    2.11 +#  - initialise logging.
    2.12  . "${CT_LIB_DIR}/scripts/functions"
    2.13  
    2.14  CT_STAR_DATE=`CT_DoDate +%s%N`
    2.15 @@ -386,7 +391,7 @@
    2.16      # Do that:
    2.17      CT_DoLog DEBUG "Making build system tools available"
    2.18      mkdir -p "${CT_PREFIX_DIR}/bin"
    2.19 -    for tool in ar as dlltool gcc g++ gnatbind gnatmake ld nm ranlib strip windres objcopy objdump; do
    2.20 +    for tool in ar as dlltool ${CT_CC_NATIVE:=gcc} gnatbind gnatmake ld nm ranlib strip windres objcopy objdump; do
    2.21          tmp=`CT_Which ${tool}`
    2.22          if [ -n "${tmp}" ]; then
    2.23              ln -sfv "${tmp}" "${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}"