From 37dc3ffa01613322972faf62a0a226d525ff069b Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 1 Nov 2015 13:44:52 -0700 Subject: [PATCH] report error when `--enable-extflonums` fails The `--enable-extflonums` option doesn't really do anything, since extflonum support is enabled automtatically when the compiler's configuration allows it. To make this slightly less confusing, report an error when extflonums cannot be supported, despite `--enable-extflonums`. The error is reported via compiling, instead of via `configure`, but hopefully that's enough to be helpful. --- racket/src/configure | 5 +++++ racket/src/racket/configure.ac | 4 ++++ racket/src/racket/include/scheme.h | 3 +++ racket/src/racket/mzconfig.h.in | 3 +++ 4 files changed, 15 insertions(+) diff --git a/racket/src/configure b/racket/src/configure index dbc52ea48d..21aecfa370 100755 --- a/racket/src/configure +++ b/racket/src/configure @@ -6583,6 +6583,11 @@ $as_echo "#define MZ_NO_EXTFLONUMS 1" >>confdefs.h fi fi +if test "${enable_extflonum}" = "yes" ; then + $as_echo "#define MZ_INSIST_EXTFLONUMS 1" >>confdefs.h + +fi + ############## libffi ################ # Depends on pthread on some platforms diff --git a/racket/src/racket/configure.ac b/racket/src/racket/configure.ac index 46b76c953f..bff753b8ed 100644 --- a/racket/src/racket/configure.ac +++ b/racket/src/racket/configure.ac @@ -1475,6 +1475,10 @@ if test "${enable_extflonum}" = "default" ; then fi fi +if test "${enable_extflonum}" = "yes" ; then + AC_DEFINE(MZ_INSIST_EXTFLONUMS) +fi + ############## libffi ################ # Depends on pthread on some platforms diff --git a/racket/src/racket/include/scheme.h b/racket/src/racket/include/scheme.h index 1ede3d0c9b..4381de52e2 100644 --- a/racket/src/racket/include/scheme.h +++ b/racket/src/racket/include/scheme.h @@ -93,6 +93,9 @@ typedef struct { typedef long double mz_long_double; # endif #else +# ifdef MZ_INSIST_EXTFLONUMS +# error "cannot support extflonums; you may need to adjust compiler options" +# endif typedef double mz_long_double; #endif diff --git a/racket/src/racket/mzconfig.h.in b/racket/src/racket/mzconfig.h.in index 154363d47e..8987178abf 100644 --- a/racket/src/racket/mzconfig.h.in +++ b/racket/src/racket/mzconfig.h.in @@ -95,6 +95,9 @@ typedef unsigned long uintptr_t; /* To disable extflonums when they would otherwise work: */ #undef MZ_NO_EXTFLONUMS +/* Extflonums are specifically requested (so complain if not supported): */ +#undef MZ_INSIST_EXTFLONUMS + /* Library subpath */ #undef SPLS_SUFFIX