cc/gcc: pass the companion libs prefix to cc_core
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 17:54:21 2011 +0200 (2011-07-17)
changeset 2888dd71df95903a
parent 2887 6ee3b25e1097
child 2889 f3b2199620f1
cc/gcc: pass the companion libs prefix to cc_core

In case of canadian-cross, the companion libraries are not the same for
the core cc (they run on 'build') as they are for the final cc (they run
on 'host').

Prepare for this differentiation (coming later), while retaining the
current behavior (to use the same compblibs).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
scripts/build/cc/gcc.sh
     1.1 --- a/scripts/build/cc/gcc.sh	Sun Nov 20 18:08:00 2011 +0100
     1.2 +++ b/scripts/build/cc/gcc.sh	Sun Jul 17 17:54:21 2011 +0200
     1.3 @@ -67,12 +67,14 @@
     1.4          y,*,*)
     1.5              do_core=y
     1.6              core_opts+=( "mode=static" )
     1.7 +            core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
     1.8              ;;
     1.9          ,y,*)
    1.10              ;;
    1.11          ,,nptl)
    1.12              do_core=y
    1.13              core_opts+=( "mode=static" )
    1.14 +            core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
    1.15              ;;
    1.16          *)
    1.17              ;;
    1.18 @@ -100,6 +102,7 @@
    1.19              core_opts+=( "mode=baremetal" )
    1.20              core_opts+=( "build_libgcc=yes" )
    1.21              core_opts+=( "build_libstdcxx=yes" )
    1.22 +            core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
    1.23              if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
    1.24                  core_opts+=( "build_staticlinked=yes" )
    1.25              fi
    1.26 @@ -110,15 +113,18 @@
    1.27              do_core=y
    1.28              core_opts+=( "mode=shared" )
    1.29              core_opts+=( "build_libgcc=yes" )
    1.30 +            core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
    1.31              ;;
    1.32          ,,win32)
    1.33              do_core=y
    1.34              core_opts+=( "mode=static" )
    1.35              core_opts+=( "build_libgcc=yes" )
    1.36 +            core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
    1.37              ;;
    1.38          *)
    1.39              do_core=y
    1.40              core_opts+=( "mode=static" )
    1.41 +            core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
    1.42              if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
    1.43                  core_opts+=( "build_libgcc=yes" )
    1.44              fi
    1.45 @@ -138,6 +144,7 @@
    1.46  #  - we need to build libgcc or not             : build_libgcc=[yes|no]       (default: no)
    1.47  #  - we need to build libstdc++ or not          : build_libstdcxx=[yes|no]    (default: no)
    1.48  #  - we need to build statically linked or not  : build_staticlinked=[yes|no] (default: no)
    1.49 +#  - where to find the companion libs (prefix)  : complibs=<prefix_dir>       (no default value)
    1.50  # Usage: do_cc_core_backend mode=[static|shared|baremetal] build_libgcc=[yes|no] build_staticlinked=[yes|no]
    1.51  do_cc_core_backend() {
    1.52      local mode
    1.53 @@ -146,6 +153,7 @@
    1.54      local build_staticlinked=no
    1.55      local build_manuals=no
    1.56      local core_prefix_dir
    1.57 +    local complibs
    1.58      local lang_opt
    1.59      local tmp
    1.60      local -a host_libstdcxx_flags
    1.61 @@ -249,26 +257,26 @@
    1.62      fi
    1.63  
    1.64      if [ "${CT_CC_GCC_USE_GMP_MPFR}" = "y" ]; then
    1.65 -        extra_config+=("--with-gmp=${CT_COMPLIBS_DIR}")
    1.66 -        extra_config+=("--with-mpfr=${CT_COMPLIBS_DIR}")
    1.67 +        extra_config+=("--with-gmp=${complibs}")
    1.68 +        extra_config+=("--with-mpfr=${complibs}")
    1.69      fi
    1.70      if [ "${CT_CC_GCC_USE_MPC}" = "y" ]; then
    1.71 -        extra_config+=("--with-mpc=${CT_COMPLIBS_DIR}")
    1.72 +        extra_config+=("--with-mpc=${complibs}")
    1.73      fi
    1.74      if [ "${CT_CC_GCC_USE_GRAPHITE}" = "y" ]; then
    1.75 -        extra_config+=("--with-ppl=${CT_COMPLIBS_DIR}")
    1.76 +        extra_config+=("--with-ppl=${complibs}")
    1.77          # With PPL 0.11+, also pull libpwl if needed
    1.78          if [ "${CT_PPL_NEEDS_LIBPWL}" = "y" ]; then
    1.79 -            host_libstdcxx_flags+=("-L${CT_COMPLIBS_DIR}/lib")
    1.80 +            host_libstdcxx_flags+=("-L${complibs}/lib")
    1.81              host_libstdcxx_flags+=("-lpwl")
    1.82          fi
    1.83 -        extra_config+=("--with-cloog=${CT_COMPLIBS_DIR}")
    1.84 +        extra_config+=("--with-cloog=${complibs}")
    1.85      elif [ "${CT_CC_GCC_HAS_GRAPHITE}" = "y" ]; then
    1.86          extra_config+=("--with-ppl=no")
    1.87          extra_config+=("--with-cloog=no")
    1.88      fi
    1.89      if [ "${CT_CC_GCC_USE_LTO}" = "y" ]; then
    1.90 -        extra_config+=("--with-libelf=${CT_COMPLIBS_DIR}")
    1.91 +        extra_config+=("--with-libelf=${complibs}")
    1.92          extra_config+=("--enable-lto")
    1.93      elif [ "${CT_CC_GCC_HAS_LTO}" = "y" ]; then
    1.94          extra_config+=("--with-libelf=no")