summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-10-22 22:54:46 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-10-22 22:54:46 (GMT)
commitd7e88461e66eb277dd0f4b9ba2f3da6bb7ce5abc (patch)
tree9963e5e9ef4a2e1b43ede9c9afb5d9c9f2287d4a
parent09bab58031c7d497f6f0f223cd4d68715f904600 (diff)
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>
-rw-r--r--config/libc/newlib.in.217
-rw-r--r--scripts/build/libc/newlib.sh17
2 files changed, 33 insertions, 1 deletions
diff --git a/config/libc/newlib.in.2 b/config/libc/newlib.in.2
new file mode 100644
index 0000000..911c864
--- /dev/null
+++ b/config/libc/newlib.in.2
@@ -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 --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index 7e11fcd..b073a75 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -59,6 +59,8 @@ do_libc_headers() {
}
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 @@ do_libc_start_files() {
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 @@ do_libc_start_files() {
"${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}