Mercurial > hg > octave-nkf > gnulib-hg
changeset 8827:ef4a736e6bcc
New module 'frexpl-nolibm'.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 18 May 2007 17:21:44 +0000 |
parents | e4a5ce1846d4 |
children | c7386549da0d |
files | ChangeLog m4/frexpl.m4 modules/frexpl-nolibm |
diffstat | 3 files changed, 68 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-18 Bruno Haible <bruno@clisp.org> + + * modules/frexpl-nolibm: New file. + * m4/frexpl.m4 (gl_FUNC_FREXPL_NO_LIBM): New macro. + 2007-05-17 Paul Eggert <eggert@cs.ucla.edu> * lib/dirent_.h: Prefer #include_next <foo.h> to #include
--- a/m4/frexpl.m4 +++ b/m4/frexpl.m4 @@ -1,4 +1,4 @@ -# frexpl.m4 serial 2 +# frexpl.m4 serial 3 dnl Copyright (C) 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -60,6 +60,39 @@ AC_SUBST([FREXPL_LIBM]) ]) +AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM], +[ + AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_CACHE_CHECK([whether frexpl() can be used without linking with libm], + [gl_cv_func_frexpl_no_libm], + [ + AC_TRY_LINK([#include <math.h> + long double x;], + [int e; return frexpl (x, &e) > 0;], + [gl_cv_func_frexpl_no_libm=yes], + [gl_cv_func_frexpl_no_libm=no]) + ]) + if test $gl_cv_func_frexpl_no_libm = yes; then + gl_FUNC_FREXPL_WORKS + case "$gl_cv_func_frexpl_works" in + *yes) gl_func_frexpl_no_libm=yes ;; + *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; + esac + else + gl_func_frexpl_no_libm=no + fi + if test $gl_func_frexpl_no_libm = yes; then + AC_DEFINE([HAVE_FREXPL_IN_LIBC], 1, + [Define if the frexpl() function is available in libc.]) + dnl Also check whether it's declared. + dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>. + AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>]) + else + HAVE_DECL_FREXPL=0 + AC_LIBOBJ([frexpl]) + fi +]) + dnl Test whether frexpl() works on finite numbers (this fails on AIX 5.1) and dnl also on infinite numbers (this fails e.g. on IRIX 6.5). AC_DEFUN([gl_FUNC_FREXPL_WORKS],
new file mode 100644 --- /dev/null +++ b/modules/frexpl-nolibm @@ -0,0 +1,29 @@ +Description: +frexpl() function: split a 'long double' into its constituents, without +requiring libm. + +Files: +lib/frexpl.c +lib/frexp.c +m4/frexpl.m4 + +Depends-on: +math +isnanl-nolibm +fpucw + +configure.ac: +gl_FUNC_FREXPL_NO_LIBM +gl_MATH_MODULE_INDICATOR([frexpl]) + +Makefile.am: + +Include: +<math.h> + +License: +LGPL + +Maintainer: +Bruno Haible, Paolo Bonzini +