Fix link errors with Sun C 5.0 on Solaris 10.
[pspp] / m4 / floorf.m4
index 3baadc03d6d5ce538b31d0442943d233e81ee9e0..91b6900c75da93a62018297e15b0c0cee26a73e1 100644 (file)
@@ -1,4 +1,4 @@
-# floorf.m4 serial 2
+# floorf.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,
@@ -15,14 +15,18 @@ AC_DEFUN([gl_FUNC_FLOORF],
     dnl Test whether floorf() can be used without libm.
     gl_FUNC_FLOORF_LIBS
     if test "$FLOORF_LIBM" = "?"; then
-      FLOORF_LIBM=
+      dnl Sun C 5.0 on Solaris declares floorf() and has it in the system-wide
+      dnl libm.so, but not in the libm.so that the compiler uses.
+      REPLACE_FLOORF=1
     fi
   else
-    HAVE_DECL_FLOORF=0
+    REPLACE_FLOORF=1
+  fi
+  if test $REPLACE_FLOORF = 1; then
     AC_LIBOBJ([floorf])
     FLOORF_LIBM=
   fi
-  AC_SUBST([HAVE_DECL_FLOORF])
+  AC_SUBST([REPLACE_FLOORF])
   AC_SUBST([FLOORF_LIBM])
 ])