scripts: introduce float type as a string
authorMichael Hope <michael.hope@linaro.org>
Wed Oct 19 15:27:32 2011 +1300 (2011-10-19)
changeset 2737b5179235b925
parent 2735 f09ed6dd71a3
child 2738 149c33923f47
scripts: introduce float type as a string

With the upcoming softfp support, the case..esac test would become
a bit convoluted if it were to test three different booleans.

Introduce a new blind string config option that defaults to the
selected floating point type used.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
[yann.morin.1998@anciens.enib.fr: split the original patch]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
config/target.in
scripts/build/libc/glibc-eglibc.sh-common
scripts/functions
     1.1 --- a/config/target.in	Fri Nov 04 19:22:29 2011 +0100
     1.2 +++ b/config/target.in	Wed Oct 19 15:27:32 2011 +1300
     1.3 @@ -296,6 +296,11 @@
     1.4        
     1.5        Leave blank if you don't know better.
     1.6  
     1.7 +config ARCH_FLOAT
     1.8 +    string
     1.9 +    default "hard"   if ARCH_FLOAT_HW
    1.10 +    default "soft"   if ARCH_FLOAT_SW
    1.11 +
    1.12  source "config.gen/arch.in.2"
    1.13  
    1.14  endmenu
     2.1 --- a/scripts/build/libc/glibc-eglibc.sh-common	Fri Nov 04 19:22:29 2011 +0100
     2.2 +++ b/scripts/build/libc/glibc-eglibc.sh-common	Wed Oct 19 15:27:32 2011 +1300
     2.3 @@ -132,9 +132,9 @@
     2.4          *) extra_config+=("--disable-shared");;
     2.5      esac
     2.6  
     2.7 -    case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in
     2.8 -        y,) extra_config+=("--with-fp");;
     2.9 -        ,y) extra_config+=("--without-fp");;
    2.10 +    case "${CT_ARCH_FLOAT}" in
    2.11 +        hard)   extra_config+=("--with-fp");;
    2.12 +        soft)   extra_config+=("--without-fp");;
    2.13      esac
    2.14  
    2.15      if [ "${CT_LIBC_DISABLE_VERSIONING}" = "y" ]; then
     3.1 --- a/scripts/functions	Fri Nov 04 19:22:29 2011 +0100
     3.2 +++ b/scripts/functions	Wed Oct 19 15:27:32 2011 +1300
     3.3 @@ -983,7 +983,13 @@
     3.4      [ "${CT_ARCH_CPU}"      ] && { CT_ARCH_CPU_CFLAG="-mcpu=${CT_ARCH_CPU}";     CT_ARCH_WITH_CPU="--with-cpu=${CT_ARCH_CPU}";    }
     3.5      [ "${CT_ARCH_TUNE}"     ] && { CT_ARCH_TUNE_CFLAG="-mtune=${CT_ARCH_TUNE}";  CT_ARCH_WITH_TUNE="--with-tune=${CT_ARCH_TUNE}"; }
     3.6      [ "${CT_ARCH_FPU}"      ] && { CT_ARCH_FPU_CFLAG="-mfpu=${CT_ARCH_FPU}";     CT_ARCH_WITH_FPU="--with-fpu=${CT_ARCH_FPU}";    }
     3.7 -    [ "${CT_ARCH_FLOAT_SW}" ] && { CT_ARCH_FLOAT_CFLAG="-msoft-float";           CT_ARCH_WITH_FLOAT="--with-float=soft";          }
     3.8 +
     3.9 +    case "${CT_ARCH_FLOAT}" in
    3.10 +        soft)
    3.11 +            CT_ARCH_FLOAT_CFLAG="-msoft-float"
    3.12 +            CT_ARCH_WITH_FLOAT="--with-float=soft"
    3.13 +            ;;
    3.14 +    esac
    3.15  
    3.16      # Build the default kernel tuple part
    3.17      CT_TARGET_KERNEL="${CT_KERNEL}"