summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2007-01-15 19:42:50 +0000
committerIan Lynagh <igloo@earth.li>2007-01-15 19:42:50 +0000
commit50ebea6a8607f4d83dd2d8d99acf9a55e4d39349 (patch)
tree5474b73f02c487258fd1ddde2876f4963409f7d1 /aclocal.m4
parent85c2ef54a48b12bb7bef0e841e4948fae13d7242 (diff)
downloadhaskell-50ebea6a8607f4d83dd2d8d99acf9a55e4d39349.tar.gz
Give -fwrapv to gcc when it supports it
Fixes trac #952: Haskell requires consistent overflow behaviour, which gcc doesn't give without this flag.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m412
1 files changed, 12 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 86fdeaf76f..36c0128b7b 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -954,6 +954,18 @@ if test "$fp_cv_gcc_has_no_unit_at_a_time" = "yes"; then
AC_DEFINE([HAVE_GCC_HAS_NO_UNIT_AT_A_TIME], [1], [Define to 1 if gcc supports -fno-unit-at-a-time.])
fi])
+# FP_GCC_HAS_WRAPV
+# --------------------------
+AC_DEFUN([FP_GCC_HAS_WRAPV],
+[AC_REQUIRE([FP_HAVE_GCC])
+AC_CACHE_CHECK([whether gcc has -fwrapv], [fp_cv_gcc_has_wrapv],
+[FP_COMPARE_VERSIONS([$fp_gcc_version], [-ge], [3.4],
+ [fp_cv_gcc_has_wrapv=yes],
+ [fp_cv_gcc_has_wrapv=no])])
+if test "$fp_cv_gcc_has_wrapv" = "yes"; then
+ AC_DEFINE([HAVE_GCC_HAS_WRAPV], [1], [Define to 1 if gcc supports -fwrapv.])
+fi])
+
# FP_SETUP_PROJECT_VERSION
# ---------------------
AC_DEFUN([FP_SETUP_PROJECT_VERSION],