summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.Merijn Brand <perl5@tux.freedom.nl>2023-04-28 09:09:55 +0200
committerH.Merijn Brand <perl5@tux.freedom.nl>2023-04-28 09:09:55 +0200
commit934479e4e0e2b51b70fbc94d44ba3bbec4ca3d9f (patch)
tree000ffb8b4920705d1025d90d4dbf0845fefeefc2
parentd224e8addbbaa4e23cd1690b49c872292646379d (diff)
downloadperl-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-xConfigure45
1 files changed, 37 insertions, 8 deletions
diff --git a/Configure b/Configure
index e7107a28f7..7614257b65 100755
--- a/Configure
+++ b/Configure
@@ -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