>From 9003e0a643aef003c8858db4936c3f57607d450b Mon Sep 17 00:00:00 2001 From: "A. Gordon"
Date: Tue, 15 Apr 2014 11:58:11 -0400 Subject: [PATCH] m4: tests for buggy expl() implementations On some systems (OpenBSD 5.4), expl() incorrectly returns 'nan' for small values. Compare the result of exp() with expl(), and use Gnulib's expl if needed. --- m4/expl.m4 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/m4/expl.m4 b/m4/expl.m4 index 247bc6e..1d78534 100644 --- a/m4/expl.m4 +++ b/m4/expl.m4 @@ -87,5 +87,36 @@ AC_DEFUN([gl_FUNC_EXPL], esac fi fi + dnl On some systems (OpenBSD5.4) the system's native expl() is buggy: + dnl it returns 'nan' for small values. This test compares expl() to exp() . + if test $gl_cv_func_expl_no_libm = yes \ + || test $gl_cv_func_expl_in_libm = yes; then + AC_CACHE_CHECK([checks whether expl is buggy], + [gl_cv_func_expl_buggy], + [ + save_LIBS="$LIBS" + LIBS="$EXPL_LIBM $FABS_LIBM" + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include