[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git] / ghc / includes / options.h
1 /* ../options.h.  Generated automatically by configure.  */
2 /* --------------------------------------------------------------------------
3  * Configuration options
4  *
5  * Most configuration options are arguments to the configure script
6  * (try running "configure --help").  The following options are either
7  * experimental or require changes to "Prelude.hs", the standard libraries
8  * and demos and therefore cannot be modified using the configure script.
9  * Most users should leave them alone!
10  *
11  * Copyright (c) The University of Nottingham and Yale University, 1994-1997.
12  * All rights reserved. See NOTICE for details and conditions of use etc...
13  * Hugs version 1.4, December 1997
14  *
15  * $RCSfile: options.h,v $
16  * $Revision: 1.2 $
17  * $Date: 1998/12/02 13:21:51 $
18  * ------------------------------------------------------------------------*/
19
20
21 /* --------------------------------------------------------------------------
22  * Hugs paths and directories
23  * ------------------------------------------------------------------------*/
24
25 /* Define this as the default setting of HUGSPATH.                        
26  * Value may contain string "{Hugs}" (for which we will substitute the
27  * value of HUGSDIR) and should be either colon-separated (Unix)
28  * or semicolon-separated (Macintosh, Windows, DOS).  Escape
29  * characters in the path string are interpreted according to normal
30  * Haskell conventions.
31  *
32  * This value can be overridden from the command line by setting the
33  * HUGSFLAGS environment variable or by storing an appropriate value
34  * for HUGSFLAGS in the registry (Win32 only).  In all cases, use a 
35  * string of the form -P"...".  
36  */
37 #define HUGSPATH ""
38
39 /* The directory name which is substituted for the string "{Hugs}"
40  * in a path variable.  This normally points to where the Hugs libraries
41  * are installed - ie so that the file HUGSDIR/lib/Prelude.hs exists    
42  * Typical values are:                                  
43  *    "/usr/local/lib/hugs"                             
44  *    "/usr/homes/JFHaskell/hugs"                       
45  *    ".."      
46  *
47  * This value is ignored on Windows and Macintosh versions since
48  * it is assumed that the binary is installed in HUGSDIR.
49  *
50  * This value cannot be overridden from the command line or by using 
51  * environment variables.  This isn't quite as limiting as you'd think
52  * since you can always choose _not_ to use the {Hugs} variable - however,
53  * it's obviously _nicer_ to have it set correctly.
54  */
55 #ifndef HUGSDIR
56 #define HUGSDIR "."
57 #endif
58
59
60 /* --------------------------------------------------------------------------
61  * User interface options
62  * ------------------------------------------------------------------------*/
63
64 /* Define if you want to use the "Hugs for Windows" GUI.
65  * (Windows 3.1 and compatibles only)
66  */
67 #define HUGS_FOR_WINDOWS 0
68
69 /* Define if you want filenames to be converted to normal form by:
70  * o replacing relative pathnames with absolute pathnames and
71  *   eliminating .. and . where possible.
72  * o converting to lower case (only in case-insensitive filesystems)
73  */
74 #define PATH_CANONICALIZATION 0
75
76 /* Define if a command line editor is available and should be used. 
77  * There are two choices of command line editor that can be used with Hugs:
78  * GNU readline and editline (from comp.sources.misc, vol 31, issue 71)
79  */
80 #define USE_READLINE 0
81
82 /* Define if you want the small startup banner.
83  */
84 #define SMALL_BANNER 0
85
86 /* Define if you want to be able to redirect stdout/stderr to a buffer.
87  * Only necessary for the Hugs server interface (which is used in the
88  * Netscape plugin and the standalone evaluator "runhugs"). 
89  */
90 #define REDIRECT_OUTPUT (!HUGS_FOR_WINDOWS)
91
92
93 /* --------------------------------------------------------------------------
94  * Making Hugs smaller
95  * ------------------------------------------------------------------------*/
96
97 /* Define one of these to select overall size of Hugs
98  *   SMALL_HUGS     for 16 bit operation on a limited memory PC.
99  *   REGULAR_HUGS   for 32 bit operation using largish default table sizes.
100  *   LARGE_HUGS     for 32 bit operation using larger default table sizes.
101  */
102 #define SMALL_HUGS   0
103 #define REGULAR_HUGS 0
104 #define LARGE_HUGS   1
105
106 #define NUM_SYNTAX         100
107 #define NUM_TUPLES         100
108 #define NUM_OFFSETS        1024
109 #define NUM_CHARS          256
110 #if TREX
111 #define NUM_EXT            100
112 #endif
113 #define CHAR_MASK          0xff
114
115 #if     SMALL_HUGS                      /* the McDonalds mentality :-)     */
116 #define Pick(s,r,l)        s
117 #endif
118 #if     REGULAR_HUGS
119 #define Pick(s,r,l)        r
120 #endif
121 #if     LARGE_HUGS
122 #define Pick(s,r,l)        l
123 #endif
124
125 #define MINIMUMHEAP        Pick(7500,   19000,      19000)
126 #define MAXIMUMHEAP        Pick(32765,  0,          0)
127 #define DEFAULTHEAP        Pick(28000,  50000,      300000)
128
129 #define NUM_SCRIPTS        Pick(64,     100,        100)
130 #define NUM_MODULE         NUM_SCRIPTS
131 #define NUM_TYCON          Pick(60,     160,        400)
132 #define NUM_NAME           Pick(1000,   2000,       16000)
133 #define NUM_CLASSES        Pick(30,     40,         80)
134 #define NUM_INSTS          Pick(200,    300,        600)
135 #define NUM_TEXT           Pick(12000,  20000,      80000)
136 #define NUM_TEXTH          Pick(1,      10,         10)
137 #define NUM_TYVARS         Pick(800,    2000,       4000)
138 #define NUM_STACK          Pick(1800,   12000,      16000)
139 #define NUM_DTUPLES        Pick(3,      5,          5)
140
141 #define MAXPOSINT          0x7fffffff
142 #define MINNEGINT          (-MAXPOSINT-1)
143 #define MAXHUGSWORD        0xffffffffU
144
145 #define BIGBASE            Pick(100,    10000,      10000)
146 #define BIGEXP             Pick(2,      4,          4)
147
148 #define minRecovery        Pick(1000,  1000,       1000)
149 #define bitsPerWord        Pick(16,    32,         32)
150 #define wordShift          Pick(4,     5,          5)
151 #define wordMask           Pick(15,    31,         31)
152
153 /* Define to force a fixed size (NUM_TYVARS) for the current substitution.
154  * Setting this flag places a limit on the maximum complexity of
155  * expressions handled by the typechecker.  It is normally turned off
156  * but may be required for small machines/configurations.
157  */
158 #define FIXED_SUBST 0 
159
160 /* Define this to allocate tables dynamically.
161  * This is currently just a memory saving trick, but this may be
162  * extended at a later stage to allow at least some of the tables
163  * to be extended dynamically at run-time to avoid exhausted space errors.
164  */
165 #define DYN_TABLES SMALL_HUGS
166
167 /* Define this to include support for storing pointers in the heap.
168  * This is required by the code generator (which has to store 
169  * pointers to AsmObjects).
170  */
171 #define PTR_ON_HEAP 1
172
173 /* Should quantifiers be displayed in error messages.
174  * Warning: not consistently used.
175  */
176 #define DISPLAY_QUANTIFIERS 1
177
178 /* Flags to determine which raw representations and operations are available
179  * Notes:
180  * o the INTEGER implementation is quite different from GHC's
181  *   implementation so you usually don't PROVIDE_INTEGER if
182  *   using GHC compiled code.
183  * o if you turn everything on, you might end up with more then 256
184  *   bytecodes: check the value of i_ccall (the lst bytecode) to check
185  * o Addrs are used to represent literal Strings in Hugs - so you can't
186  *   really turn them off.
187  * o Either Int64 or Integer has to be provided so that we can
188  *   define BIGNUMTYPE (below)
189  */
190
191 #define PROVIDE_INTEGER
192 #define PROVIDE_INT64
193 #define PROVIDE_WORD
194 #define PROVIDE_ADDR
195 #define PROVIDE_STABLE
196 #define PROVIDE_FOREIGN
197 #define PROVIDE_WEAK
198 #define PROVIDE_ARRAY
199 #define PROVIDE_CONCURRENT
200 #define PROVIDE_PTREQUALITY
201 #define PROVIDE_COERCE
202
203 /* The following aren't options at the moment - but could be
204  * #define PROVIDE_FLOAT
205  * #define PROVIDE_DOUBLE
206  */
207
208 /* Flags to determine how Haskell types are mapped onto internal types.
209  * Note that this has to be an injection: you can't have two names
210  * for the same internal type.
211  * Also, the settings have to be consistent with GHC if GHC is being used.
212  */
213
214 #define BIGNUM_IS_INTEGER 1
215 #define BIGNUM_IS_INT64   0
216
217 #if BIGNUM_IS_INT64
218 #define BIGNUMTYPE Int64
219 #elif BIGNUM_IS_INTEGER
220 #define BIGNUMTYPE Integer
221 #else
222 #warning BIGNUMTYPE undefined
223 #endif
224
225 /* Is the default default (Int,Double) or (Integer,Double)?
226  */
227 #define DEFAULT_BIGNUM 0
228
229 /* Should lambda lifter lift constant expressions out to top level?
230  * Experimental optimisation.
231  */
232 #define LIFT_CONSTANTS 1
233
234 /* Should we run optimizer on Hugs code?
235  * Experimental optimisation.
236  */
237 #define USE_HUGS_OPTIMIZER 1
238
239 /* Are things being used in an interactive setting or a batch setting?
240  * In an interactive setting, System.exitWith should not call _exit
241  * getProgName and getProgArgs need to be handled differently, etc.
242  *
243  * Warning: this flag is ignored by an awful lot of code.
244  */
245 #define INTERACTIVE
246
247 /* Turn bytecode interpreter support on/off.
248  */
249 #define INTERPRETER 1 
250
251 /* Turn on debugging output and some sanity checks
252  */
253 /*#define DEBUG  */
254 /*#define NDEBUG */
255
256 /* Make stack tags more informative than just their size.
257  * Helps when printing the stack and when running sanity checks.
258  */
259 /*#define DEBUG_EXTRA */
260
261 /* Turn lazy blackholing on/off.
262  * Warning: Lazy blackholing can't be disabled in GHC generated code.
263  *
264  * Using eager blackholing makes things easier to debug because
265  * the blackholes are more predicatable - but it's slower and less sexy.
266  */
267 #define LAZY_BLACKHOLING 
268
269 /* Turn miniinterpreter on/off.
270  * 
271  * The mininterpreter is portable but slow - if you turn it off, 
272  * you'll probably need to provide some assembly language support
273  * for your architecture.
274  */
275 #define USE_MINIINTERPRETER 1
276
277 /* Turn registerisation on/off.
278  * 
279  * If you turn this off, you'll probably need to provide some
280  * assembly language support for your architecture.
281  */
282 #define NO_REGS
283
284
285 /* --------------------------------------------------------------------------
286  * Fancy features
287  * ------------------------------------------------------------------------*/
288
289 /* Define if T-REX; Typed Rows and EXtension should be enabled             */
290 /* Doesn't work in current system - I don't know what the primops do       */
291 #define TREX 0
292
293 /* Define if you want to run Haskell code through a preprocessor
294  * 
295  * Note that the :reload command doesn't know about any dependencies
296  * introduced by using #include so you must :load (not :reload) if
297  * you change any #included files (such as configuration files).
298  */
299 #define USE_PREPROCESSOR 1
300
301 /* Define if you want to time every evaluation. 
302  *
303  * Timing is included in the Hugs distribution for the purpose of benchmarking
304  * the Hugs interpreter, comparing its performance across a variety of
305  * different machines, and with other systems for similar languages.
306  *
307  * It would be somewhat foolish to try to use the timings produced in this
308  * way for any other purpose.  In particular, using timings to compare the
309  * performance of different versions of an algorithm is likely to give very
310  * misleading results.  The current implementation of Hugs as an interpreter,
311  * without any significant optimizations, means that there are much more
312  * significant overheads than can be accounted for by small variations in
313  * Hugs code.
314  */
315 /* #undef WANT_TIMER */
316
317
318 /* --------------------------------------------------------------------------
319  * Desugaring options
320  * 
321  * These options are mostly used for developing/debugging the system.
322  * Since they turn off required parts of the Haskell language, you'll
323  * probably need to modify Prelude.hs and the libraries if you change
324  * these flags.
325  * ------------------------------------------------------------------------*/
326
327 /* Define if you want to be able to derive instances of each class. */
328 #define DERIVE_EQ      1
329 #define DERIVE_ORD     1
330 #define DERIVE_ENUM    1
331 #define DERIVE_IX      1
332 #define DERIVE_SHOW    1
333 #define DERIVE_READ    1
334 #define DERIVE_BOUNDED 1
335
336 /* Define if single-element dictionaries are implemented by newtype.
337  * Should be turned on.  Mostly used to make it easier to find which
338  * bits of code implement this optimisation and as a way of documenting
339  * them.
340  */
341 #define USE_NEWTYPE_FOR_DICTS 1
342
343 /* Define if strings should be represented as normal C strings.
344  * Note that this doesn't work if the string contains '\0'
345  * and makes persistence problematic.
346  * Intended as a stop-gap measure until mutable byte arrays are available.
347  */
348 #define USE_ADDR_FOR_STRINGS 1
349
350 /* turn this off to avoid wrapping int and float literals in "fromInt"
351  * or "fromFloat" */
352 #define OVERLOADED_CONSTANTS 1
353
354 /* turn this off to remove the ultramagical treatment of the Eval class */
355 #define EVAL_INSTANCES 0
356
357 /* Define to include support for (n+k) patterns. 
358  * Warning: many people in the Haskell committee want to remove n+k patterns.
359  */
360 #define NPLUSK 1
361
362
363 /* --------------------------------------------------------------------------
364  * Debugging options (intended for use by maintainers)
365  * ------------------------------------------------------------------------*/
366
367 /* Define if debugging generated bytecodes or the bytecode interpreter     */
368 #define DEBUG_CODE 1
369
370 /* Define if you want to use a low-level printer from within a debugger    */
371 #define DEBUG_PRINTER 1
372
373
374 /* --------------------------------------------------------------------------
375  * Experimental features
376  * These are likely to disappear/change in future versions and should not
377  * be used by most people..
378  * ------------------------------------------------------------------------*/
379
380 /* In a plain Hugs system, most signals (SIGBUS, SIGTERM, etc) indicate
381  * some kind of error in Hugs - or maybe a stack overflow.  Rather than
382  * just crash, Hugs catches these errors and returns to the main loop.
383  * It does this by calling a function "panic" which longjmp's back to the
384  * main loop.
385  * If you're developing a GreenCard library, this may not be the right
386  * behaviour - it's better if Hugs leaves them for your debugger to
387  * catch rather than trapping them and "panicking".
388  */
389 #define DONT_PANIC 1
390
391
392 /* ----------------------------------------------------------------------- */