libc/uClibc: add option to enable fenv
author"Yann E. MORIN" <yann.morin.1998@free.fr>
Sat Jan 04 16:19:18 2014 +0100 (2014-01-04)
changeset 327622239d19ad65
parent 3275 eacd3115e674
child 3277 ead33a889ef9
libc/uClibc: add option to enable fenv

Support for fenv.h is a little bit more tricky that enabling it only
for x86-32 is not right.

Add an option for the user to choose whther to install fenv.h or not.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
config/libc/uClibc.in.2
scripts/build/libc/uClibc.sh
     1.1 --- a/config/libc/uClibc.in.2	Mon Jan 06 20:05:14 2014 +0100
     1.2 +++ b/config/libc/uClibc.in.2	Sat Jan 04 16:19:18 2014 +0100
     1.3 @@ -65,3 +65,18 @@
     1.4        Say y if you want uClibc to support WCHAR.
     1.5  
     1.6        Maybe this is needed, if you're building a C++-Compiler
     1.7 +
     1.8 +config LIBC_UCLIBC_FENV
     1.9 +    bool
    1.10 +    prompt "Add support for fenv.h"
    1.11 +    default y if ARCH_x86
    1.12 +    help
    1.13 +      fenv.h provides functions to control the floating point environment,
    1.14 +      such as rounding mode, exceptions...
    1.15 +
    1.16 +      For some architectures, fenv.h is incomplete, so is not installed
    1.17 +      by default. x86 is known to have a rather complete fenv.h, so it is
    1.18 +      installed by default only for x86.
    1.19 +
    1.20 +      If you need fenv.h on other architectures, say 'y' here, but you may
    1.21 +      encounter some issues.
     2.1 --- a/scripts/build/libc/uClibc.sh	Mon Jan 06 20:05:14 2014 +0100
     2.2 +++ b/scripts/build/libc/uClibc.sh	Sat Jan 04 16:19:18 2014 +0100
     2.3 @@ -315,13 +315,6 @@
     2.4                      ;;
     2.5              esac
     2.6              ;;
     2.7 -        x86)
     2.8 -            if [ "${CT_ARCH_BITNESS}" = "32" ]; then
     2.9 -                 cat <<-ENDSED
    2.10 -					s/.*(UCLIBC_HAS_FENV).*/\\1=y/
    2.11 -					ENDSED
    2.12 -            fi
    2.13 -            ;;
    2.14      esac
    2.15  
    2.16      # Accomodate for old and new uClibc versions, where the
    2.17 @@ -374,6 +367,11 @@
    2.18  				ENDSED
    2.19              ;;
    2.20      esac
    2.21 +    if [ "${CT_LIBC_UCLIBC_FENV}" = "y" ]; then
    2.22 +        cat <<-ENDSED
    2.23 +			s/.*(UCLIBC_HAS_FENV).*/\\1=y/
    2.24 +			ENDSED
    2.25 +    fi
    2.26  
    2.27      # We always want ctor/dtor
    2.28      cat <<-ENDSED