fi
AC_MSG_RESULT(${ok})
+AC_MSG_CHECKING([for copysign])
+AC_TRY_LINK([#include <math.h>
+], [double x = copysign(3.14159, -2.7183);], ok=yes, ok=no)
+if test "$ok" = "yes"; then
+ AC_DEFINE(HAVE_COPYSIGN,1,[Define if the copysign function/macro is available.])
+fi
+AC_MSG_RESULT(${ok})
+
dnl -----------------------------------------------------------------------
if test "x$with_cxx" = xyes; then
# define HUGE_VAL REPLACEMENT_HUGE_VAL
#endif
+#ifndef HAVE_COPYSIGN
+ /* not quite right for y == -0, but good enough for us */
+# define copysign(x, y) ((y) < 0 ? -fabs(x) : fabs(x))
+#endif
+
#ifdef __cplusplus
extern "C"
{