dnl *** Networking library checks ***
dnl *********************************
-AC_CHECK_HEADERS(unistd.h)\r
+AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h)
AC_CHECK_HEADERS(sys/sockio.h sys/poll.h sys/param.h)
CPPFLAGS=$orig_CPPFLAGS
+dnl ***********************************************************************
+dnl *** Add any preprocessor options needed for ISO C99 IEEE754 support ***
+dnl ***********************************************************************
+ISO_CFLAGS=""
+orig_CPPFLAGS=$CPPFLAGS
+AC_MSG_CHECKING(if ISO C99 IEEE754 support is enabled by default)
+AC_TRY_COMPILE([ #include <math.h>], [
+ fpclassify(INFINITY)==FP_INFINITE;
+ ], [
+ dnl Nothing special needed
+ AC_MSG_RESULT(ok)
+ ], [
+ AC_MSG_RESULT(no)
+
+ dnl On glibc _GNU_SOURCE includes _ISOC99_SOURCE
+ AC_MSG_CHECKING(whether _GNU_SOURCE is needed for ISO C99 IEEE754 support)
+ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+ AC_TRY_COMPILE([ #include <math.h>], [
+ fpclassify(INFINITY)==FP_INFINITE;
+ ], [
+ AC_MSG_RESULT(ok)
+ ISO_CFLAGS="-D_GNU_SOURCE"
+ ], [
+ AC_MSG_RESULT(no)
+ dnl Add other variants here
+ AC_MSG_ERROR(No IEEE754 support)
+ ])
+ ])
+CPPFLAGS=$orig_CPPFLAGS
+CFLAGS="$CFLAGS $ISO_CFLAGS"
+
+
dnl *************************************
dnl *** Warnings to show if using GCC ***
dnl *************************************