libc/newlib: add option to compile support for float IOs
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Oct 23 00:54:46 2010 +0200 (2010-10-23)
changeset 2165e67ab7a73b2f
parent 2164 4534da2b2bc1
child 2166 c1fe0639585a
libc/newlib: add option to compile support for float IOs

Adds support to enable/disable IOs of floating point values
(float, double, and long double).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
config/libc/newlib.in.2
scripts/build/libc/newlib.sh
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/config/libc/newlib.in.2	Sat Oct 23 00:54:46 2010 +0200
     1.3 @@ -0,0 +1,17 @@
     1.4 +# newlib second-part options
     1.5 +
     1.6 +config LIBC_NEWLIB_IO_FLOAT
     1.7 +    bool
     1.8 +    prompt "Enable IOs on floats and doubles"
     1.9 +    default n
    1.10 +    help
    1.11 +      Enable support for IOs on floating point
    1.12 +      values (float and double).
    1.13 +
    1.14 +config LIBC_NEWLIB_IO_LDBL
    1.15 +    bool
    1.16 +    prompt "Enable IOs on long doubles"
    1.17 +    default n
    1.18 +    depends on LIBC_NEWLIB_IO_FLOAT
    1.19 +    help
    1.20 +      Enable support for IOs on long doubles.
     2.1 --- a/scripts/build/libc/newlib.sh	Sun Oct 31 17:59:45 2010 +0100
     2.2 +++ b/scripts/build/libc/newlib.sh	Sat Oct 23 00:54:46 2010 +0200
     2.3 @@ -59,6 +59,8 @@
     2.4  }
     2.5  
     2.6  do_libc_start_files() {
     2.7 +    local -a newlib_opts
     2.8 +
     2.9      CT_DoStep INFO "Installing C library"
    2.10  
    2.11      mkdir -p "${CT_BUILD_DIR}/build-libc"
    2.12 @@ -66,6 +68,18 @@
    2.13  
    2.14      CT_DoLog EXTRA "Configuring C library"
    2.15  
    2.16 +    if [ "${CT_LIBC_NEWLIB_IO_FLOAT}" = "y" ]; then
    2.17 +        newlib_opts+=( "--enable-newlib-io-float" )
    2.18 +        if [ "${CT_LIBC_NEWLIB_IO_LDBL}" = "y" ]; then
    2.19 +            newlib_opts+=( "--enable-newlib-io-long-double" )
    2.20 +        else
    2.21 +            newlib_opts+=( "--disable-newlib-io-long-double" )
    2.22 +        fi
    2.23 +    else
    2.24 +        newlib_opts+=( "--disable-newlib-io-float" )
    2.25 +        newlib_opts+=( "--disable-newlib-io-long-double" )
    2.26 +    fi
    2.27 +
    2.28      # Note: newlib handles the build/host/target a little bit differently
    2.29      # than one would expect:
    2.30      #   build  : not used
    2.31 @@ -79,7 +93,8 @@
    2.32      "${CT_SRC_DIR}/newlib-$(libc_newlib_version)/configure" \
    2.33          --host=${CT_BUILD}                              \
    2.34          --target=${CT_TARGET}                           \
    2.35 -        --prefix=${CT_PREFIX_DIR}
    2.36 +        --prefix=${CT_PREFIX_DIR}                       \
    2.37 +        "${newlib_opts[@]}"
    2.38  
    2.39      CT_DoLog EXTRA "Building C library"
    2.40      CT_DoExecLog ALL make ${PARALLELMFLAGS}