summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-08-23 16:32:08 +0200
committerNicholas Clark <nick@ccl4.org>2013-08-28 11:01:09 +0200
commit16e6698bf53cbe5099ca8f3c5f608acd20d7d210 (patch)
treecf2a17fcd923bb4e6cccea7873bff9f752d5d075 /Configure
parentc47d1a661f01f02ad5b41aa6275b11a9bd5a1dd2 (diff)
downloadperl-16e6698bf53cbe5099ca8f3c5f608acd20d7d210.tar.gz
Move the thrice-repeated "64bitint is buggy?" test from hints to Configure.
OpenBSD and its two* forks each have the same "is 64 bit int support buggy?" test code as a callback unit duplicated in their hints files. As the code is portable C, there seems to be no harm in moving it to Configure, and running the test on all platforms. This reduces code duplication, and will reduce it further if another OpenBSD fork appears. * This week.
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure53
1 files changed, 53 insertions, 0 deletions
diff --git a/Configure b/Configure
index e4e40752e9..df7c5cd0f3 100755
--- a/Configure
+++ b/Configure
@@ -5859,6 +5859,59 @@ if $test -f use64bitint.cbu; then
fi
case "$use64bitint" in
"$define"|true|[yY]*)
+ : This test was common to all the OpenBSD forks, and seems harmless for
+ : other platforms:
+ echo " "
+ echo "Checking if your C library has broken 64-bit functions..." >&4
+ $cat >try.c <<EOCP
+#include <stdio.h>
+typedef $uquadtype myULL;
+int main (void)
+{
+ struct {
+ double d;
+ myULL u;
+ } *p, test[] = {
+ {4294967303.15, 4294967303ULL},
+ {4294967294.2, 4294967294ULL},
+ {4294967295.7, 4294967295ULL},
+ {0.0, 0ULL}
+ };
+ for (p = test; p->u; p++) {
+ myULL x = (myULL)p->d;
+ if (x != p->u) {
+ printf("buggy\n");
+ return 0;
+ }
+ }
+ printf("ok\n");
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ libcquad=`./try`
+ echo "Your C library's 64-bit functions are $libcquad."
+ else
+ echo "(I can't seem to compile the test program.)"
+ echo "Assuming that your C library's 64-bit functions are ok."
+ libcquad="ok"
+ fi
+ $rm -f try.c try
+
+ case "$libcquad" in
+ buggy*)
+ cat >&4 <<EOM
+
+*** You have a C library with broken 64-bit functions.
+*** 64-bit support does not work reliably in this configuration.
+*** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
+*** Cannot continue, aborting.
+
+EOM
+ exit 1
+ ;;
+ esac
case "$longsize" in
4) case "$archname64" in
'') archname64=64int ;;