bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module 'fabsf'


From: Bruno Haible
Subject: Re: new module 'fabsf'
Date: Fri, 7 Oct 2011 00:22:58 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

>   dnl Test whether fabsf() exists. Assume that fabsf(), if it exists, is
>   dnl defined in the same library as fabs().

This was a wrong assumption. On FreeBSD, NetBSD, OpenBSD, fabs() is in libc,
whereas fabsf() is in libm. Fixed as follows:


2011-10-06  Bruno Haible  <address@hidden>

        fabsf: Drop assumption about library that defines fabsf.
        * m4/fabsf.m4 (gl_FUNC_FABSF): Use gl_MATHFUNC macro instead of
        AC_CHECK_FUNCS.
        * modules/fabsf (Files): Add m4/mathfunc.m4.

--- m4/fabsf.m4.orig    Fri Oct  7 00:21:36 2011
+++ m4/fabsf.m4 Fri Oct  7 00:21:34 2011
@@ -1,4 +1,4 @@
-# fabsf.m4 serial 1
+# fabsf.m4 serial 2
 dnl Copyright (C) 2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,15 +9,12 @@
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
   AC_REQUIRE([gl_FUNC_FABS])
 
-  dnl Test whether fabsf() exists. Assume that fabsf(), if it exists, is
-  dnl defined in the same library as fabs().
-  save_LIBS="$LIBS"
-  LIBS="$LIBS $FABS_LIBM"
-  AC_CHECK_FUNCS([fabsf])
-  LIBS="$save_LIBS"
-  if test $ac_cv_func_fabsf = yes; then
-    FABSF_LIBM="$FABS_LIBM"
-  else
+  dnl Test whether fabsf() exists. We cannot assume that fabsf(), if it
+  dnl exists, is defined in the same library as fabs(). This is not the case
+  dnl on FreeBSD, NetBSD, OpenBSD.
+  gl_MATHFUNC([fabsf], [float], [(float)])
+  if test $gl_cv_func_fabsf_no_libm = no \
+     && test $gl_cv_func_fabsf_in_libm = no; then
     HAVE_FABSF=0
     FABSF_LIBM="$FABS_LIBM"
   fi
--- modules/fabsf.orig  Fri Oct  7 00:21:36 2011
+++ modules/fabsf       Fri Oct  7 00:15:11 2011
@@ -4,6 +4,7 @@
 Files:
 lib/fabsf.c
 m4/fabsf.m4
+m4/mathfunc.m4
 
 Depends-on:
 math
-- 
In memoriam Bahriye Üçok <http://en.wikipedia.org/wiki/Bahriye_Üçok>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]