- AC_CHECK_DECLS([roundl], , , [[#include <math.h>]])
- if test "$ac_cv_have_decl_roundl" = yes; then
- gl_CHECK_MATH_LIB([ROUNDL_LIBM], [x = roundl (x);])
- if test "$ROUNDL_LIBM" = missing; then
- REPLACE_ROUNDL=1
- fi
+ gl_CHECK_MATH_LIB([ROUNDL_LIBM], [x = roundl (x);],
+ [extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ long double roundl (long double);
+ ])
+ if test "$ROUNDL_LIBM" != missing; then
+ HAVE_ROUNDL=1
+ dnl Also check whether it's declared.
+ dnl IRIX 6.5 has roundl() in libm but doesn't declare it in <math.h>.
+ AC_CHECK_DECLS([roundl], , [HAVE_DECL_ROUNDL=0], [[#include <math.h>]])
+