From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id 717553858D35; Thu, 20 Jan 2022 00:58:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 717553858D35 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Frysinger To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] newlib: libm: switch to autoconf long double macro X-Act-Checkin: newlib-cygwin X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: 0f29c6fc3c0f6318315cc77ae0a70ce8122cb9a3 X-Git-Newrev: 6783cceb0acdf163f8f8843f63c17e08c07b88e9 Message-Id: <20220120005829.717553858D35@sourceware.org> Date: Thu, 20 Jan 2022 00:58:29 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2022 00:58:29 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D6783cceb0ac= df163f8f8843f63c17e08c07b88e9 commit 6783cceb0acdf163f8f8843f63c17e08c07b88e9 Author: Mike Frysinger Date: Mon Jan 17 00:42:53 2022 -0500 newlib: libm: switch to autoconf long double macro =20 Now that we require a recent version of autoconf, we can rely on this macro working. We shift the call in configure.ac down a little to help keep the generated diff minimal -- there should be no functional difference otherwise. This is because the autoconf macros will call a bunch of standard toolchain macros first, and arguably the current code is incorrect in how it does its testing. Diff: --- newlib/libm/configure | 102 +++++++++++++++++++++++++++----------------= ---- newlib/libm/configure.ac | 23 ++--------- 2 files changed, 62 insertions(+), 63 deletions(-) diff --git a/newlib/libm/configure b/newlib/libm/configure index c9a84cbd3..0dfd3b3df 100755 --- a/newlib/libm/configure +++ b/newlib/libm/configure @@ -635,6 +635,8 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS LIBM_MACHINE_LIB +HAVE_LONG_DOUBLE_FALSE +HAVE_LONG_DOUBLE_TRUE subdirs CPP OTOOL64 @@ -739,8 +741,6 @@ build newlib_basedir MAY_SUPPLY_SYSCALLS_FALSE MAY_SUPPLY_SYSCALLS_TRUE -HAVE_LONG_DOUBLE_FALSE -HAVE_LONG_DOUBLE_TRUE NEWLIB_HW_FP_FALSE NEWLIB_HW_FP_TRUE target_alias @@ -2194,41 +2194,6 @@ else fi =20 =20 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking long double sup= port" >&5 -$as_echo_n "checking Checking long double support... " >&6; } -if ${acnewlib_cv_type_long_double+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.c <&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=3D$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 - test $ac_status =3D 0; }; } -then - acnewlib_cv_type_long_double=3Dyes -else - acnewlib_cv_type_long_double=3Dno -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acnewlib_cv_type_long_do= uble" >&5 -$as_echo "$acnewlib_cv_type_long_double" >&6; } - if test x"$acnewlib_cv_type_long_double" =3D x"yes"; then - HAVE_LONG_DOUBLE_TRUE=3D - HAVE_LONG_DOUBLE_FALSE=3D'#' -else - HAVE_LONG_DOUBLE_TRUE=3D'#' - HAVE_LONG_DOUBLE_FALSE=3D -fi - - ac_aux_dir=3D for ac_dir in ../.. "$srcdir"/../..; do if test -f "$ac_dir/install-sh"; then @@ -11651,7 +11616,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11654 "configure" +#line 11619 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H @@ -11757,7 +11722,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11760 "configure" +#line 11725 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H @@ -12001,6 +11966,57 @@ fi subdirs=3D"$subdirs machine" =20 =20 + + { $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" =3D yes; then + ac_cv_type_long_double=3Dyes + 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 =3D 0.0L; +int +main () +{ +static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and= double is 8. */ + sizeof (double) <=3D sizeof (long double))]; +test_array [0] =3D 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_long_double=3Dyes +else + ac_cv_type_long_double=3Dno +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 =3D yes; then + +$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h + + fi + + if test x"$ac_cv_type_long_double" =3D x"yes"; then + HAVE_LONG_DOUBLE_TRUE=3D + HAVE_LONG_DOUBLE_FALSE=3D'#' +else + HAVE_LONG_DOUBLE_TRUE=3D'#' + HAVE_LONG_DOUBLE_FALSE=3D +fi + + LIBM_MACHINE_LIB=3D if test -n "${libm_machine_dir}"; then if test "${use_libtool}" =3D "yes"; then @@ -12163,10 +12179,6 @@ if test -z "${NEWLIB_HW_FP_TRUE}" && test -z "${NE= WLIB_HW_FP_FALSE}"; then as_fn_error $? "conditional \"NEWLIB_HW_FP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_LONG_DOUBLE_TRUE}" && test -z "${HAVE_LONG_DOUBLE_FALSE= }"; then - as_fn_error $? "conditional \"HAVE_LONG_DOUBLE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS= _FALSE}"; then as_fn_error $? "conditional \"MAY_SUPPLY_SYSCALLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -12227,6 +12239,10 @@ if test -z "${USE_LIBTOOL_TRUE}" && test -z "${USE= _LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_LONG_DOUBLE_TRUE}" && test -z "${HAVE_LONG_DOUBLE_FALSE= }"; then + as_fn_error $? "conditional \"HAVE_LONG_DOUBLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi =20 : "${CONFIG_STATUS=3D./config.status}" ac_write_fail=3D0 diff --git a/newlib/libm/configure.ac b/newlib/libm/configure.ac index eabb1ba9c..3f9c01e15 100644 --- a/newlib/libm/configure.ac +++ b/newlib/libm/configure.ac @@ -13,26 +13,6 @@ AC_ARG_ENABLE(newlib_hw_fp, esac],[newlib_hw_fp=3Dfalse]) AM_CONDITIONAL(NEWLIB_HW_FP, test x$newlib_hw_fp =3D xtrue) =20 -dnl Autoconf 2.59 doesn't support the AC_TYPE_LONG_DOUBLE macro. Instead o= f: -dnl AC_TYPE_LONG_DOUBLE -dnl AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$ac_cv_type_long_double" =3D= x"yes") -dnl we specify our own long double test. -AC_CACHE_CHECK([Checking long double support], [acnewlib_cv_type_long_doub= le],[dnl -cat > conftest.c <&AS_MESSAGE_LOG= _FD]) -then - acnewlib_cv_type_long_double=3Dyes -else - acnewlib_cv_type_long_double=3Dno -fi -rm -f conftest*]) -AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$acnewlib_cv_type_long_double" =3D= x"yes") - dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.=20 AC_CONFIG_AUX_DIR(../..) =20 @@ -49,6 +29,9 @@ fi =20 AC_CONFIG_SUBDIRS(machine) =20 +AC_TYPE_LONG_DOUBLE +AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$ac_cv_type_long_double" =3D x"yes= ") + LIBM_MACHINE_LIB=3D if test -n "${libm_machine_dir}"; then if test "${use_libtool}" =3D "yes"; then