diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2015-06-08 19:51:00 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2015-06-08 21:15:51 -0400 |
commit | bc75599f3966061f79dd05f8d4bfbd827ca8a14e (patch) | |
tree | 514f544db8e529a046a5d54d9b30c8d0fd9ef79c /hints | |
parent | 16ac183d95cef3f9028737e9949a7e78a750c9fe (diff) | |
download | perl-bc75599f3966061f79dd05f8d4bfbd827ca8a14e.tar.gz |
Detect broken AIX fmodl.
(observed at least in AIX 6.1)
Diffstat (limited to 'hints')
-rw-r--r-- | hints/aix.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/hints/aix.sh b/hints/aix.sh index a55fce60a5..3c606c60e9 100644 --- a/hints/aix.sh +++ b/hints/aix.sh @@ -649,4 +649,50 @@ EOF ;; esac +# Some releases of AIX cc/xlc a broken fmodl(), but -q64 seems to help. +case "$gccversion" in +'') case "$uselongdouble" in + define) + case "$ccflags" in + *-q64*) ;; + *) echo "Checking if your fmodl() is broken..." >&4 + cat > fmodl$$.c <<EOF +#include <math.h> +#include <stdio.h> +int main() { + printf("%ld\n", (long)fmodl(powl(2, 31), (long double)4294967295)); +} +EOF + $cc -qlongdouble -o fmodl$$ fmodl$$.c -lm + case `./fmodl$$` in + 2147483648) echo "Your fmodl() is working correctly." >&4 ;; + *) echo "Your fmodl() is broken, will try with -q64..." >&4 + $cc -q64 -qlongdouble -o fmodl$$ fmodl$$.c -lm + case `./fmodl$$` in + 2147483648) + echo "The -q64 did the trick, will use it." >& 4 + ccflags="`echo $ccflags | sed -e 's@-q32@@g'`" + ldflags="`echo $ldflags | sed -e 's@-q32@@g'`" + ccflags="$ccflags -q64" + ldflags="$ldflags -q64" + ;; + *) echo "Not even the -q64 worked. I'm disabling long doubles." >&4 + echo "And you should have stern talk with your IBM rep." >&4 + uselongdouble="$undef" + ccflags=`echo " $ccflags " | sed -e 's/ -qlongdouble / /'` + libswanted=`echo " $libswanted " | sed -e 's/ c128/ /'` + lddlflags=`echo " $lddlflags " | sed -e 's/ -lc128 / /'` + ;; + esac # second fmodl$$ + ;; + esac # first fmodl$$ + ;; + esac # Checking if ... + ;; + esac # uselongdouble + rm -f fmodl$$.c fmodl$$ + ;; +esac # not gcc + + # EOF |