[project @ 2000-04-13 23:03:12 by sewardj]
[ghc-hetmet.git] / ghc / includes / options.h
1
2 /* --------------------------------------------------------------------------
3  * Configuration options
4  *
5  * Copyright (c) The University of Nottingham and Yale University, 1994-1997.
6  * All rights reserved. See NOTICE for details and conditions of use etc...
7  * Hugs version 1.4, December 1997
8  *
9  * $RCSfile: options.h,v $
10  * $Revision: 1.26 $
11  * $Date: 2000/04/13 23:03:12 $
12  * ------------------------------------------------------------------------*/
13
14
15 /* --------------------------------------------------------------------------
16  * Hugs paths and directories
17  * ------------------------------------------------------------------------*/
18
19 /* Define this as the default setting of HUGSPATH.                        
20  * Value may contain string "{Hugs}" (for which we will substitute the
21  * value of HUGSDIR) and should be either colon-separated (Unix)
22  * or semicolon-separated (Macintosh, Windows, DOS).  Escape
23  * characters in the path string are interpreted according to normal
24  * Haskell conventions.
25  *
26  * This value can be overridden from the command line by setting the
27  * HUGSFLAGS environment variable or by storing an appropriate value
28  * for HUGSFLAGS in the registry (Win32 only).  In all cases, use a 
29  * string of the form -P"...".  
30  */
31 #define HUGSPATH "."
32
33 /* The directory name which is substituted for the string "{Hugs}"
34  * in a path variable.  This normally points to where the Hugs libraries
35  * are installed - ie so that the file HUGSDIR/lib/Prelude.hs exists    
36  * Typical values are:                                  
37  *    "/usr/local/lib/hugs"                             
38  *    "/usr/homes/JFHaskell/hugs"                       
39  *    ".."      
40  *
41  * This value is ignored on Windows and Macintosh versions since
42  * it is assumed that the binary is installed in HUGSDIR.
43  *
44  * This value cannot be overridden from the command line or by using 
45  * environment variables.  This isn't quite as limiting as you'd think
46  * since you can always choose _not_ to use the {Hugs} variable - however,
47  * it's obviously _nicer_ to have it set correctly.
48  */
49 #ifndef HUGSDIR
50 #define HUGSDIR "."
51 #endif
52
53
54 /* --------------------------------------------------------------------------
55  * User interface options
56  * ------------------------------------------------------------------------*/
57
58 /* Define if you want filenames to be converted to normal form by:
59  * o replacing relative pathnames with absolute pathnames and
60  *   eliminating .. and . where possible.
61  * o converting to lower case (only in case-insensitive filesystems)
62  */
63 #define PATH_CANONICALIZATION 0
64
65 /* Define if you want the small startup banner.
66  */
67 #define SMALL_BANNER 0
68
69
70 /* --------------------------------------------------------------------------
71  * Language extensions
72  * ------------------------------------------------------------------------*/
73
74 /* Define if T-REX; Typed Rows and EXtension should be enabled             */
75 /* Doesn't work in current system - I don't know what the primops do       */
76 #define TREX            0
77
78 /* Implicit Parameters                                                     */
79 #define IPARAM          1
80
81 /* Multi-instance resolution                                               */
82 #define MULTI_INST      0
83
84
85 /* --------------------------------------------------------------------------
86  * Various table sizes
87  * ------------------------------------------------------------------------*/
88
89 #define NUM_TUPLES         37
90 #define NUM_CHARS          256
91 #if TREX
92 #define NUM_EXT            100
93 #endif
94 #define CHAR_MASK          0xff
95
96 #define MINIMUMHEAP        19000
97 #define MAXIMUMHEAP        0
98 #define DEFAULTHEAP        320000
99
100 #define TEXT_SIZE          100000
101 #define NUM_TEXTH          10
102 #define NUM_TYVARS         4000
103 #define NUM_STACK          16000
104 #define NUM_DTUPLES        5
105 #define NUM_MSTACK         2000
106
107 #define MAXPOSINT          0x7fffffff
108 #define MINNEGINT          (-MAXPOSINT-1)
109 #define MAXHUGSWORD        0xffffffffU
110
111 #define minRecovery        1000
112 #define bitsPerWord        32
113 #define wordShift          5
114 #define wordMask           31
115
116 /* Should quantifiers be displayed in error messages.
117  * Warning: not consistently used.
118  */
119 #define DISPLAY_QUANTIFIERS 0
120
121 /* Flags to determine which raw representations and operations are available
122  * Notes:
123  * o if you turn everything on, you might end up with more then 256
124  *   bytecodes: check the value of i_ccall (the lst bytecode) to check
125  * (JRS), 22apr99: I don't think any of the #undef'd ones will work
126  * without attention.  However, standard Haskell 98 is supported 
127  * is supported without needing them.
128  */
129 #undef  PROVIDE_WEAK
130
131 #define PROVIDE_STABLE      1
132 #define PROVIDE_FOREIGN     1
133 #define PROVIDE_COERCE      1
134 #define PROVIDE_PTREQUALITY 1
135 #define PROVIDE_CONCURRENT  1
136
137 /* Enable a crude profiler which counts BCO entries, bytes allocated
138    and bytecode insns executed on a per-fn basis.  Used for assessing
139    the effect of the simplifier/optimiser.
140 */
141 #undef CRUDE_PROFILING
142
143 /* Turn bytecode interpreter support on/off.
144  */
145 #define INTERPRETER 1 
146
147 /* Turn on debugging output and some sanity checks
148  */
149 /*#define DEBUG*/
150
151 /* NB: LAZY_BLACKHOLING has been moved up to Stg.h where both Hugs and GHC can see it,
152  * and EAGER_BLACKHOLING has been introduced also.  KSW 1999-01.
153  */
154
155 /* Turn miniinterpreter on/off.
156  * 
157  * The mininterpreter is portable but slow - if you turn it off, 
158  * you'll probably need to provide some assembly language support
159  * for your architecture.
160  */
161 #define USE_MINIINTERPRETER 1
162
163 /* Turn registerisation on/off.
164  * 
165  * If you turn this off, you'll probably need to provide some
166  * assembly language support for your architecture.
167  */
168 #define NO_MACHREGS
169
170
171 /* Define if :xplain should be enabled                                     */
172 #define EXPLAIN_INSTANCE_RESOLUTION 0
173
174
175 /* Define if you want to run Haskell code through a preprocessor
176  * 
177  * Note that the :reload command doesn't know about any dependencies
178  * introduced by using #include so you must :load (not :reload) if
179  * you change any #included files (such as configuration files).
180  */
181 #define USE_PREPROCESSOR 1
182
183 /* Define if you want to time every evaluation. 
184  *
185  * Timing is included in the Hugs distribution for the purpose of benchmarking
186  * the Hugs interpreter, comparing its performance across a variety of
187  * different machines, and with other systems for similar languages.
188  *
189  * It would be somewhat foolish to try to use the timings produced in this
190  * way for any other purpose.  In particular, using timings to compare the
191  * performance of different versions of an algorithm is likely to give very
192  * misleading results.  The current implementation of Hugs as an interpreter,
193  * without any significant optimizations, means that there are much more
194  * significant overheads than can be accounted for by small variations in
195  * Hugs code.
196  */
197 /* #undef WANT_TIMER */
198
199
200 /* --------------------------------------------------------------------------
201  * Desugaring options
202  * 
203  * These options are mostly used for developing/debugging the system.
204  * Since they turn off required parts of the Haskell language, you'll
205  * probably need to modify Prelude.hs and the libraries if you change
206  * these flags.
207  * ------------------------------------------------------------------------*/
208
209 /* Define if single-element dictionaries are implemented by newtype.
210  * Should be turned on.  Mostly used to make it easier to find which
211  * bits of code implement this optimisation and as a way of documenting
212  * them.
213  */
214 #define USE_NEWTYPE_FOR_DICTS 1
215
216 /* Define if strings should be represented as normal C strings.
217  * Note that this doesn't work if the string contains '\0'
218  * and makes persistence problematic.
219  * Intended as a stop-gap measure until mutable byte arrays are available.
220  */
221 #define USE_ADDR_FOR_STRINGS 1
222
223
224 /* --------------------------------------------------------------------------
225  * Experimental features
226  * These are likely to disappear/change in future versions and should not
227  * be used by most people..
228  * ------------------------------------------------------------------------*/
229
230 /* In a plain Hugs system, most signals (SIGBUS, SIGTERM, etc) indicate
231  * some kind of error in Hugs - or maybe a stack overflow.  Rather than
232  * just crash, Hugs catches these errors and returns to the main loop.
233  * It does this by calling a function "panic" which longjmp's back to the
234  * main loop.
235  * If you're developing a GreenCard library, this may not be the right
236  * behaviour - it's better if Hugs leaves them for your debugger to
237  * catch rather than trapping them and "panicking".
238  */
239 #define DONT_PANIC 1
240
241
242 /* ----------------------------------------------------------------------- */