summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cb9802a)
raw | patch | inline | side by side (parent: cb9802a)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 12 Mar 2007 11:34:16 +0000 (12:34 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 12 Mar 2007 11:34:16 +0000 (12:34 +0100) |
configure.in | patch | blob | history |
diff --git a/configure.in b/configure.in
index 69f111a4d912b9378dbf24ee677e15845d2c0cba..48029d05f6a65c7dd570e93fc9bab80666673c56 100644 (file)
--- a/configure.in
+++ b/configure.in
# For traffic module
AC_CHECK_FUNCS(getifaddrs)
+# Check for NAN
+nan_type="none"
+if test "x$nan_type" = "xnone"; then
+ AC_CACHE_CHECK([whether NAN is defined by default],
+ [have_nan_default],
+ AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <math.h>
+static float foo = NAN;
+ ]],
+ [[
+ if (isnan (foo))
+ return 0;
+ else
+ return 1;
+ ]]),
+ [have_nan_default="yes"],
+ [have_nan_default="no"]
+ )
+ )
+ if test "x$have_nan_default" = "xyes"
+ then
+ nan_type="default"
+ AC_DEFINE(NAN_STATIC_DEFAULT, 1,
+ [Define if NAN is defined by default and can initialize static variables.])
+ fi
+fi
+if test "x$nan_type" = "xnone"; then
+ AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
+ [have_nan_isoc],
+ AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#define __USE_ISOC99 1
+#include <math.h>
+static float foo = NAN;
+ ]],
+ [[
+ if (isnan (foo))
+ return 0;
+ else
+ return 1;
+ ]]),
+ [have_nan_isoc="yes"],
+ [have_nan_isoc="no"]
+ )
+ )
+ if test "x$have_nan_isoc" = "xyes"
+ then
+ nan_type="isoc99"
+ AC_DEFINE(NAN_STATIC_ISOC, 1,
+ [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
+ fi
+fi
+if test "x$nan_type" = "xnone"; then
+ AC_CACHE_CHECK([whether NAN can be defined by 0/0],
+ [have_nan_zero],
+ AC_RUN_IFELSE(
+ AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <math.h>
+#define NAN (0.0 / 0.0)
+#ifndef isnan
+# define isnan(f) ((f) != (f))
+#endif
+static float foo = NAN;
+ ]],
+ [[
+ if (isnan (foo))
+ return 0;
+ else
+ return 1;
+ ]]),
+ [have_nan_zero="yes"],
+ [have_nan_zero="no"]
+ )
+ )
+ if test "x$have_nan_zero" = "xyes"
+ then
+ nan_type="zero"
+ AC_DEFINE(NAN_ZERO_ZERO, 1,
+ [Define if NAN can be defined as (0.0 / 0.0)])
+ fi
+fi
+if test "x$nan_type" = "xnone"; then
+ AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
+fi
+
# For mount interface
#AC_CHECK_FUNCS(getfsent getvfsent)