+AC_CHECK_FUNCS(asinh acosh atanh copysign finite sincos trunc)
+
+# C99 specifies isinf and isnan as macros.
+# HP-UX provides only macros, no functions.
+# glibc 2.3.2 provides both macros and functions.
+# IRIX 6.5 and Solaris 8 only provide functions.
+#
+# The following tests detect isinf and isnan either as functions or as
+# macros from <math.h>. Plain AC_CHECK_FUNCS is insufficient, it doesn't
+# use <math.h> so doesn't detect on macro-only systems like HP-UX.
+#
+AC_MSG_CHECKING([for isinf])
+AC_LINK_IFELSE(
+[#include <math.h>
+int main () { return (isinf(0.0) != 0); }],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_ISINF, 1,
+ [Define to 1 if you have the `isinf' macro or function.])],
+ [AC_MSG_RESULT([no])])
+AC_MSG_CHECKING([for isnan])
+AC_LINK_IFELSE(
+[#include <math.h>
+#ifdef __MINGW32__
+#define isnan _isnan
+#endif
+int main () { return (isnan(0.0) != 0); }],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_ISNAN, 1,
+ [Define to 1 if you have the `isnan' macro or function.])],
+ [AC_MSG_RESULT([no])])
+
+# We must have a proper stack-using alloca in order for stack-copying
+# continuations to work properly. If we don't find a native one,
+# abort.