1.1 --- a/scripts/build/cc/gcc.sh Sun Jul 17 18:10:53 2011 +0200
1.2 +++ b/scripts/build/cc/gcc.sh Tue Aug 23 21:11:26 2011 +0200
1.3 @@ -70,6 +70,7 @@
1.4 core_opts+=( "host=${CT_HOST}" )
1.5 core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.6 core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
1.7 + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.8 ;;
1.9 ,y,*)
1.10 ;;
1.11 @@ -79,6 +80,7 @@
1.12 core_opts+=( "host=${CT_HOST}" )
1.13 core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.14 core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
1.15 + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.16 ;;
1.17 *)
1.18 ;;
1.19 @@ -109,6 +111,7 @@
1.20 core_opts+=( "build_libstdcxx=yes" )
1.21 core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.22 core_opts+=( "prefix=${CT_PREFIX_DIR}" )
1.23 + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.24 if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
1.25 core_opts+=( "build_staticlinked=yes" )
1.26 fi
1.27 @@ -122,6 +125,7 @@
1.28 core_opts+=( "build_libgcc=yes" )
1.29 core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.30 core_opts+=( "prefix=${CT_CC_CORE_SHARED_PREFIX_DIR}" )
1.31 + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.32 ;;
1.33 ,,win32)
1.34 do_core=y
1.35 @@ -130,6 +134,7 @@
1.36 core_opts+=( "build_libgcc=yes" )
1.37 core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.38 core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
1.39 + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.40 ;;
1.41 *)
1.42 do_core=y
1.43 @@ -137,6 +142,7 @@
1.44 core_opts+=( "host=${CT_HOST}" )
1.45 core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
1.46 core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
1.47 + core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
1.48 if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
1.49 core_opts+=( "build_libgcc=yes" )
1.50 fi
1.51 @@ -159,6 +165,7 @@
1.52 # - where to find the companion libs (prefix) : complibs=<prefix_dir> (no default value)
1.53 # - the prefix to install into (directory) : prefix=<directory> (no default value)
1.54 # - the machine we will run on (tuple) : host=<tuple> (no default tuple)
1.55 +# - the CFLAGS to use : cflags=<CFLAGS> (empty)
1.56 # Usage: do_cc_core_backend mode=[static|shared|baremetal] build_libgcc=[yes|no] build_staticlinked=[yes|no]
1.57 do_cc_core_backend() {
1.58 local mode
1.59 @@ -170,6 +177,7 @@
1.60 local prefix
1.61 local complibs
1.62 local lang_opt
1.63 + local cflags
1.64 local tmp
1.65 local -a host_libstdcxx_flags
1.66 local -a extra_config
1.67 @@ -358,7 +366,7 @@
1.68 # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
1.69 CT_DoExecLog CFG \
1.70 CC_FOR_BUILD="${CT_BUILD}-gcc" \
1.71 - CFLAGS="${CT_CFLAGS_FOR_HOST}" \
1.72 + CFLAGS="${cflags}" \
1.73 LDFLAGS="${core_LDFLAGS[*]}" \
1.74 "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \
1.75 --build=${CT_BUILD} \