?RCS: $Id$ ?RCS: ?RCS: Copyright (c) 2000 Jarkko Hietaniemi ?RCS: ?RCS: You may distribute under the terms of either the GNU General Public ?RCS: License or the Artistic License, as specified in the README file. ?RCS: ?MAKE:d_modfl d_modflproto d_modfl_pow32_bug: Inlibc Compile Hasproto cat \ rm_try test sPRIfldbl d_longdbl osname gccversion ccflags run \ uselongdouble i_math \ d_sqrtl d_aintl d_copysignl d_ilogbl d_scalbnl d_frexpl ?MAKE: -pick add $@ %< ?S:d_modfl: ?S: This variable conditionally defines the HAS_MODFL symbol, which ?S: indicates to the C program that the modfl() routine is available. ?S:. ?S:d_modflproto: ?S: This symbol, if defined, indicates that the system provides ?S: a prototype for the modfl() function. Otherwise, it is up ?S: to the program to supply one. C99 says it should be ?S: long double modfl(long double, long double *); ?S:. ?S:d_modfl_pow32_bug: ?S: This variable conditionally defines the HAS_MODFL_POW32_BUG symbol, ?S: which indicates that modfl() is broken for long doubles >= pow(2, 32). ?S: For example from 4294967303.150000 one would get 4294967302.000000 ?S: and 1.150000. The bug has been seen in certain versions of glibc, ?S: release 2.2.2 is known to be okay. ?S:. ?C:HAS_MODFL: ?C: This symbol, if defined, indicates that the modfl routine is ?C: available to split a long double x into a fractional part f and ?C: an integer part i such that |f| < 1.0 and (f + i) = x. ?C:. ?C:HAS_MODFL_PROTO: ?C: This symbol, if defined, indicates that the system provides ?C: a prototype for the modfl() function. Otherwise, it is up ?C: to the program to supply one. ?C:. ?C:HAS_MODFL_POW32_BUG: ?C: This symbol, if defined, indicates that the modfl routine is ?C: broken for long doubles >= pow(2, 32). ?C: For example from 4294967303.150000 one would get 4294967302.000000 ?C: and 1.150000. The bug has been seen in certain versions of glibc, ?C: release 2.2.2 is known to be okay. ?C:. ?H:#$d_modfl HAS_MODFL /**/ ?H:#$d_modflproto HAS_MODFL_PROTO /**/ ?H:#$d_modfl_pow32_bug HAS_MODFL_POW32_BUG /**/ ?H:. ?T:foo saveccflags message ?F:!try ?LINT:set d_modflproto ?LINT:change ccflags : see if modfl exists set modfl d_modfl eval $inlibc : see if prototype for modfl is available echo " " set d_modflproto modfl $i_math math.h eval $hasproto d_modfl_pow32_bug="$undef" case "$d_longdbl$d_modfl" in $define$define) $cat <try.c < #include EOCP if $test "X$d_modflproto" != "X$define"; then $cat >>try.c <>try.c <&4 "Your modfl() is broken for large values." d_modfl_pow32_bug="$define" case "$foo" in glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()." ;; esac ;; *" 4294967303.150000 0.150000 4294967303.000000") echo >&4 "Your modfl() seems okay for large values." ;; *) echo >&4 "I don't understand your modfl() at all." d_modfl="$undef" ;; esac $rm_try else echo "I cannot figure out whether your modfl() is okay, assuming it isn't." d_modfl="$undef" fi case "$osname:$gccversion" in aix:) ccflags="$saveccflags" ;; # restore esac ;; esac if $test "$uselongdouble" = "$define"; then message="" if $test "$d_sqrtl" != "$define"; then message="$message sqrtl" fi if $test "$d_modfl" != "$define"; then if $test "$d_aintl:$d_copysignl" = "$define:$define"; then echo "You have both aintl and copysignl, so I can emulate modfl." else message="$message modfl" fi fi if $test "$d_frexpl" != "$define"; then if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then echo "You have both ilogbl and scalbnl, so I can emulate frexpl." else message="$message frexpl" fi fi if $test "$message" != ""; then $cat <&4 *** You requested the use of long doubles but you do not seem to have *** the following mathematical functions needed for long double support: *** $message *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits. *** Cannot continue, aborting. EOM exit 1 fi fi