# HG changeset patch # User "Yann E. MORIN" # Date 1287788086 -7200 # Node ID e67ab7a73b2fe7be8dde54a1415d22b3a547374e # Parent 4534da2b2bc1e54db8efe203997fde0c22e0d978 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" diff -r 4534da2b2bc1 -r e67ab7a73b2f config/libc/newlib.in.2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/libc/newlib.in.2 Sat Oct 23 00:54:46 2010 +0200 @@ -0,0 +1,17 @@ +# newlib second-part options + +config LIBC_NEWLIB_IO_FLOAT + bool + prompt "Enable IOs on floats and doubles" + default n + help + Enable support for IOs on floating point + values (float and double). + +config LIBC_NEWLIB_IO_LDBL + bool + prompt "Enable IOs on long doubles" + default n + depends on LIBC_NEWLIB_IO_FLOAT + help + Enable support for IOs on long doubles. diff -r 4534da2b2bc1 -r e67ab7a73b2f scripts/build/libc/newlib.sh --- a/scripts/build/libc/newlib.sh Sun Oct 31 17:59:45 2010 +0100 +++ b/scripts/build/libc/newlib.sh Sat Oct 23 00:54:46 2010 +0200 @@ -59,6 +59,8 @@ } do_libc_start_files() { + local -a newlib_opts + CT_DoStep INFO "Installing C library" mkdir -p "${CT_BUILD_DIR}/build-libc" @@ -66,6 +68,18 @@ CT_DoLog EXTRA "Configuring C library" + if [ "${CT_LIBC_NEWLIB_IO_FLOAT}" = "y" ]; then + newlib_opts+=( "--enable-newlib-io-float" ) + if [ "${CT_LIBC_NEWLIB_IO_LDBL}" = "y" ]; then + newlib_opts+=( "--enable-newlib-io-long-double" ) + else + newlib_opts+=( "--disable-newlib-io-long-double" ) + fi + else + newlib_opts+=( "--disable-newlib-io-float" ) + newlib_opts+=( "--disable-newlib-io-long-double" ) + fi + # Note: newlib handles the build/host/target a little bit differently # than one would expect: # build : not used @@ -79,7 +93,8 @@ "${CT_SRC_DIR}/newlib-$(libc_newlib_version)/configure" \ --host=${CT_BUILD} \ --target=${CT_TARGET} \ - --prefix=${CT_PREFIX_DIR} + --prefix=${CT_PREFIX_DIR} \ + "${newlib_opts[@]}" CT_DoLog EXTRA "Building C library" CT_DoExecLog ALL make ${PARALLELMFLAGS}