diff options
author | H.Merijn Brand <perl5@tux.freedom.nl> | 2023-04-28 09:09:55 +0200 |
---|---|---|
committer | H.Merijn Brand <perl5@tux.freedom.nl> | 2023-04-28 09:09:55 +0200 |
commit | 934479e4e0e2b51b70fbc94d44ba3bbec4ca3d9f (patch) | |
tree | 000ffb8b4920705d1025d90d4dbf0845fefeefc2 | |
parent | d224e8addbbaa4e23cd1690b49c872292646379d (diff) | |
download | perl-934479e4e0e2b51b70fbc94d44ba3bbec4ca3d9f.tar.gz |
ask the compiler to find libquadmath
Currently this requires special handling on Linux and is broken
on Cygwin, since the compiler internal library directories
aren't in the normal search path.
Rather than searching ourselves, let the compiler do it, and check
it's vaguely functional.
-rwxr-xr-x | Configure | 45 |
1 files changed, 37 insertions, 8 deletions
@@ -5240,9 +5240,6 @@ esac case "$usecbacktrace" in "$define") libswanted="$libswanted bfd" ;; esac -case "$usequadmath" in -"$define") libswanted="$libswanted quadmath" ;; -esac libsfound='' libsfiles='' libsdirs='' @@ -16852,17 +16849,49 @@ case "$usequadmath:$i_quadmath" in define:define) nvtype="__float128" nvsize=16 - case "$libs" in - *quadmath*) ;; - *) $cat <<EOM >&4 + : libquadmath is not in the usual places, and the place + : changes if the compiler is upgraded. So ask the compiler if it + : can find it. + : We do not need to save this, if it fails we abort. + libs="$libs -lquadmath" + set try + $cat >try.c <<EOM +#include <quadmath.h> +#include <stdio.h> +int main(int argc, char *argv[]) { + __float128 x = 1.0; + if (fabsq(logq(x)) > 1e-6) { + fputs("quadmath is broken\n", stderr); + return 1; + } + puts("define"); + return 0; +} +EOM + yyy='' + if eval $compile_ok; then + yyy=`$run ./try` + case "$yyy" in + define) ;; + *) cat <<EOM >&4 + +*** You requested the use of the quadmath library, but +*** it appears to be nonfunctional. +*** Cannot continue, aborting. + +EOM + exit 1 + ;; + esac + else + $cat <<EOM >&4 *** You requested the use of the quadmath library, but you *** do not seem to have the quadmath library installed. *** Cannot continue, aborting. EOM exit 1 - ;; - esac + fi ;; define:*) $cat <<EOM >&4 |