From f9bcdc9baf1e9f5a9af1f06be9138f5b496cffc4 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 31 Jan 2011 17:51:09 -0700 Subject: [PATCH] move float config to "mzconfig.h"; enable by default for Windows --- src/configure | 16 ++++++++++++---- src/racket/configure.ac | 6 +++--- src/racket/mzconfig.h.in | 4 ++++ src/worksp/mzconfig.h | 3 +++ 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/configure b/src/configure index 6b13c11239..52334fdb96 100755 --- a/src/configure +++ b/src/configure @@ -1339,7 +1339,7 @@ Optional Features: --enable-account 3m: use memory-accounting GC (enabled by default) --enable-compact 3m: use compact GC (no accounting) --enable-backtrace 3m: support GC backtrace dumps - --enable-float single-precision floats support (enabled by default) + --enable-float support single-precision floats (enabled by default) --enable-floatinstead compile to use single-precision by default --enable-pthread link with pthreads --enable-stackup assume "up" if stack direction cannot be determined @@ -2227,7 +2227,7 @@ show_explicitly_enabled "${enable_sgcdebug}" "SGC debug mode" show_explicitly_enabled "${enable_compact}" "Compact 3m GC" show_explicitly_enabled "${enable_backtrace}" "3m GC backtraces" -show_explicitly_disabled "${enable_float}" "Single-precision floats" +show_explicitly_enabled "${enable_float}" "Single-precision floats" show_explicitly_enabled "${enable_floatinstead}" "Single-precision default floats" show_explicitly_enabled "${enable_pthread}" "pthreads" @@ -2331,11 +2331,19 @@ fi if test "${enable_floatinstead}" = "yes" ; then enable_float=yes - OPTIONS="${OPTIONS} -DUSE_SINGLE_FLOATS_AS_DEFAULT" + +cat >>confdefs.h <<\_ACEOF +#define USE_SINGLE_FLOATS_AS_DEFAULT 1 +_ACEOF + fi if test "${enable_float}" = "yes" ; then - OPTIONS="${OPTIONS} -DUSE_SINGLE_FLOATS" + +cat >>confdefs.h <<\_ACEOF +#define USE_SINGLE_FLOATS 1 +_ACEOF + fi ###### Autoconfigure ####### diff --git a/src/racket/configure.ac b/src/racket/configure.ac index 8b5b0978cc..4fa6b5fc55 100644 --- a/src/racket/configure.ac +++ b/src/racket/configure.ac @@ -47,7 +47,7 @@ AC_ARG_ENABLE(account, [ --enable-account 3m: use memory-accounting GC ( AC_ARG_ENABLE(compact, [ --enable-compact 3m: use compact GC (no accounting)]) AC_ARG_ENABLE(backtrace, [ --enable-backtrace 3m: support GC backtrace dumps]) -AC_ARG_ENABLE(float, [ --enable-float include support for single-precision floats]) +AC_ARG_ENABLE(float, [ --enable-float support single-precision floats (enabled by default)], , enable_float=yes) AC_ARG_ENABLE(floatinstead, [ --enable-floatinstead compile to use single-precision by default]) AC_ARG_ENABLE(pthread, [ --enable-pthread link with pthreads]) @@ -390,11 +390,11 @@ fi if test "${enable_floatinstead}" = "yes" ; then enable_float=yes - OPTIONS="${OPTIONS} -DUSE_SINGLE_FLOATS_AS_DEFAULT" + AC_DEFINE(USE_SINGLE_FLOATS_AS_DEFAULT,1,[Single-precision floats by default]) fi if test "${enable_float}" = "yes" ; then - OPTIONS="${OPTIONS} -DUSE_SINGLE_FLOATS" + AC_DEFINE(USE_SINGLE_FLOATS,1,[Single-precision floats]) fi ###### Autoconfigure ####### diff --git a/src/racket/mzconfig.h.in b/src/racket/mzconfig.h.in index 5a9fa497fb..b4f8d3a250 100644 --- a/src/racket/mzconfig.h.in +++ b/src/racket/mzconfig.h.in @@ -68,4 +68,8 @@ typedef unsigned long uintptr_t; /* Enable GC2 Places Testing. */ #undef GC2_PLACES_TESTING +/* Enable single-precision floats [as default]: */ +#undef USE_SINGLE_FLOATS +#undef USE_SINGLE_FLOATS_AS_DEFAULT + #endif diff --git a/src/worksp/mzconfig.h b/src/worksp/mzconfig.h index f449d74d7e..fe46169202 100644 --- a/src/worksp/mzconfig.h +++ b/src/worksp/mzconfig.h @@ -41,4 +41,7 @@ /* Enable futures: */ #define MZ_USE_FUTURES +/* Enable single-precision floats: */ +#define USE_SINGLE_FLOATS + #endif