1 /* config.h -- es(1) configuration parameters ($Revision: 1.1.1.1 $) */ 2 3 /* 4 * Compile time options 5 * 6 * These options are best set on the command line in the Makefile. 7 * If the machine you use requires a different set of defaults than 8 * is provided, please send mail to 9 * 10 * Paul Haahr <haahr@netcom.com> 11 * Byron Rakitzis <byron@netapp.com> 12 * 13 * If you decide to add things to this file, add them before the 14 * defaults and make sure that they can be overriden by command 15 * line definitions. (That is, remember to do the #ifndef dance.) 16 * 17 * 18 * ASSERTIONS 19 * if this is on, asserts will be checked, raising errors on 20 * actual assertion failure. 21 * 22 * BSD_LIMITS 23 * if this is on, the limit builtin (ala csh) is included. 24 * 25 * BUILTIN_TIME 26 * if this is on, the time builtin is included. by default, it is 27 * on, but feel free to turn it off. see also USE_WAIT3. 28 * 29 * HAVE_DEV_FD 30 * turn this on if your system supports /dev/fd for >{} and <{} 31 * 32 * DEVFD_PATH 33 * (used only if DEVFD is on.) a format string for print() to 34 * a file path for opening file descriptor n. 35 * 36 * GCALWAYS 37 * if this is on, the a collection is done after every allocation. 38 * this stress-tests the garbage collector. any missed Ref() 39 * declarations should cause a crash or assertion failure very 40 * quickly in this mode. 41 * 42 * GCDEBUG 43 * when this is on, the garbage collector is run in such a way 44 * that just about any coding error will lead to an almost 45 * immediate crash. it is equivalent to all 3 of GCALWAYS, 46 * GCPROTECT, and GCVERBOSE 47 * 48 * GCINFO 49 * a terse version of GCVERBOSE, which prints a short message 50 * for every collection. 51 * 52 * GCPROTECT 53 * makes the garbage collector disable access to pages 54 * that are in old space, making unforwarded references 55 * crasht the interpreter. requires os/mmu support for 56 * enabling and disabling access to pages. 57 * 58 * GCVERBOSE 59 * if this is on, it is possible to run the garbage collector 60 * in a mode where it explains what it is doing at all times. 61 * implied by GCDEBUG. 62 * 63 * GETGROUPS_USES_GID_T 64 * define this as true if getgroups() takes a gid_t* as its 65 * second argument. while POSIX.1 says it does, on many 66 * systems, gid_t is a short while getgroups() takes an int*. 67 * 68 * HAS_LSTAT 69 * define this as true if your system has lstat(2). the default 70 * is on. (it's been reported that SCO does not have lstat, but 71 * is this true even for recent versions?) 72 * 73 * INITIAL_PATH 74 * this is the default value for $path (and $PATH) when the shell 75 * starts up. it is replaced by one from the environment if it 76 * exists. 77 * 78 * KERNEL_POUNDBANG 79 * this value should be true when the builtin version of execve(2) 80 * understands #! headers. if false, es provides a builtin for 81 * running #! files. the default is true; are there any real 82 * systems still out there that don't support it? 83 * 84 * JOB_PROTECT 85 * set this to true if you want es to perform 86 * backgrounding as if it were a job controlling shell; 87 * that is, if you want background jobs to be put in new 88 * process groups. this flag is ignored if the system 89 * does not support the job control signals. since there 90 * are many broken programs that do not behave correctly 91 * when backgrounded in a v7 non-job-control fashion, the 92 * default for this option is on, even though it is ugly. 93 * 94 * PROTECT_ENV 95 * if on, makes all variable names in the environment ``safe'': 96 * that is, makes sure no characters other than c identifier 97 * characters appear in them. 98 * 99 * READLINE 100 * true if es is being linked with editline or gnu readline. 101 * 102 * REF_ASSERTIONS 103 * if this is on, assertions about the use of the Ref() macro 104 * will be checked at run-time. this is only useful if you're 105 * modifying es source, and makes the binary much larger. 106 * 107 * REISER_CPP 108 * true if es is being compiled with a reiser-style preprocessor. 109 * if you have an ansi preprocessor, use it and turn this off. 110 * 111 * SHOW_DOT_FILES 112 * if this option is off (the default), wildcard patterns do not 113 * match files that being with a ``.'' character; this behavior 114 * is the same as in most unix shells. if it is on, the only 115 * files not matched are ``.'' and ``..''; this behavior follows 116 * convention on bell labs research unix systems (since the eighth 117 * edition) and plan 9. in either case, an explicit ``.'' at 118 * the beginning of a pattern will match the hidden files. 119 * (Contributed by Steve Kilbane.) 120 * 121 * SPECIAL_SIGCLD 122 * true if SIGCLD has System V semantics. this is true at least 123 * for silicon graphics machines running Irix. (according to 124 * Byron, ``if you trap SIGCLD on System V machines, weird things 125 * happen.'') 126 * 127 * SYSV_SIGNALS 128 * True if signal handling follows System V behavior; 129 * otherwise, berkeley signals are assumed. If you set 130 * USE_SIGACTION, this value is ignore. By System V 131 * behavior, we mean, signal must be called to reinstall 132 * the signal handler after it is invoked. This behavior 133 * is also known as ``unreliable signals.'' 134 * 135 * USE_CONST 136 * allow const declarations. if your compiler supports 'em, 137 * use 'em. 138 * 139 * USE_DIRENT 140 * if on, <dirent.h> is used; if off, <sys/direct.h>. 141 * 142 * USE_MEMORY 143 * if on, <memory.h> is used; if off, it's assumed that 144 * <string.h> does the job. 145 * 146 * USE_SIGACTION 147 * turn this on if your system understands the POSIX.1 148 * sigaction(2) call. it's probably better to use this 149 * version if you have it. if sigaction() is used, es 150 * assumes that signals have POSIX semantics, so the 151 * SPECIAL_SIGCLD and SYSV_SIGNALS options are turned 152 * off. 153 * 154 * USE_SIG_ATOMIC_T 155 * define this on a system which has its own typedef for 156 * sig_atomic_t. 157 * 158 * USE_STDARG 159 * define this if you have an ansi compiler and the <stdarg.h> 160 * header file. if not, es will try to use <varargs.h>, but 161 * you may need to hack a bit to get that working. 162 * 163 * USE_VOLATILE 164 * allow volatile declarations. if your compiler 165 * supports 'em, use 'em. 166 * 167 * USE_UNISTD 168 * define this if you have the include file <unistd.h> 169 * 170 * USE_WAIT3 171 * this option should be on if your system supports the 172 * BSD-style wait3(2) system call. by default, it is on. 173 * if this option is false and the BUILTIN_TIME is true, 174 * the times(2) call must exist. 175 * 176 * VOID_SIGNALS 177 * define this as true if signal handlers are declared with void 178 * return type; otherwise es uses int for signal returns. */ 179 180 181 /* 182 * platform specific options 183 * please send new configurations to haahr@adobe.com and byron@netapp.com 184 */ 185 186 #include "config.h" 187 188 #if HAVE_SIGRELSE && HAVE_SIGHOLD 189 # define SYSV_SIGNALS 1 190 #endif 191 192 #if HAVE_LIBREADLINE || HAVE_LIBEDITLINE 193 # define READLINE 1 194 #endif 195 196 /* NeXT defaults */ 197 198 #if NeXT 199 #ifndef USE_SIG_ATOMIC_T 200 #define USE_SIG_ATOMIC_T 1 201 #endif 202 #endif /* NeXT */ 203 204 205 /* Irix defaults */ 206 207 #if sgi 208 #ifndef INITIAL_PATH 209 #define INITIAL_PATH "/usr/bsd", "/usr/sbin", "/usr/bin", "/bin", "" 210 #endif 211 #endif /* sgi */ 212 213 214 /* SunOS 4.x defaults */ 215 216 #if sun && !SOLARIS 217 #ifndef INITIAL_PATH 218 #define INITIAL_PATH "/usr/ucb", "/usr/bin", "" 219 #endif 220 #endif /* sun */ 221 222 223 /* HP/UX 9.0.1 -- from rsalz@osf.org (Rich $alz) and haahr*/ 224 225 #if HPUX 226 #define _INCLUDE_POSIX_SOURCE 1 227 #define _INCLUDE_XOPEN_SOURCE 1 228 #define _INCLUDE_HPUX_SOURCE 1 229 #endif 230 231 232 /* SCO Xenix -- from steveo@world.std.com (Steven W Orr) for SCO-ODT-1.1 */ 233 234 #if sco 235 #ifndef USE_SIG_ATOMIC_T 236 #define USE_SIG_ATOMIC_T 1 237 #endif 238 #endif /* sco */ 239 240 241 /* OSF/1 -- this is taken from the DEC Alpha */ 242 243 #if OSF1 244 #ifndef INITIAL_PATH 245 #define INITIAL_PATH "/usr/bin", "" 246 #endif 247 #endif /* OSF1 */ 248 249 /* OSF/1 on HP snakes -- from John Robert LoVerso <loverso@osf.org> */ 250 251 #ifdef __hp_osf 252 #define __NO_FP_VARARGS /* avoid bug compiling print.c */ 253 #endif 254 255 256 /* DEC Ultrix 4.2 -- from render@massive.uccs.edu (Hal Render) */ 257 258 #if ultrix 259 #ifndef USE_SIG_ATOMIC_T 260 #define USE_SIG_ATOMIC_T 1 261 #endif 262 #endif /* ultrix */ 263 264 265 /* 386BSD -- from dbarker@mulga.awadi.com.AU (Dave Barker) */ 266 267 #if __386BSD__ 268 #ifndef INITIAL_PATH 269 #define INITIAL_PATH "/usr/sbin", "/sbin", "/usr/bin", "/bin", "" 270 #endif 271 #define SIG_ERR BADSIG 272 #ifndef REQUIRE_STAT 273 #define REQUIRE_STAT 1 274 #endif 275 #endif 276 277 278 /* 279 * default defaults -- don't change this section 280 */ 281 282 #ifndef ASSERTIONS 283 #define ASSERTIONS 1 284 #endif 285 286 #ifndef BUILTIN_TIME 287 #define BUILTIN_TIME 1 288 #endif 289 290 #ifndef DEVFD_PATH 291 #define DEVFD_PATH "/dev/fd/%d" 292 #endif 293 294 #ifndef GCALWAYS 295 #define GCALWAYS 0 296 #endif 297 298 #ifndef GCDEBUG 299 #define GCDEBUG 0 300 #endif 301 302 #ifndef GCINFO 303 #define GCINFO 0 304 #endif 305 306 #ifndef GCPROTECT 307 #define GCPROTECT 0 308 #endif 309 310 #ifndef GCVERBOSE 311 #define GCVERBOSE 0 312 #endif 313 314 #ifndef INITIAL_PATH 315 #define INITIAL_PATH "/usr/ucb", "/usr/bin", "/bin", "" 316 #endif 317 318 #ifndef JOB_PROTECT 319 #define JOB_PROTECT 1 320 #endif 321 322 #ifndef PROTECT_ENV 323 #define PROTECT_ENV 1 324 #endif 325 326 #ifndef READLINE 327 #define READLINE 0 328 #endif 329 330 #ifndef REF_ASSERTIONS 331 #define REF_ASSERTIONS 0 332 #endif 333 334 #ifndef REISER_CPP 335 #define REISER_CPP 0 336 #endif 337 338 #ifndef SHOW_DOT_FILES 339 #define SHOW_DOT_FILES 0 340 #endif 341 342 #ifndef SYSV_SIGNALS 343 #define SYSV_SIGNALS 0 344 #endif 345 346 #ifndef HAVE_MEMORY 347 #define HAVE_MEMORY 0 348 #endif 349 350 #ifndef USE_SIG_ATOMIC_T 351 #define USE_SIG_ATOMIC_T 0 352 #endif 353 354 /* 355 * enforcing choices that must be made 356 */ 357 358 #if GCDEBUG 359 #undef GCALWAYS 360 #undef GCINFO 361 #undef GCPROTECT 362 #undef GCVERBOSE 363 #define GCALWAYS 1 364 #define GCINFO 1 365 #define GCPROTECT 1 366 #define GCVERBOSE 1 367 #endif 368 369 #if HAVE_SIGACTION 370 #undef SYSV_SIGNALS 371 #define SYSV_SIGNALS 0 372 #endif 373