Patchwork [1,of,1] cc/gcc: Split gcc configurations and functions from cc ones

login
register
mail settings
Submitter Yann Diorcet
Date July 9, 2013, 10:58 p.m.
Message ID <2a93f4221ba85bfb010f.1373410680@blackmint>
Download mbox | patch
Permalink /patch/257892/
State Superseded
Headers show

Comments

Yann Diorcet - July 9, 2013, 10:58 p.m.
# HG changeset patch
# User Yann Diorcet <diorcet.yann@gmail.com>
# Date 1373410674 -7200
# Node ID 2a93f4221ba85bfb010f088e13150f9e897c43a2
# Parent  2685dfa9de14fbe356ba76cb201bf5c039cf6860
cc/gcc: Split gcc configurations and functions from cc ones

Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com>


--
For unsubscribe information see http://sourceware.org/lists.html#faq
Daniel Price - July 10, 2013, 6:16 a.m.
On Tue, Jul 9, 2013 at 3:58 PM, Yann Diorcet <diorcet.yann@gmail.com> wrote:
> cc/gcc: Split gcc configurations and functions from cc ones
>
...
> -config CC_V_linaro_4_8
> +config CC_GCC_V_linaro_4_8
>      bool
>      prompt "linaro-4.8-2013.04"

Hi Yann,

Maybe I've misunderstood, but would this patch invalidate all existing
ct-ng configuration files?  Is there an upgrade path (even a sed
script would help) for existing configs?

        -dp

--
Daniel.Price@gmail.com; Twitter: @danielbprice

--
For unsubscribe information see http://sourceware.org/lists.html#faq
Yann Diorcet - July 10, 2013, 7:43 a.m.
Hi,

Indeed it will break configurations (new one will be ok).

Maybe we can provide a script like this one:

cat .config | sed  's/\([ _]\)CC_/\1CC_GCC_/g' | sed 's/GCC_GCC/GCC/g' > 
.config.new

Le 10/07/13 08:16, Daniel Price a écrit :
> On Tue, Jul 9, 2013 at 3:58 PM, Yann Diorcet <diorcet.yann@gmail.com> wrote:
>> cc/gcc: Split gcc configurations and functions from cc ones
>>
> ...
>> -config CC_V_linaro_4_8
>> +config CC_GCC_V_linaro_4_8
>>       bool
>>       prompt "linaro-4.8-2013.04"
> Hi Yann,
>
> Maybe I've misunderstood, but would this patch invalidate all existing
> ct-ng configuration files?  Is there an upgrade path (even a sed
> script would help) for existing configs?
>
>          -dp
>
> --
> Daniel.Price@gmail.com; Twitter: @danielbprice


--
For unsubscribe information see http://sourceware.org/lists.html#faq
Martin Guy - July 10, 2013, 8:50 a.m.
On 10 July 2013 09:43, Diorcet Yann <diorcet.yann@gmail.com> wrote:
>> Maybe I've misunderstood, but would this patch invalidate all existing
>> ct-ng configuration files?
>
> Indeed it will break configurations (new one will be ok).
>
> Maybe we can provide a script like this one:

Maybe you can make this automatic, so that it "just works".
If variable-does-not-exist-and-begins-with-CC_ ....

Otherwise you have to reconfigure and test all the examples...

your initiative is great, and thanks for the preview. I would suggest
that you finish your work before submitting patches, then when it
actually works with other compilers we cn evaluate whether there is
enough code in common to make it worth building one enormous
crosstool-ng, or whether it makes more sense to have one for each
compiler.

Thanks for sharing, let us know how it goes

   M

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Patch

diff -r 2685dfa9de14 -r 2a93f4221ba8 config/cc/gcc.in
--- a/config/cc/gcc.in	Thu May 23 17:51:15 2013 +0200
+++ b/config/cc/gcc.in	Wed Jul 10 00:57:54 2013 +0200
@@ -36,205 +36,205 @@ 
 # Don't remove next line
 # CT_INSERT_VERSION_BELOW
 
-config CC_V_linaro_4_8
+config CC_GCC_V_linaro_4_8
     bool
     prompt "linaro-4.8-2013.04"
     depends on CC_GCC_SHOW_LINARO
     select CC_GCC_4_8
 
-config CC_V_4_8_0
+config CC_GCC_V_4_8_0
     bool
     prompt "4.8.0"
     select CC_GCC_4_8
 
-config CC_V_linaro_4_7
+config CC_GCC_V_linaro_4_7
     bool
     prompt "linaro-4.7-2013.04"
     depends on CC_GCC_SHOW_LINARO
     select CC_GCC_4_7
 
-config CC_V_4_7_3
+config CC_GCC_V_4_7_3
     bool
     prompt "4.7.3"
     select CC_GCC_4_7
 
-config CC_V_4_7_2
+config CC_GCC_V_4_7_2
     bool
     prompt "4.7.2"
     select CC_GCC_4_7
 
-config CC_V_4_7_1
+config CC_GCC_V_4_7_1
     bool
     prompt "4.7.1"
     select CC_GCC_4_7
 
-config CC_V_4_7_0
+config CC_GCC_V_4_7_0
     bool
     prompt "4.7.0"
     select CC_GCC_4_7
 
-config CC_V_linaro_4_6
+config CC_GCC_V_linaro_4_6
     bool
     prompt "linaro-4.6-2013.04"
     depends on CC_GCC_SHOW_LINARO
     select CC_GCC_4_6
 
-config CC_V_4_6_4
+config CC_GCC_V_4_6_4
     bool
     prompt "4.6.4"
     select CC_GCC_4_6
 
-config CC_V_4_6_3
+config CC_GCC_V_4_6_3
     bool
     prompt "4.6.3"
     select CC_GCC_4_6
 
-config CC_V_4_6_2
+config CC_GCC_V_4_6_2
     bool
     prompt "4.6.2"
     select CC_GCC_4_6
 
-config CC_V_4_6_1
+config CC_GCC_V_4_6_1
     bool
     prompt "4.6.1"
     select CC_GCC_4_6
 
-config CC_V_4_6_0
+config CC_GCC_V_4_6_0
     bool
     prompt "4.6.0"
     select CC_GCC_4_6
 
-config CC_V_linaro_4_5
+config CC_GCC_V_linaro_4_5
     bool
     prompt "linaro-4.5-2012.03"
     depends on CC_GCC_SHOW_LINARO
     select CC_GCC_4_5
 
-config CC_V_4_5_3
+config CC_GCC_V_4_5_3
     bool
     prompt "4.5.3"
     select CC_GCC_4_5
 
-config CC_V_4_5_2
+config CC_GCC_V_4_5_2
     bool
     prompt "4.5.2"
     select CC_GCC_4_5
 
-config CC_V_4_5_1
+config CC_GCC_V_4_5_1
     bool
     prompt "4.5.1"
     select CC_GCC_4_5
 
-config CC_V_4_5_0
+config CC_GCC_V_4_5_0
     bool
     prompt "4.5.0"
     select CC_GCC_4_5
 
 
-config CC_V_linaro_4_4
+config CC_GCC_V_linaro_4_4
     bool
     prompt "linaro-4.4-2011.02-0"
     depends on CC_GCC_SHOW_LINARO
     select CC_GCC_4_4
 
-config CC_V_4_4_7
+config CC_GCC_V_4_4_7
     bool
     prompt "4.4.7"
     select CC_GCC_4_4
 
-config CC_V_4_4_6
+config CC_GCC_V_4_4_6
     bool
     prompt "4.4.6"
     select CC_GCC_4_4
 
-config CC_V_4_4_5
+config CC_GCC_V_4_4_5
     bool
     prompt "4.4.5"
     select CC_GCC_4_4
 
-config CC_V_4_4_4
+config CC_GCC_V_4_4_4
     bool
     prompt "4.4.4"
     select CC_GCC_4_4
 
-config CC_V_4_4_3
+config CC_GCC_V_4_4_3
     bool
     prompt "4.4.3"
     select CC_GCC_4_4
 
-config CC_V_4_4_2
+config CC_GCC_V_4_4_2
     bool
     prompt "4.4.2"
     select CC_GCC_4_4
 
-config CC_V_4_4_1
+config CC_GCC_V_4_4_1
     bool
     prompt "4.4.1"
     select CC_GCC_4_4
 
-config CC_V_4_4_0
+config CC_GCC_V_4_4_0
     bool
     prompt "4.4.0"
     select CC_GCC_4_4
 
-config CC_V_4_3_6
+config CC_GCC_V_4_3_6
     bool
     prompt "4.3.6"
     select CC_GCC_4_3
 
-config CC_V_4_3_5
+config CC_GCC_V_4_3_5
     bool
     prompt "4.3.5"
     select CC_GCC_4_3
 
-config CC_V_4_3_4
+config CC_GCC_V_4_3_4
     bool
     prompt "4.3.4"
     select CC_GCC_4_3
 
-config CC_V_4_3_3
+config CC_GCC_V_4_3_3
     bool
     prompt "4.3.3"
     select CC_GCC_4_3
 
-config CC_V_4_3_2
+config CC_GCC_V_4_3_2
     bool
     prompt "4.3.2"
     select CC_GCC_4_3
 
-config CC_V_4_3_1
+config CC_GCC_V_4_3_1
     bool
     prompt "4.3.1"
     select CC_GCC_4_3
 
-config CC_V_4_2_4
+config CC_GCC_V_4_2_4
     bool
     prompt "4.2.4"
     select CC_GCC_4_2
 
 # We need that one, it's the only version with avr32 support
 # because we have a patch for it
-config CC_V_4_2_2
+config CC_GCC_V_4_2_2
     bool
     prompt "4.2.2"
     select CC_GCC_4_2
 
-config CC_V_4_1_2
+config CC_GCC_V_4_1_2
     bool
     prompt "4.1.2 (OBSOLETE)"
     depends on OBSOLETE
 
-config CC_V_4_0_4
+config CC_GCC_V_4_0_4
     bool
     prompt "4.0.4 (OBSOLETE)"
     depends on OBSOLETE
 
-config CC_V_3_4_6
+config CC_GCC_V_3_4_6
     bool
     prompt "3.4.6 (OBSOLETE)"
     depends on OBSOLETE
 
-config CC_CUSTOM
+config CC_GCC_CUSTOM
     bool
     prompt "Custom gcc"
     depends on EXPERIMENTAL
@@ -242,9 +242,9 @@ 
 
 endchoice
 
-if CC_CUSTOM
+if CC_GCC_CUSTOM
 
-config CC_CUSTOM_LOCATION
+config CC_GCC_CUSTOM_LOCATION
     string
     prompt "Full path to custom gcc source"
     default ""
@@ -252,7 +252,7 @@ 
       Enter the path to the directory (or tarball) of your source for gcc,
       or leave blank to use default CT_CUSTOM_LOCATION_ROOT_DIR/gcc
 
-endif #CC_CUSTOM
+endif #CC_GCC_CUSTOM
 
 config CC_GCC_4_2
     bool
@@ -436,50 +436,50 @@ 
 config CC_GCC_HAS_LIBQUADMATH
     bool
 
-config CC_VERSION
+config CC_GCC_VERSION
     string
 # Don't remove next line
 # CT_INSERT_VERSION_STRING_BELOW
-    default "linaro-4.8-2013.04" if CC_V_linaro_4_8
-    default "4.8.0" if CC_V_4_8_0
-    default "linaro-4.7-2013.04" if CC_V_linaro_4_7
-    default "4.7.3" if CC_V_4_7_3
-    default "4.7.2" if CC_V_4_7_2
-    default "4.7.1" if CC_V_4_7_1
-    default "4.7.0" if CC_V_4_7_0
-    default "linaro-4.6-2013.04" if CC_V_linaro_4_6
-    default "4.6.4" if CC_V_4_6_4
-    default "4.6.3" if CC_V_4_6_3
-    default "4.6.2" if CC_V_4_6_2
-    default "4.6.1" if CC_V_4_6_1
-    default "4.6.0" if CC_V_4_6_0
-    default "linaro-4.5-2012.03" if CC_V_linaro_4_5
-    default "4.5.3" if CC_V_4_5_3
-    default "4.5.2" if CC_V_4_5_2
-    default "4.5.1" if CC_V_4_5_1
-    default "4.5.0" if CC_V_4_5_0
-    default "linaro-4.4-2011.02-0" if CC_V_linaro_4_4
-    default "4.4.7" if CC_V_4_4_7
-    default "4.4.6" if CC_V_4_4_6
-    default "4.4.5" if CC_V_4_4_5
-    default "4.4.4" if CC_V_4_4_4
-    default "4.4.3" if CC_V_4_4_3
-    default "4.4.2" if CC_V_4_4_2
-    default "4.4.1" if CC_V_4_4_1
-    default "4.4.0" if CC_V_4_4_0
-    default "4.3.6" if CC_V_4_3_6
-    default "4.3.5" if CC_V_4_3_5
-    default "4.3.4" if CC_V_4_3_4
-    default "4.3.3" if CC_V_4_3_3
-    default "4.3.2" if CC_V_4_3_2
-    default "4.3.1" if CC_V_4_3_1
-    default "4.3.0" if CC_V_4_3_0
-    default "4.2.4" if CC_V_4_2_4
-    default "4.2.2" if CC_V_4_2_2
-    default "4.1.2" if CC_V_4_1_2
-    default "4.0.4" if CC_V_4_0_4
-    default "3.4.6" if CC_V_3_4_6
-    default "custom" if CC_CUSTOM
+    default "linaro-4.8-2013.04" if CC_GCC_V_linaro_4_8
+    default "4.8.0" if CC_GCC_V_4_8_0
+    default "linaro-4.7-2013.04" if CC_GCC_V_linaro_4_7
+    default "4.7.3" if CC_GCC_V_4_7_3
+    default "4.7.2" if CC_GCC_V_4_7_2
+    default "4.7.1" if CC_GCC_V_4_7_1
+    default "4.7.0" if CC_GCC_V_4_7_0
+    default "linaro-4.6-2013.04" if CC_GCC_V_linaro_4_6
+    default "4.6.4" if CC_GCC_V_4_6_4
+    default "4.6.3" if CC_GCC_V_4_6_3
+    default "4.6.2" if CC_GCC_V_4_6_2
+    default "4.6.1" if CC_GCC_V_4_6_1
+    default "4.6.0" if CC_GCC_V_4_6_0
+    default "linaro-4.5-2012.03" if CC_GCC_V_linaro_4_5
+    default "4.5.3" if CC_GCC_V_4_5_3
+    default "4.5.2" if CC_GCC_V_4_5_2
+    default "4.5.1" if CC_GCC_V_4_5_1
+    default "4.5.0" if CC_GCC_V_4_5_0
+    default "linaro-4.4-2011.02-0" if CC_GCC_V_linaro_4_4
+    default "4.4.7" if CC_GCC_V_4_4_7
+    default "4.4.6" if CC_GCC_V_4_4_6
+    default "4.4.5" if CC_GCC_V_4_4_5
+    default "4.4.4" if CC_GCC_V_4_4_4
+    default "4.4.3" if CC_GCC_V_4_4_3
+    default "4.4.2" if CC_GCC_V_4_4_2
+    default "4.4.1" if CC_GCC_V_4_4_1
+    default "4.4.0" if CC_GCC_V_4_4_0
+    default "4.3.6" if CC_GCC_V_4_3_6
+    default "4.3.5" if CC_GCC_V_4_3_5
+    default "4.3.4" if CC_GCC_V_4_3_4
+    default "4.3.3" if CC_GCC_V_4_3_3
+    default "4.3.2" if CC_GCC_V_4_3_2
+    default "4.3.1" if CC_GCC_V_4_3_1
+    default "4.3.0" if CC_GCC_V_4_3_0
+    default "4.2.4" if CC_GCC_V_4_2_4
+    default "4.2.2" if CC_GCC_V_4_2_2
+    default "4.1.2" if CC_GCC_V_4_1_2
+    default "4.0.4" if CC_GCC_V_4_0_4
+    default "3.4.6" if CC_GCC_V_3_4_6
+    default "custom" if CC_GCC_CUSTOM
 
 config CC_LANG_JAVA_USE_ECJ
     bool
@@ -490,3 +490,4 @@ 
 # Fortran always requires GMP+MPFR, whatever the gcc version
 config CC_LANG_FORTRAN
     select CC_GCC_USE_GMP_MPFR
+
diff -r 2685dfa9de14 -r 2a93f4221ba8 config/cc/gcc.in.2
--- a/config/cc/gcc.in.2	Thu May 23 17:51:15 2013 +0200
+++ b/config/cc/gcc.in.2	Wed Jul 10 00:57:54 2013 +0200
@@ -1,6 +1,6 @@ 
 # gcc configuration options
 
-config CC_ENABLE_CXX_FLAGS
+config CC_GCC_ENABLE_CXX_FLAGS
     string
     prompt "Flags to pass to --enable-cxx-flags"
     default ""
@@ -11,7 +11,7 @@ 
       Note: just pass in the option _value_, that is only the part that goes
       after the '=' sign.
 
-config CC_CORE_EXTRA_CONFIG_ARRAY
+config CC_GCC_CORE_EXTRA_CONFIG_ARRAY
     string
     prompt "Core gcc extra config"
     default ""
@@ -25,7 +25,7 @@ 
       if they are properly quoted (or escaped, but prefer quotes). Eg.:
           --with-foo="1st arg with 4 spaces" --with-bar=2nd-arg-without-space
 
-config CC_EXTRA_CONFIG_ARRAY
+config CC_GCC_EXTRA_CONFIG_ARRAY
     string
     prompt "gcc extra config"
     default ""
@@ -38,9 +38,9 @@ 
           --with-foo="1st arg with 4 spaces" --with-bar=2nd-arg-without-space
 
 config STATIC_TOOLCHAIN
-    select CC_STATIC_LIBSTDCXX if CC_GCC_4_4_or_later
+    select CC_GCC_STATIC_LIBSTDCXX if CC_GCC_4_4_or_later
 
-config CC_STATIC_LIBSTDCXX
+config CC_GCC_STATIC_LIBSTDCXX
     bool
     prompt "Link libstdc++ statically into the gcc binary"
     default y
diff -r 2685dfa9de14 -r 2a93f4221ba8 scripts/build/cc.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/build/cc.sh	Wed Jul 10 00:57:54 2013 +0200
@@ -0,0 +1,59 @@ 
+# Wrapper to build the companion tools facilities
+
+# List all companion tools facilities, and parse their scripts
+CT_CC_FACILITY_LIST=
+for f in "${CT_LIB_DIR}/scripts/build/cc/"*.sh; do
+    _f="$(basename "${f}" .sh)"
+    _f="${_f#???-}"
+    __f="CT_CC_${_f}"
+    if [ "${!__f}" = "y" ]; then
+        CT_DoLog DEBUG "Enabling cc '${_f}'"
+        . "${f}"
+        CT_CC_FACILITY_LIST="${CT_CC_FACILITY_LIST} ${_f}"
+    else
+        CT_DoLog DEBUG "Disabling cc '${_f}'"
+    fi
+done
+
+# Download the cc facilities
+do_cc_get() {
+    for f in ${CT_CC_FACILITY_LIST}; do
+        do_${f}_get
+    done
+}
+
+# Extract and patch the cc facilities
+do_cc_extract() {
+    for f in ${CT_CC_FACILITY_LIST}; do
+        do_${f}_extract
+    done
+}
+
+# Core pass 1 the cc facilities
+do_cc_core_pass_1() {
+    for f in ${CT_CC_FACILITY_LIST}; do
+        do_${f}_core_pass_1
+    done
+}
+
+# Core pass 2 the cc facilities
+do_cc_core_pass_2() {
+	for f in ${CT_CC_FACILITY_LIST}; do
+        do_${f}_core_pass_2
+    done
+}
+
+# Build for build the cc facilities
+do_cc_for_build() {
+	for f in ${CT_CC_FACILITY_LIST}; do
+        do_${f}_for_build
+    done
+}
+
+# Build for host the cc facilities
+do_cc_for_host() {
+	for f in ${CT_CC_FACILITY_LIST}; do
+        do_${f}_for_host
+    done
+}
+
diff -r 2685dfa9de14 -r 2a93f4221ba8 scripts/build/cc/gcc.sh
--- a/scripts/build/cc/gcc.sh	Thu May 23 17:51:15 2013 +0200
+++ b/scripts/build/cc/gcc.sh	Wed Jul 10 00:57:54 2013 +0200
@@ -3,16 +3,16 @@ 
 # Licensed under the GPL v2. See COPYING in the root of this package
 
 # Download gcc
-do_cc_get() {
+do_gcc_get() {
     local linaro_version
     local linaro_series
     local linaro_base_url="http://launchpad.net/gcc-linaro"
 
-    if [ "${CT_CC_CUSTOM}" = "y" ]; then
-        CT_GetCustom "gcc" "${CT_CC_VERSION}" "${CT_CC_CUSTOM_LOCATION}"
+    if [ "${CT_CC_GCC_CUSTOM}" = "y" ]; then
+        CT_GetCustom "gcc" "${CT_CC_GCC_VERSION}" "${CT_CC_GCC_CUSTOM_LOCATION}"
     else
         # Account for the Linaro versioning
-        linaro_version="$( echo "${CT_CC_VERSION}"      \
+        linaro_version="$( echo "${CT_CC_GCC_VERSION}"  \
                            |sed -r -e 's/^linaro-//;'   \
                          )"
         linaro_series="$( echo "${linaro_version}"      \
@@ -24,12 +24,11 @@ 
         # Arrgghh! Some of those versions does not follow this convention:
         # gcc-3.3.3 lives in releases/gcc-3.3.3, while gcc-2.95.* isn't in a
         # subdirectory!
-        CT_GetFile "gcc-${CT_CC_VERSION}"                                                       \
-                   {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${CT_CC_VERSION}}         \
-                   ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${CT_CC_VERSION} \
-                   ftp://ftp.uvsq.fr/pub/gcc/snapshots/${CT_CC_VERSION}                         \
-                   "${linaro_base_url}/${linaro_series}/${linaro_version}/+download"
-
+        CT_GetFile "gcc-${CT_CC_GCC_VERSION}"                                                       \
+                   {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${CT_CC_GCC_VERSION}}         \
+                   ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${CT_CC_GCC_VERSION} \
+                   ftp://ftp.uvsq.fr/pub/gcc/snapshots/${CT_CC_GCC_VERSION}                         \
+                   "${linaro_base_url}/${linaro_series}/${linaro_version}/+download"                
     fi # ! custom location
     # Starting with GCC 4.3, ecj is used for Java, and will only be
     # built if the configure script finds ecj.jar at the top of the
@@ -42,21 +41,21 @@ 
 }
 
 # Extract gcc
-do_cc_extract() {
+do_gcc_extract() {
     # If using custom directory location, nothing to do
-    if [ "${CT_CC_CUSTOM}" = "y"                    \
-         -a -d "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}" ]; then
+    if [ "${CT_CC_GCC_CUSTOM}" = "y"                    \
+         -a -d "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}" ]; then
         return 0
     fi
 
-    CT_Extract "gcc-${CT_CC_VERSION}"
-    CT_Patch "gcc" "${CT_CC_VERSION}"
+    CT_Extract "gcc-${CT_CC_GCC_VERSION}"
+    CT_Patch "gcc" "${CT_CC_GCC_VERSION}"
 
     # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree
     if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y"                     \
-         -a ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar"   \
+         -a ! -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/ecj.jar"   \
        ]; then
-        CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar"
+        CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/ecj.jar"
     fi
 }
 
@@ -80,7 +79,7 @@ 
 
 #------------------------------------------------------------------------------
 # Core gcc pass 1
-do_cc_core_pass_1() {
+do_gcc_core_pass_1() {
     local -a core_opts
 
     if [ "${CT_CC_CORE_PASSES_NEEDED}" != "y" ]; then
@@ -95,17 +94,17 @@ 
     core_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
     core_opts+=( "lang_list=c" )
 
-    CT_DoStep INFO "Installing pass-1 core C compiler"
-    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-core-pass-1"
+    CT_DoStep INFO "Installing pass-1 core C gcc compiler"
+    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-gcc-core-pass-1"
 
-    do_cc_core_backend "${core_opts[@]}"
+    do_gcc_core_backend "${core_opts[@]}"
 
     CT_Popd
     CT_EndStep
 }
 
 # Core gcc pass 2
-do_cc_core_pass_2() {
+do_gcc_core_pass_2() {
     local -a core_opts
 
     if [ "${CT_CC_CORE_PASSES_NEEDED}" != "y" ]; then
@@ -142,10 +141,10 @@ 
             ;;
     esac
 
-    CT_DoStep INFO "Installing pass-2 core C compiler"
-    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-core-pass-2"
+    CT_DoStep INFO "Installing pass-2 core C gcc compiler"
+    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-gcc-core-pass-2"
 
-    do_cc_core_backend "${core_opts[@]}"
+    do_gcc_core_backend "${core_opts[@]}"
 
     CT_Popd
     CT_EndStep
@@ -154,7 +153,7 @@ 
 #------------------------------------------------------------------------------
 # Build core gcc
 # This function is used to build the core C compiler.
-# Usage: do_cc_core_backend param=value [...]
+# Usage: do_gcc_core_backend param=value [...]
 #   Parameter           : Definition                                : Type      : Default
 #   mode                : build a 'static', 'shared' or 'baremetal' : string    : (none)
 #   host                : the machine the core will run on          : tuple     : (none)
@@ -167,8 +166,8 @@ 
 #   build_manuals       : whether to build manuals or not           : bool      : no
 #   cflags              : cflags to use                             : string    : (empty)
 #   ldflags             : ldflags to use                            : string    : (empty)
-# Usage: do_cc_core_backend mode=[static|shared|baremetal] build_libgcc=[yes|no] build_staticlinked=[yes|no]
-do_cc_core_backend() {
+# Usage: do_gcc_core_backend mode=[static|shared|baremetal] build_libgcc=[yes|no] build_staticlinked=[yes|no]
+do_gcc_core_backend() {
     local mode
     local build_libgcc=no
     local build_libstdcxx=no
@@ -191,7 +190,7 @@ 
         eval "${arg// /\\ }"
     done
 
-    CT_DoLog EXTRA "Configuring gcc"
+    CT_DoLog EXTRA "Configuring core C gcc compiler"
 
     case "${mode}" in
         static)
@@ -243,7 +242,7 @@ 
 
     # *** WARNING ! ***
     # Keep this full if-else-if-elif-fi-fi block in sync
-    # with the same block in do_cc, below.
+    # with the same block in do_gcc, below.
     if [ "${build_staticlinked}" = "yes" ]; then
         core_LDFLAGS+=("-static")
         host_libstdcxx_flags+=("-static-libgcc")
@@ -368,21 +367,21 @@ 
     CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
 
     # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
-    CT_DoExecLog CFG                                \
-    CC_FOR_BUILD="${CT_BUILD}-gcc"                  \
-    CFLAGS="${cflags}"                              \
-    LDFLAGS="${core_LDFLAGS[*]}"                    \
-    "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure"  \
-        --build=${CT_BUILD}                         \
-        --host=${host}                              \
-        --target=${CT_TARGET}                       \
-        --prefix="${prefix}"                        \
-        --with-local-prefix="${CT_SYSROOT_DIR}"     \
-        --disable-libmudflap                        \
-        ${CC_CORE_SYSROOT_ARG}                      \
-        "${extra_config[@]}"                        \
-        --enable-languages="${lang_list}"           \
-        "${CT_CC_CORE_EXTRA_CONFIG_ARRAY[@]}"
+    CT_DoExecLog CFG                                    \
+    CC_FOR_BUILD="${CT_BUILD}-gcc"                      \
+    CFLAGS="${cflags}"                                  \
+    LDFLAGS="${core_LDFLAGS[*]}"                        \
+    "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/configure"  \
+        --build=${CT_BUILD}                             \
+        --host=${host}                                  \
+        --target=${CT_TARGET}                           \
+        --prefix="${prefix}"                            \
+        --with-local-prefix="${CT_SYSROOT_DIR}"         \
+        --disable-libmudflap                            \
+        ${CC_CORE_SYSROOT_ARG}                          \
+        "${extra_config[@]}"                            \
+        --enable-languages="${lang_list}"               \
+        "${CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY[@]}"
 
     if [ "${build_libgcc}" = "yes" ]; then
         # HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or
@@ -401,7 +400,7 @@ 
         # so we configure then build it.
         # Next we have to configure gcc, create libgcc.mk then edit it...
         # So much easier if we just edit the source tree, but hey...
-        if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then
+        if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ]; then
             CT_DoExecLog CFG make ${JOBSFLAGS} configure-libiberty
             CT_DoExecLog ALL make ${JOBSFLAGS} -C libiberty libiberty.a
             CT_DoExecLog CFG make ${JOBSFLAGS} configure-gcc configure-libcpp
@@ -411,12 +410,12 @@ 
             CT_DoExecLog ALL make ${JOBSFLAGS} all-libcpp all-build-libiberty
         fi
         # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
-        if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/libdecnumber" ]; then
+        if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/libdecnumber" ]; then
             CT_DoExecLog CFG make ${JOBSFLAGS} configure-libdecnumber
             CT_DoExecLog ALL make ${JOBSFLAGS} -C libdecnumber libdecnumber.a
         fi
         # HACK: gcc-4.8 uses libbacktrace to make libgcc.mvars, so make it here.
-        if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/libbacktrace" ]; then
+        if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/libbacktrace" ]; then
             CT_DoExecLog CFG make ${JOBSFLAGS} configure-libbacktrace
             CT_DoExecLog ALL make ${JOBSFLAGS} -C libbacktrace
         fi
@@ -456,16 +455,16 @@ 
         core_targets+=( target-libstdc++-v3 )
     fi
 
-    CT_DoLog EXTRA "Building gcc"
+    CT_DoLog EXTRA "Building core C gcc compiler"
     CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/all-}"
 
-    CT_DoLog EXTRA "Installing gcc"
+    CT_DoLog EXTRA "Installing core C gcc compiler"
     CT_DoExecLog ALL make ${JOBSFLAGS} "${core_targets[@]/#/install-}"
 
     if [ "${build_manuals}" = "yes" ]; then
-        CT_DoLog EXTRA "Building the GCC manuals"
+        CT_DoLog EXTRA "Building the gcc manuals"
         CT_DoExecLog ALL make pdf html
-        CT_DoLog EXTRA "Installing the GCC manuals"
+        CT_DoLog EXTRA "Installing the gcc manuals"
         CT_DoExecLog ALL make install-{pdf,html}-gcc
     fi
 
@@ -499,7 +498,7 @@ 
 
 #------------------------------------------------------------------------------
 # Build complete gcc to run on build
-do_cc_for_build() {
+do_gcc_for_build() {
     local -a build_final_opts
     local build_final_backend
 
@@ -523,13 +522,13 @@ 
         if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
             build_final_opts+=( "build_staticlinked=yes" )
         fi
-        build_final_backend=do_cc_core_backend
+        build_final_backend=do_gcc_core_backend
     else
-        build_final_backend=do_cc_backend
+        build_final_backend=do_gcc_backend
     fi
 
-    CT_DoStep INFO "Installing final compiler for build"
-    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-final-build-${CT_BUILD}"
+    CT_DoStep INFO "Installing final gcc compiler for build"
+    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-gcc-final-build-${CT_BUILD}"
 
     "${build_final_backend}" "${build_final_opts[@]}"
 
@@ -539,7 +538,7 @@ 
 
 #------------------------------------------------------------------------------
 # Build final gcc to run on host
-do_cc_for_host() {
+do_gcc_for_host() {
     local -a final_opts
     local final_backend
 
@@ -559,13 +558,13 @@ 
         if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
             final_opts+=( "build_staticlinked=yes" )
         fi
-        final_backend=do_cc_core_backend
+        final_backend=do_gcc_core_backend
     else
-        final_backend=do_cc_backend
+        final_backend=do_gcc_backend
     fi
 
-    CT_DoStep INFO "Installing final compiler"
-    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-final"
+    CT_DoStep INFO "Installing final gcc compiler"
+    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-gcc-final"
 
     "${final_backend}" "${final_opts[@]}"
 
@@ -575,7 +574,7 @@ 
 
 #------------------------------------------------------------------------------
 # Build the final gcc
-# Usage: do_cc_backend param=value [...]
+# Usage: do_gcc_backend param=value [...]
 #   Parameter     : Definition                          : Type      : Default
 #   host          : the host we run onto                : tuple     : (none)
 #   prefix        : the runtime prefix                  : dir       : (none)
@@ -584,7 +583,7 @@ 
 #   ldflags       : ldflags to use                      : string    : (empty)
 #   lang_list     : the list of languages to build      : string    : (empty)
 #   build_manuals : whether to build manuals or not     : bool      : no
-do_cc_backend() {
+do_gcc_backend() {
     local host
     local prefix
     local complibs
@@ -602,7 +601,7 @@ 
         eval "${arg// /\\ }"
     done
 
-    CT_DoLog EXTRA "Configuring gcc"
+    CT_DoLog EXTRA "Configuring final gcc compiler"
 
     # Enable selected languages
     extra_config+=("--enable-languages=${lang_list}")
@@ -629,8 +628,8 @@ 
     else
         extra_config+=("--disable-__cxa_atexit")
     fi
-    if [ -n "${CT_CC_ENABLE_CXX_FLAGS}" ]; then
-        extra_config+=("--enable-cxx-flags=${CT_CC_ENABLE_CXX_FLAGS}")
+    if [ -n "${CT_CC_GCC_ENABLE_CXX_FLAGS}" ]; then
+        extra_config+=("--enable-cxx-flags=${CT_CC_GCC_ENABLE_CXX_FLAGS}")
     fi
     if [ "${CT_CC_GCC_LIBMUDFLAP}" = "y" ]; then
         extra_config+=(--enable-libmudflap)
@@ -661,7 +660,7 @@ 
 
     # *** WARNING ! ***
     # Keep this full if-else-if-elif-fi-fi block in sync
-    # with the same block in do_cc_core, above.
+    # with the same block in do_gcc_core, above.
     if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
         final_LDFLAGS+=("-static")
         host_libstdcxx_flags+=("-static-libgcc")
@@ -674,7 +673,7 @@ 
         final_LDFLAGS+=("-lstdc++")
         final_LDFLAGS+=("-lm")
     else
-        if [ "${CT_CC_STATIC_LIBSTDCXX}" = "y" ]; then
+        if [ "${CT_CC_GCC_STATIC_LIBSTDCXX}" = "y" ]; then
             # this is from CodeSourcery arm-2010q1-202-arm-none-linux-gnueabi.src.tar.bz2
             # build script
             # INFO: if the host gcc is gcc-4.5 then presumably we could use -static-libstdc++,
@@ -803,40 +802,40 @@ 
 
     CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
 
-    CT_DoExecLog CFG                                \
-    CC_FOR_BUILD="${CT_BUILD}-gcc"                  \
-    CFLAGS="${cflags}"                              \
-    LDFLAGS="${final_LDFLAGS[*]}"                   \
-    CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"         \
-    CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"       \
-    LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}"       \
-    "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure"  \
-        --build=${CT_BUILD}                         \
-        --host=${host}                              \
-        --target=${CT_TARGET}                       \
-        --prefix="${prefix}"                        \
-        ${CC_SYSROOT_ARG}                           \
-        "${extra_config[@]}"                        \
-        --with-local-prefix="${CT_SYSROOT_DIR}"     \
-        --enable-c99                                \
-        --enable-long-long                          \
-        "${CT_CC_EXTRA_CONFIG_ARRAY[@]}"
+    CT_DoExecLog CFG                                    \
+    CC_FOR_BUILD="${CT_BUILD}-gcc"                      \
+    CFLAGS="${cflags}"                                  \
+    LDFLAGS="${final_LDFLAGS[*]}"                       \
+    CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"             \
+    CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"           \
+    LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}"           \
+    "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/configure"  \
+        --build=${CT_BUILD}                             \
+        --host=${host}                                  \
+        --target=${CT_TARGET}                           \
+        --prefix="${prefix}"                            \
+        ${CC_SYSROOT_ARG}                               \
+        "${extra_config[@]}"                            \
+        --with-local-prefix="${CT_SYSROOT_DIR}"         \
+        --enable-c99                                    \
+        --enable-long-long                              \
+        "${CT_CC_GCC_EXTRA_CONFIG_ARRAY[@]}"
 
     if [ "${CT_CANADIAN}" = "y" ]; then
         CT_DoLog EXTRA "Building libiberty"
         CT_DoExecLog ALL make ${JOBSFLAGS} all-build-libiberty
     fi
 
-    CT_DoLog EXTRA "Building gcc"
+    CT_DoLog EXTRA "Building final gcc compiler"
     CT_DoExecLog ALL make ${JOBSFLAGS} all
 
-    CT_DoLog EXTRA "Installing gcc"
+    CT_DoLog EXTRA "Installing final gcc compiler"
     CT_DoExecLog ALL make ${JOBSFLAGS} install
 
     if [ "${build_manuals}" = "yes" ]; then
-        CT_DoLog EXTRA "Building the GCC manuals"
+        CT_DoLog EXTRA "Building the gcc manuals"
         CT_DoExecLog ALL make pdf html
-        CT_DoLog EXTRA "Installing the GCC manuals"
+        CT_DoLog EXTRA "Installing the gcc manuals"
         CT_DoExecLog ALL make install-{pdf,html}-gcc
     fi
 
diff -r 2685dfa9de14 -r 2a93f4221ba8 scripts/build/debug/300-gdb.sh
--- a/scripts/build/debug/300-gdb.sh	Thu May 23 17:51:15 2013 +0200
+++ b/scripts/build/debug/300-gdb.sh	Wed Jul 10 00:57:54 2013 +0200
@@ -181,11 +181,11 @@ 
         if [ "${CT_GDB_INSTALL_GDBINIT}" = "y" ]; then
             CT_DoLog EXTRA "Installing '.gdbinit' template"
             # See in scripts/build/internals.sh for why we do this
-            if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then
-                gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" )
+            if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ]; then
+                gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" )
             else
-                gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \
-                                   "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/version.c"   \
+                gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;'     \
+                                   "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/version.c"   \
                              )
             fi
             ${sed} -r                                               \
diff -r 2685dfa9de14 -r 2a93f4221ba8 scripts/build/internals.sh
--- a/scripts/build/internals.sh	Thu May 23 17:51:15 2013 +0200
+++ b/scripts/build/internals.sh	Wed Jul 10 00:57:54 2013 +0200
@@ -28,17 +28,17 @@ 
             CT_DoExecLog ALL "${CT_TARGET}-strip" ${strip_args}         \
                              "${CT_TARGET}/debug-root/usr/bin/gdbserver"
         fi
-        # We can not use the version in CT_CC_VERSION because
+        # We can not use the version in CT_CC_GCC_VERSION because
         # of the Linaro stuff. So, harvest the version string
         # directly from the gcc sources...
         # All gcc 4.x seem to have the version in gcc/BASE-VER
         # while version prior to 4.x have the version in gcc/version.c
         # Of course, here is not the better place to do that...
-        if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then
-            gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" )
+        if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ]; then
+            gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" )
         else
-            gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \
-                               "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/version.c"   \
+            gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;'     \
+                               "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/version.c"   \
                          )
         fi
         for _t in "bin/${CT_TARGET}-"*                                      \
diff -r 2685dfa9de14 -r 2a93f4221ba8 scripts/build/test_suite/gcc.sh
--- a/scripts/build/test_suite/gcc.sh	Thu May 23 17:51:15 2013 +0200
+++ b/scripts/build/test_suite/gcc.sh	Wed Jul 10 00:57:54 2013 +0200
@@ -15,10 +15,10 @@ 
     CT_DoStep INFO "Installing GCC test suite"
 
     CT_DoExecLog ALL mkdir -p "${CT_TEST_SUITE_DIR}/gcc"
-    CT_DoExecLog ALL cp -av "${CT_LIB_DIR}/contrib/gcc-test-suite/default.cfg"  \
-                            "${CT_LIB_DIR}/contrib/gcc-test-suite/Makefile"     \
-                            "${CT_LIB_DIR}/contrib/gcc-test-suite/README"       \
-                            "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/testsuite"  \
+    CT_DoExecLog ALL cp -av "${CT_LIB_DIR}/contrib/gcc-test-suite/default.cfg"      \
+                            "${CT_LIB_DIR}/contrib/gcc-test-suite/Makefile"         \
+                            "${CT_LIB_DIR}/contrib/gcc-test-suite/README"           \
+                            "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/testsuite"  \
                             "${CT_TEST_SUITE_DIR}/gcc"
 
     CT_DoExecLog ALL sed -i -r -e "s/@@DG_TARGET@@/${CT_TARGET}/g;"     \
diff -r 2685dfa9de14 -r 2a93f4221ba8 scripts/crosstool-NG.sh.in
--- a/scripts/crosstool-NG.sh.in	Thu May 23 17:51:15 2013 +0200
+++ b/scripts/crosstool-NG.sh.in	Wed Jul 10 00:57:54 2013 +0200
@@ -140,7 +140,7 @@ 
 . "${CT_LIB_DIR}/scripts/build/companion_libs.sh"
 . "${CT_LIB_DIR}/scripts/build/binutils/${CT_BINUTILS}.sh"
 . "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
-. "${CT_LIB_DIR}/scripts/build/cc/${CT_CC}.sh"
+. "${CT_LIB_DIR}/scripts/build/cc.sh"
 . "${CT_LIB_DIR}/scripts/build/debug.sh"
 . "${CT_LIB_DIR}/scripts/build/test_suite.sh"
 
diff -r 2685dfa9de14 -r 2a93f4221ba8 scripts/showSamples.sh
--- a/scripts/showSamples.sh	Thu May 23 17:51:15 2013 +0200
+++ b/scripts/showSamples.sh	Wed Jul 10 00:57:54 2013 +0200
@@ -76,7 +76,7 @@ 
             [ -z "${CT_LIBELF}" -a -z "${CT_LIBELF_TARGET}" ] || printf " libelf-%s"    "${CT_LIBELF_VERSION}"
             [ -z "${complibs}"  ] || printf "\n"
             printf  "    %-*s : %s\n" ${width} "binutils" "binutils-${CT_BINUTILS_VERSION}"
-            printf  "    %-*s : %s" ${width} "C compiler" "${CT_CC}-${CT_CC_VERSION} (C"
+            printf  "    %-*s : %s" ${width} "C compiler" "${CT_CC}-${CT_CC_GCC_VERSION} (C"
             [ "${CT_CC_LANG_CXX}" = "y"     ] && printf ",C++"
             [ "${CT_CC_LANG_FORTRAN}" = "y" ] && printf ",Fortran"
             [ "${CT_CC_LANG_JAVA}" = "y"    ] && printf ",Java"
@@ -120,7 +120,7 @@ 
         fi
         printf "|  ${CT_BINUTILS_VERSION}  "
         printf "|  ''${CT_CC}''  "
-        printf "|  ${CT_CC_VERSION}  "
+        printf "|  ${CT_CC_GCC_VERSION}  "
         printf "|  ''${CT_LIBC}''  |"
         if [ "${CT_LIBC}" != "none" ]; then
             printf "  ${CT_LIBC_VERSION}  "