diff options
author | Tony Cook <tony@develop-help.com> | 2020-06-17 02:06:51 +0000 |
---|---|---|
committer | Sawyer X <xsawyerx@cpan.org> | 2020-06-20 19:30:29 +0300 |
commit | 286ba7099657d11792d0b9a12ba23a35f37c2e12 (patch) | |
tree | 60cbd23f832d712c25c8593697a9b5e28ceb87b3 /hints | |
parent | a760468c9355bafaee57e94f13705c0ea925d9ca (diff) | |
download | perl-286ba7099657d11792d0b9a12ba23a35f37c2e12.tar.gz |
warn the user that NetBSD's long double support isn't very good
Diffstat (limited to 'hints')
-rw-r--r-- | hints/netbsd.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/hints/netbsd.sh b/hints/netbsd.sh index 445680d8ba..5c9f5bcbd5 100644 --- a/hints/netbsd.sh +++ b/hints/netbsd.sh @@ -265,3 +265,38 @@ case "$osver" in d_fchmodat="$undef" ;; esac + +cat >UU/uselongdouble.cbu <<'EOCBU' +# This script UU/uselongdouble.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use long doubles. +# +# See https://github.com/Perl/perl5/issues/17853 and https://github.com/Perl/perl5/issues/17854 +case "$uselongdouble" in +$define|true|[yY]*) + cat >try.c <<\TRY +#include <stdio.h> +#include <math.h> + +long double x = 1.0; + +int main(int argc, char **argv) { + double e1 = exp(1.0); + /* as of NetBSD 9.0 expl() just calls exp(), + Fail here if they're equal. */ + return expl(x) == (long double)e1; +} +TRY + if $cc -o try $ccflags $ldflags try.c -lm && $run ./try; then + echo "NetBSD seem to have fixed expl (and hopefully more)" >&4 + else + cat <<EOM >&4 + +Warning! NetBSD's long double support is limited enough that it will cause +test failures, and possibly build failures, and this doesn't appear to have +been fixed in the release you're running. + +EOM + fi +;; +esac +EOCBU |