frexpf: Drop assumption about library that defines frexpf.
[gnulib.git] / m4 / frexpf.m4
index 7928011..3aa648b 100644 (file)
@@ -1,4 +1,4 @@
-# frexpf.m4 serial 1
+# frexpf.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_DEFUN([gl_FUNC_FREXPF],
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
   AC_REQUIRE([gl_FUNC_FREXP])
 
-  dnl Test whether frexpf() exists. Assume that frexpf(), if it exists, is
-  dnl defined in the same library as frexp().
-  save_LIBS="$LIBS"
-  LIBS="$LIBS $FREXP_LIBM"
-  AC_CHECK_FUNCS([frexpf])
-  LIBS="$save_LIBS"
-  if test $ac_cv_func_frexpf = yes; then
-    FREXPF_LIBM="$FREXP_LIBM"
-  else
+  dnl Test whether frexpf() exists. We cannot assume that frexpf(), if it
+  dnl exists, is defined in the same library as frexp(). This is not the case
+  dnl on NetBSD, OpenBSD.
+  gl_MATHFUNC([frexpf], [float], [(float, int *)])
+  if test $gl_cv_func_frexpf_no_libm = no \
+     && test $gl_cv_func_frexpf_in_libm = no; then
     HAVE_FREXPF=0
     FREXPF_LIBM="$FREXP_LIBM"
   fi