diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-08-15 21:42:28 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-08-15 21:42:28 +0200 |
commit | 1a7cf0ea9e45dda5a1fd8f2830c3de95228a8035 (patch) | |
tree | 604ff072f8e55edc9ae252cd6094226b96174906 | |
parent | 2f718dd60c19a5d671e7fbef00c67c05ef98c9f4 (diff) | |
download | crosstool-ng-1a7cf0ea9e45dda5a1fd8f2830c3de95228a8035.tar.gz crosstool-ng-1a7cf0ea9e45dda5a1fd8f2830c3de95228a8035.tar.bz2 crosstool-ng-1a7cf0ea9e45dda5a1fd8f2830c3de95228a8035.zip |
cc/gcc: add language helper function
Add a function that prepares the language configure option.
It is needed in at least two places, some commonalisation is needed. ;-)
Unfortunately, it is no longer possible to print warnings about experimental
languages any more. Anyway, the experimental status is clearly indicated
in the menuconfig. so it should not be a surprise if the build breaks. :-/
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rw-r--r-- | scripts/build/cc/gcc.sh | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index b56b49cc..bc7cf177 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -53,6 +53,24 @@ do_cc_extract() { } #------------------------------------------------------------------------------ +# This function builds up the set of languages to enable +# No argument expected, returns the comma-separated language list on stdout +cc_gcc_lang_list() { + local lang_list + + lang_list="c" + [ "${CT_CC_LANG_CXX}" = "y" ] && lang_list+=",c++" + [ "${CT_CC_LANG_FORTRAN}" = "y" ] && lang_list+=",fortran" + [ "${CT_CC_LANG_ADA}" = "y" ] && lang_list+=",ada" + [ "${CT_CC_LANG_JAVA}" = "y" ] && lang_list+=",java" + [ "${CT_CC_LANG_OBJC}" = "y" ] && lang_list+=",objc" + [ "${CT_CC_LANG_OBJCXX}" = "y" ] && lang_list+=",obj-c++" + lang_list+="${CT_CC_LANG_OTHERS:+,${CT_CC_LANG_OTHERS}}" + + printf "%s" "${lang_list}" +} + +#------------------------------------------------------------------------------ # Core gcc pass 1 do_cc_core_pass_1() { local -a core_opts @@ -523,20 +541,8 @@ do_cc_backend() { CT_DoLog EXTRA "Configuring final compiler" # Enable selected languages - lang_opt="c" - [ "${CT_CC_LANG_CXX}" = "y" ] && lang_opt="${lang_opt},c++" - [ "${CT_CC_LANG_FORTRAN}" = "y" ] && lang_opt="${lang_opt},fortran" - [ "${CT_CC_LANG_ADA}" = "y" ] && lang_opt="${lang_opt},ada" - [ "${CT_CC_LANG_JAVA}" = "y" ] && lang_opt="${lang_opt},java" - [ "${CT_CC_LANG_OBJC}" = "y" ] && lang_opt="${lang_opt},objc" - [ "${CT_CC_LANG_OBJCXX}" = "y" ] && lang_opt="${lang_opt},obj-c++" - CT_Test "Building ADA language is not yet supported. Will try..." "${CT_CC_LANG_ADA}" = "y" - CT_Test "Building Objective-C language is not yet supported. Will try..." "${CT_CC_LANG_OBJC}" = "y" - CT_Test "Building Objective-C++ language is not yet supported. Will try..." "${CT_CC_LANG_OBJCXX}" = "y" - CT_Test "Building ${CT_CC_LANG_OTHERS//,/ } language(s) is not yet supported. Will try..." -n "${CT_CC_LANG_OTHERS}" - lang_opt=$(echo "${lang_opt},${CT_CC_LANG_OTHERS}" |sed -r -e 's/,+/,/g; s/,*$//;') - - extra_config+=("--enable-languages=${lang_opt}") + extra_config+=("--enable-languages=$( cc_gcc_lang_list )") + for tmp in ARCH ABI CPU TUNE FPU FLOAT; do eval tmp="\${CT_ARCH_WITH_${tmp}}" if [ -n "${tmp}" ]; then |