[project @ 1999-11-12 16:38:31 by sewardj]
[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.11 $
17  * $Date: 1999/11/12 16:38:33 $
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 you want the small startup banner.
77  */
78 #define SMALL_BANNER 0
79
80 /* Define if you want to be able to redirect stdout/stderr to a buffer.
81  * Only necessary for the Hugs server interface (which is used in the
82  * Netscape plugin and the standalone evaluator "runhugs"). 
83  */
84 #define REDIRECT_OUTPUT (!HUGS_FOR_WINDOWS)
85
86
87 /* --------------------------------------------------------------------------
88  * Making Hugs smaller
89  * ------------------------------------------------------------------------*/
90
91 /* Define one of these to select overall size of Hugs
92  *   SMALL_HUGS     for 16 bit operation on a limited memory PC.
93  *   REGULAR_HUGS   for 32 bit operation using largish default table sizes.
94  *   LARGE_HUGS     for 32 bit operation using larger default table sizes.
95  */
96 #define SMALL_HUGS   0
97 #define REGULAR_HUGS 0
98 #define LARGE_HUGS   1
99
100 #define NUM_SYNTAX         100
101 #define NUM_TUPLES         20
102 #define NUM_OFFSETS        1024
103 #define NUM_CHARS          256
104 #if TREX
105 #define NUM_EXT            100
106 #endif
107 #define CHAR_MASK          0xff
108
109 #if     SMALL_HUGS                      /* the McDonalds mentality :-)     */
110 #define Pick(s,r,l)        s
111 #endif
112 #if     REGULAR_HUGS
113 #define Pick(s,r,l)        r
114 #endif
115 #if     LARGE_HUGS
116 #define Pick(s,r,l)        l
117 #endif
118
119 #define MINIMUMHEAP        Pick(7500,   19000,      19000)
120 #define MAXIMUMHEAP        Pick(32765,  0,          0)
121 #define DEFAULTHEAP        Pick(28000,  50000,      650000)
122
123 #define NUM_SCRIPTS        Pick(64,     100,        100)
124 #define NUM_MODULE         NUM_SCRIPTS
125 #define NUM_TYCON          Pick(60,     160,        400)
126 #define NUM_NAME           Pick(1000,   2000,       16000)
127 #define NUM_CLASSES        Pick(30,     40,         80)
128 #define NUM_INSTS          Pick(200,    300,        600)
129 #define NUM_TEXT           Pick(12000,  20000,      100000)
130 #define NUM_TEXTH          Pick(1,      10,         10)
131 #define NUM_TYVARS         Pick(800,    2000,       4000)
132 #define NUM_STACK          Pick(1800,   12000,      16000)
133 #define NUM_DTUPLES        Pick(3,      5,          5)
134
135 #define MAXPOSINT          0x7fffffff
136 #define MINNEGINT          (-MAXPOSINT-1)
137 #define MAXHUGSWORD        0xffffffffU
138
139 #define BIGBASE            Pick(100,    10000,      10000)
140 #define BIGEXP             Pick(2,      4,          4)
141
142 #define minRecovery        Pick(1000,  1000,       1000)
143 #define bitsPerWord        Pick(16,    32,         32)
144 #define wordShift          Pick(4,     5,          5)
145 #define wordMask           Pick(15,    31,         31)
146
147 /* Define to force a fixed size (NUM_TYVARS) for the current substitution.
148  * Setting this flag places a limit on the maximum complexity of
149  * expressions handled by the typechecker.  It is normally turned off
150  * but may be required for small machines/configurations.
151  */
152 #define FIXED_SUBST 0 
153
154 /* Define this to allocate tables dynamically.
155  * This is currently just a memory saving trick, but this may be
156  * extended at a later stage to allow at least some of the tables
157  * to be extended dynamically at run-time to avoid exhausted space errors.
158  */
159 #define DYN_TABLES SMALL_HUGS
160
161 /* Define this to include support for storing pointers in the heap.
162  * This is required by the code generator (which has to store 
163  * pointers to AsmObjects).
164  */
165 #define PTR_ON_HEAP 1
166
167 /* Should quantifiers be displayed in error messages.
168  * Warning: not consistently used.
169  */
170 #define DISPLAY_QUANTIFIERS 0
171
172 /* Flags to determine which raw representations and operations are available
173  * Notes:
174  * o if you turn everything on, you might end up with more then 256
175  *   bytecodes: check the value of i_ccall (the lst bytecode) to check
176  * (JRS), 22apr99: I don't think any of the #undef'd ones will work
177  * without attention.  However, standard Haskell 98 is supported 
178  * is supported without needing them.
179  */
180 #undef  PROVIDE_STABLE
181 #undef  PROVIDE_FOREIGN
182 #undef  PROVIDE_WEAK
183 #undef  PROVIDE_CONCURRENT
184 #undef  PROVIDE_PTREQUALITY
185 #undef  PROVIDE_COERCE
186
187
188 /* Set to 1 to use a non-GMP implementation of integer, in the
189    standalone Hugs.  Set to 0 in the combined GHC-Hugs system,
190    in which case GNU MP will be used.
191 */
192 #define STANDALONE_INTEGER 1
193
194 /* Enable a crude profiler which counts BCO entries, bytes allocated
195    and bytecode insns executed on a per-fn basis.  Used for assessing
196    the effect of the simplifier/optimiser.
197 */
198 #undef CRUDE_PROFILING
199
200
201 /* Is the default default (Int,Double) or (Integer,Double)?
202  */
203 #define DEFAULT_BIGNUM 1
204
205 /* Should lambda lifter lift constant expressions out to top level?
206  * Experimental optimisation.
207  */
208 #define LIFT_CONSTANTS 0
209
210 /* Should we run optimizer on Hugs code?
211  * Experimental optimisation.
212  */
213 #define USE_HUGS_OPTIMIZER 1
214
215 /* Are things being used in an interactive setting or a batch setting?
216  * In an interactive setting, System.exitWith should not call _exit
217  * getProgName and getProgArgs need to be handled differently, etc.
218  *
219  * Warning: this flag is ignored by an awful lot of code.
220  */
221 #define INTERACTIVE
222
223 /* Turn bytecode interpreter support on/off.
224  */
225 #define INTERPRETER 1 
226
227 /* Turn on debugging output and some sanity checks
228  */
229 /*#define DEBUG*/
230
231 /* Make stack tags more informative than just their size.
232  * Helps when printing the stack and when running sanity checks.
233  */
234 /*#define DEBUG_EXTRA*/
235
236 /* NB: LAZY_BLACKHOLING has been moved up to Stg.h where both Hugs and GHC can see it,
237  * and EAGER_BLACKHOLING has been introduced also.  KSW 1999-01.
238  */
239
240 /* Turn miniinterpreter on/off.
241  * 
242  * The mininterpreter is portable but slow - if you turn it off, 
243  * you'll probably need to provide some assembly language support
244  * for your architecture.
245  */
246 #define USE_MINIINTERPRETER 1
247
248 /* Turn registerisation on/off.
249  * 
250  * If you turn this off, you'll probably need to provide some
251  * assembly language support for your architecture.
252  */
253 #define NO_REGS
254
255
256 /* --------------------------------------------------------------------------
257  * Fancy features
258  * ------------------------------------------------------------------------*/
259
260 /* Define if T-REX; Typed Rows and EXtension should be enabled             */
261 /* Doesn't work in current system - I don't know what the primops do       */
262 #define TREX 0
263
264 /* Define if :xplain should be enabled                                     */
265 #define EXPLAIN_INSTANCE_RESOLUTION 0
266
267
268 /* Define if you want to run Haskell code through a preprocessor
269  * 
270  * Note that the :reload command doesn't know about any dependencies
271  * introduced by using #include so you must :load (not :reload) if
272  * you change any #included files (such as configuration files).
273  */
274 #define USE_PREPROCESSOR 1
275
276 /* Define if you want to time every evaluation. 
277  *
278  * Timing is included in the Hugs distribution for the purpose of benchmarking
279  * the Hugs interpreter, comparing its performance across a variety of
280  * different machines, and with other systems for similar languages.
281  *
282  * It would be somewhat foolish to try to use the timings produced in this
283  * way for any other purpose.  In particular, using timings to compare the
284  * performance of different versions of an algorithm is likely to give very
285  * misleading results.  The current implementation of Hugs as an interpreter,
286  * without any significant optimizations, means that there are much more
287  * significant overheads than can be accounted for by small variations in
288  * Hugs code.
289  */
290 /* #undef WANT_TIMER */
291
292
293 /* --------------------------------------------------------------------------
294  * Desugaring options
295  * 
296  * These options are mostly used for developing/debugging the system.
297  * Since they turn off required parts of the Haskell language, you'll
298  * probably need to modify Prelude.hs and the libraries if you change
299  * these flags.
300  * ------------------------------------------------------------------------*/
301
302 /* Define if single-element dictionaries are implemented by newtype.
303  * Should be turned on.  Mostly used to make it easier to find which
304  * bits of code implement this optimisation and as a way of documenting
305  * them.
306  */
307 #define USE_NEWTYPE_FOR_DICTS 1
308
309 /* Define if strings should be represented as normal C strings.
310  * Note that this doesn't work if the string contains '\0'
311  * and makes persistence problematic.
312  * Intended as a stop-gap measure until mutable byte arrays are available.
313  */
314 #define USE_ADDR_FOR_STRINGS 1
315
316 /* Define to include support for (n+k) patterns. 
317  * Warning: many people in the Haskell committee want to remove n+k patterns.
318  */
319 #define NPLUSK 1
320
321
322 /* --------------------------------------------------------------------------
323  * Debugging options (intended for use by maintainers)
324  * ------------------------------------------------------------------------*/
325
326 /* Define if debugging generated bytecodes or the bytecode interpreter     */
327 #define DEBUG_CODE 1
328
329 /* Define if debugging generated supercombinator definitions or compiler   */
330 #define DEBUG_SHOWSC 0
331
332 /* Define if you want to use a low-level printer from within a debugger    */
333 #define DEBUG_PRINTER 1
334
335 /* --------------------------------------------------------------------------
336  * Experimental features
337  * These are likely to disappear/change in future versions and should not
338  * be used by most people..
339  * ------------------------------------------------------------------------*/
340
341 /* In a plain Hugs system, most signals (SIGBUS, SIGTERM, etc) indicate
342  * some kind of error in Hugs - or maybe a stack overflow.  Rather than
343  * just crash, Hugs catches these errors and returns to the main loop.
344  * It does this by calling a function "panic" which longjmp's back to the
345  * main loop.
346  * If you're developing a GreenCard library, this may not be the right
347  * behaviour - it's better if Hugs leaves them for your debugger to
348  * catch rather than trapping them and "panicking".
349  */
350 #define DONT_PANIC 1
351
352
353 /* ----------------------------------------------------------------------- */