summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2004-05-11 20:26:21 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2004-05-11 20:26:21 (GMT)
commit44cb906eb77e050c6187152592fa5418eba6e075 (patch)
treee68b3db2a55672042ef79535adbb57712dc0a3a6 /configure
parent60ae885fd1d3fad67970dcf2c86f784ba36a3b4d (diff)
downloadhdf5-44cb906eb77e050c6187152592fa5418eba6e075.zip
hdf5-44cb906eb77e050c6187152592fa5418eba6e075.tar.gz
hdf5-44cb906eb77e050c6187152592fa5418eba6e075.tar.bz2
[svn-r8504] Purpose: bug fix
Description: The HP compiler cannot convert from float-point numbers to unsigned long long correctly. It sets the maximal value of unsigned long long as 0x7fffffffffffffff. Solution: Skip the conversion test when this happens by testing it during configuration. Platforms tested: kelgia(HP-UX 11) and fuss(RH 8)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure76
1 files changed, 73 insertions, 3 deletions
diff --git a/configure b/configure
index d1b676a..4939826 100755
--- a/configure
+++ b/configure
@@ -33384,8 +33384,8 @@ else
echo "${ECHO_T}no" >&6
fi
-echo "$as_me:$LINENO: checking if accurately converting floating-point to unsigned long long values works" >&5
-echo $ECHO_N "checking if accurately converting floating-point to unsigned long long values works... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking if accurately roundup converting floating-point to unsigned long long values" >&5
+echo $ECHO_N "checking if accurately roundup converting floating-point to unsigned long long values... $ECHO_C" >&6
if test "${hdf5_cv_fp_to_ullong_bottom_bit_works+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -33401,7 +33401,7 @@ else
int main(void)
{
- float f = 111.60;
+ float f = 111.60;
double d = 222.55;
unsigned long long l1 = (unsigned long long)f;
unsigned long long l2 = (unsigned long long)d;
@@ -33454,6 +33454,76 @@ else
echo "${ECHO_T}no" >&6
fi
+echo "$as_me:$LINENO: checking if right maximum converting floating-point to unsigned long long values" >&5
+echo $ECHO_N "checking if right maximum converting floating-point to unsigned long long values... $ECHO_C" >&6
+
+if test "${hdf5_cv_fp_to_ullong_right_maximum+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+ int main(void)
+ {
+ float f = 9701917572145405952.00f;
+ double d = 9701917572145405952.00;
+ unsigned long long l1 = (unsigned long long)f;
+ unsigned long long l2 = (unsigned long long)d;
+ unsigned long long l3 = 0x7fffffffffffffffLLU;
+ int ret = 0;
+
+ if(l1 <= l3 || l2 <= l3)
+ ret = 1;
+
+done:
+ exit(ret);
+ }
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ hdf5_cv_fp_to_ullong_right_maximum=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+( exit $ac_status )
+hdf5_cv_fp_to_ullong_right_maximum=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+
+
+if test ${hdf5_cv_fp_to_ullong_right_maximum} = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define FP_TO_ULLONG_RIGHT_MAXIMUM 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
echo "$as_me:$LINENO: checking if compiling unsigned long long to floating-point typecasts work" >&5
echo $ECHO_N "checking if compiling unsigned long long to floating-point typecasts work... $ECHO_C" >&6
if test "${hdf5_cv_ullong_to_fp_cast_works+set}" = set; then