+
+dnl Test whether remainderf() works.
+dnl It runs into an endless loop on IRIX 6.5.
+AC_DEFUN([gl_FUNC_REMAINDERF_WORKS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_FUNCS_ONCE([alarm])
+ AC_CACHE_CHECK([whether remainderf works], [gl_cv_func_remainderf_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <math.h>
+#if HAVE_ALARM
+# include <unistd.h>
+#endif
+extern
+#ifdef __cplusplus
+"C"
+#endif
+float remainderf (float, float);
+volatile float x;
+volatile float y;
+float z;
+int main ()
+{
+#if HAVE_ALARM
+ alarm (5);
+#endif
+ /* This test fails on IRIX 6.5. */
+ x = 9.316161e+37f;
+ y = 0.5475547314f;
+ z = remainderf (x, y);
+ return 0;
+}
+]])],
+ [gl_cv_func_remainderf_works=yes],
+ [gl_cv_func_remainderf_works=no],
+ [case "$host_os" in
+ irix*) gl_cv_func_remainderf_works="guessing no";;
+ *) gl_cv_func_remainderf_works="guessing yes";;
+ esac
+ ])
+ ])
+])