Hi Piotr,

On Tue, May 03, 2022 at 12:21:12PM +0200, pku...@freebsd.org wrote:
> FreeBSD/powerpc* has feenableexcept() defined in fenv.h header.

Declared, not defined.  These are required to be real functions (on all
platforms that have these functions), not macros or inlines or whatever.

So what library *does* have these functions?  It would be much neater to
do the similar to the libm test but with that other library.  Just libc,
maybe?

The answer to this will probably also answer Ke Wen's questions, or at
least just point to a good and more general way of solving this :-)

Maybe the AC_CHECK_LIB could just use GCC_CHECK_MATH_FUNC or such?

You also need a changelog entry here.  Something like


2022-05-12  Piotr Kubaj  <pku...@freebsd.org>

libgfortran/
        * configure.ac (powerpc*-freebsd*): Define HAVE_FEENABLEEXCEPT if
        <fenv.h> declares the feenableexcept function.
        * configure: Regenerate.


> +case x$target in
> +  xpowerpc*-freebsd*)
> +    AC_CACHE_CHECK([for fenv.h and feenableexcept], have_feenableexcept, [
> +      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
> +        [[ #include <fenv.h>  ]],
> +        [[ feenableexcept(FE_DIVBYZERO | FE_INVALID); ]])],
> +        [ have_feenableexcept="yes" ],
> +        [ have_feenableexcept="no"  ])])

Please get rid of all surplus whitespace here.  Imitate existing tests,
if you need inspiration :-)


Segher

Reply via email to