diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-06-17 15:40:24 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-06-17 15:40:24 (GMT) |
commit | f51fcf3ffa96b31b3d94434aec6a20ed0432975d (patch) | |
tree | 1923919319c03abbb2b19e04779f106e5c3f322e /configure | |
parent | 1ea65644191f8e260a31ccdc7ca4ba073791951b (diff) | |
download | hdf5-f51fcf3ffa96b31b3d94434aec6a20ed0432975d.zip hdf5-f51fcf3ffa96b31b3d94434aec6a20ed0432975d.tar.gz hdf5-f51fcf3ffa96b31b3d94434aec6a20ed0432975d.tar.bz2 |
[svn-r27225] new test for __float128
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 179 |
1 files changed, 91 insertions, 88 deletions
@@ -726,7 +726,6 @@ H5CONFIG_F_NUM_RKIND FORTRAN_SIZEOF_LONG_DOUBLE FORTRAN_C_LONG_DOUBLE_IS_UNIQUE FORTRAN_HAVE_C_LONG_DOUBLE -PAC_C_MAX_REAL_PRECISION HAVE_Fortran_INTEGER_SIZEOF_16 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF PAC_FORTRAN_NATIVE_DOUBLE_KIND @@ -775,6 +774,7 @@ ac_ct_CC LDFLAGS CFLAGS CC +PAC_C_MAX_REAL_PRECISION UNAME_INFO enable_static enable_shared @@ -3947,6 +3947,7 @@ $as_echo "done" >&6; } UNAME_INFO=`uname -a` + ## ---------------------------------------------------------------------- ## Some platforms have broken basename, and/or xargs programs. Check ## that it actually does what it's supposed to do. Catch this early @@ -5635,12 +5636,9 @@ cat >>confdefs.h <<_ACEOF _ACEOF -if test "$ac_cv_sizeof___float128" != 0; then - -$as_echo "#define HAVE_FLOAT128 1" >>confdefs.h - - HAVE_QUADMATH=0 - for ac_header in quadmath.h +HAVE_FLOAT128=0 +HAVE_QUADMATH=0 +for ac_header in quadmath.h do : ac_fn_c_check_header_mongrel "$LINENO" "quadmath.h" "ac_cv_header_quadmath_h" "$ac_includes_default" if test "x$ac_cv_header_quadmath_h" = xyes; then : @@ -5652,8 +5650,93 @@ fi done - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking maximum decimal precision for C" >&5 +$as_echo_n "checking maximum decimal precision for C... " >&6; } +rm -f pac_Cconftest.out + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include <float.h> + #include <stdio.h> + #define CHECK_FLOAT128 $ac_cv_sizeof___float128 + #if CHECK_FLOAT128!=0 + # if $HAVE_QUADMATH!=0 + #include <quadmath.h> + # endif + #define C_FLT128_DIG FLT128_DIG + #endif + #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define C_LDBL_DIG DECIMAL_DIG + #else + #define C_LDBL_DIG LDBL_DIG + #endif + +int +main () +{ + + FILE * pFile; + pFile = fopen("pac_Cconftest.out","w"); + fprintf(pFile, "%d\n %d\n", C_LDBL_DIG, C_FLT128_DIG); + + ; + return 0; +} + +_ACEOF + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + if ac_fn_c_try_run "$LINENO"; then : + + if test -s pac_Cconftest.out ; then + LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" + FLT128_DIG="`sed -n '2p' pac_Cconftest.out`" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No output from test program!" >&5 +$as_echo "$as_me: WARNING: No output from test program!" >&2;} + fi + rm -f pac_Cconftest.out + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C program fails to build or run!" >&5 +$as_echo "$as_me: WARNING: C program fails to build or run!" >&2;} + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam +fi + + +if test "$ac_cv_sizeof___float128" != 0; then +## Check if __float128 and c_long_double are the same size and precision + if test "$ac_cv_sizeof___float128" = "$ac_cv_sizeof_long_double" && test "$LDBL_DIG" = "$FLT128_DIG"; then + +$as_echo "#define HAVE_FLOAT128 0" >>confdefs.h + + PAC_C_MAX_REAL_PRECISION=$LDBL_DIG + else + +$as_echo "#define HAVE_FLOAT128 1" >>confdefs.h + + PAC_C_MAX_REAL_PRECISION=$FLT128_DIG + fi +else + PAC_C_MAX_REAL_PRECISION=$LDBL_DIG +fi + +cat >>confdefs.h <<_ACEOF +#define PAC_C_MAX_REAL_PRECISION $PAC_C_MAX_REAL_PRECISION +_ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_C_MAX_REAL_PRECISION" >&5 +$as_echo "$PAC_C_MAX_REAL_PRECISION" >&6; } ## ---------------------------------------------------------------------- ## Check if they would like the Fortran interface compiled ## @@ -7619,7 +7702,6 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu - ## Setting definition if there is a 16 byte fortran integer if `echo $PAC_FC_ALL_INTEGER_KINDS_SIZEOF | grep '16' >/dev/null`; then HAVE_Fortran_INTEGER_SIZEOF_16="1" @@ -7803,85 +7885,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking maximum decimal precision for C" >&5 -$as_echo_n "checking maximum decimal precision for C... " >&6; } -rm -f pac_Cconftest.out - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include <float.h> - #include <stdio.h> - #define CHECK_FLOAT128 $ac_cv_sizeof___float128 - #if CHECK_FLOAT128!=0 - # if $HAVE_QUADMATH!=0 - #include <quadmath.h> - # endif - #define C_LDBL_DIG FLT128_DIG - #else - # if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define C_LDBL_DIG DECIMAL_DIG - # else - #define C_LDBL_DIG LDBL_DIG - # endif - #endif - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - - FILE * pFile; - pFile = fopen("pac_Cconftest.out","w"); - fprintf(pFile, "%d\n", C_LDBL_DIG); - - ; - return 0; -} - -_ACEOF - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - if ac_fn_c_try_run "$LINENO"; then : - - if test -s pac_Cconftest.out ; then - LDBL_DIG="`cat pac_Cconftest.out`" - -cat >>confdefs.h <<_ACEOF -#define PAC_C_MAX_REAL_PRECISION $LDBL_DIG -_ACEOF - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No output from test program!" >&5 -$as_echo "$as_me: WARNING: No output from test program!" >&2;} - fi - rm -f pac_Cconftest.out - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C program fails to build or run!" >&5 -$as_echo "$as_me: WARNING: C program fails to build or run!" >&2;} - -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDBL_DIG" >&5 -$as_echo "$LDBL_DIG" >&6; } - else FC="no" fi |