closes bpo-33512: use standard for detecting long double (GH-6847)

This commit is contained in:
Eitan Adler 2018-05-15 22:58:09 -07:00 committed by Benjamin Peterson
parent 2a7bacbd91
commit 3055c947f9
4 changed files with 33 additions and 37 deletions

View File

@ -0,0 +1 @@
configure's check for "long double" has been simplified

57
configure vendored
View File

@ -779,7 +779,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -887,7 +886,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1140,15 +1138,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1286,7 +1275,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1439,7 +1428,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -8603,32 +8591,48 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support" >&5
$as_echo_n "checking for long double support... " >&6; }
have_long_double=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5
$as_echo_n "checking for long double... " >&6; }
if ${ac_cv_type_long_double+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$GCC" = yes; then
ac_cv_type_long_double=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* The Stardent Vistra knows sizeof (long double), but does
not support it. */
long double foo = 0.0L;
int
main ()
{
long double x; x = (long double)0;
static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
sizeof (double) <= sizeof (long double))];
test_array [0] = 0;
return test_array [0];
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_type_long_double=yes
else
ac_cv_type_long_double=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5
$as_echo "$ac_cv_type_long_double" >&6; }
if test $ac_cv_type_long_double = yes; then
$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
have_long_double=yes
fi
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_long_double" >&5
$as_echo "$have_long_double" >&6; }
if test "$have_long_double" = yes ; then
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@ -8662,7 +8666,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
fi
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects

View File

@ -2198,16 +2198,8 @@ AC_CHECK_SIZEOF(size_t, 4)
AC_CHECK_SIZEOF(pid_t, 4)
AC_CHECK_SIZEOF(uintptr_t)
AC_MSG_CHECKING(for long double support)
have_long_double=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]])],[
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
have_long_double=yes
],[])
AC_MSG_RESULT($have_long_double)
if test "$have_long_double" = yes ; then
AC_TYPE_LONG_DOUBLE
AC_CHECK_SIZEOF(long double, 16)
fi
AC_CHECK_SIZEOF(_Bool, 1)

View File

@ -617,7 +617,7 @@
/* Define to 1 if you have the `log2' function. */
#undef HAVE_LOG2
/* Define this if you have the type long double. */
/* Define to 1 if the system has the type `long double'. */
#undef HAVE_LONG_DOUBLE
/* Define to 1 if you have the `lstat' function. */