This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / usr.bin / elvis / config.h
CommitLineData
15637ed4
RG
1/*
2 * vi configuration file
08746e8b
AM
3 * We try to automatically configure to various compilers and operating
4 * systems. Extend the autoconf section as needed.
15637ed4
RG
5 */
6
08746e8b
AM
7#ifndef _CONFIG_H
8# define _CONFIG_H
9
10/*************************** autoconf section ************************/
11
12/* Commodore-Amiga */
13#ifdef amiga
14# define AMIGA 1
15# define COMPILED_BY "Manx Aztec C 5.2b"
16# define TINYSTACK 1
17#endif
18
19/* standard unix V (?) */
20#ifdef M_SYSV
21# define UNIXV 1
22# ifdef M_XENIX
23# ifndef M_I386
24# define TINYSTACK 1
25# endif
26# endif
27# undef COHERENT
28#endif
29
30/* xelos system, University of Ulm */
31#ifdef xelos
32# define UNIXV 1
33#endif
34
35/* BSD UNIX? */
36#ifdef bsd
15637ed4 37# define BSD 1
08746e8b
AM
38#else
39# ifdef sun
40# ifndef M_SYSV
41# define BSD 1
42# endif
43# endif
44#endif
45
46/* Microsoft C: sorry, Watcom does the same thing */
47#ifdef M_I86
48# ifndef M_SYSV
49# define MSDOS 1
50# ifdef IBMC2
51# define COMPILED_BY "IBM C/2 1.00"
52# else
53# define MICROSOFT 1
54# define COMPILED_BY "Microsoft C 5.10"
55# endif
56# define TINYSTACK 1
57# endif
58#endif
59
60/* Borland's Turbo C */
61#ifdef __TURBOC__
62# define MSDOS 1
63# define TURBOC 1
64# ifdef __BORLANDC__
65# define COMPILED_BY "Borland C 2.00"
66# else
67# define COMPILED_BY (__TURBOC__ >= 661 ? "Turbo C++ 1.00" : "Turbo C 2.00")
68# endif
69# define TINYSTACK 1
70#endif
71
72/* Tos Mark-Williams */
73#ifdef M68000
74# define TOS 1
75# define COMPILED_BY "Mark Williams C"
76# define TINYSTACK 1
77#endif
78
79/* Tos GNU-C */
80#ifdef __atarist__
81# ifdef __gem__
82# define TOS 1
83# define COMPILED_BY "GNU-C " __VERSION__
84# define TINYSTACK 1
85# endif
86#endif
15637ed4 87
08746e8b
AM
88/* OS9/68000 */
89#ifdef OSK
90# define COMPILED_BY "Microware C V2.3 Edition 40"
91# define TINYSTACK 1
92#endif
93
94/* DEC Rainbow, running MS-DOS (handled by earlier MS-DOS tests) */
95/* (would need -DRAINBOW in CFLAGS to compile a Rainbow-compatible .EXE) */
96
97#ifdef VMS
98# define COMPILED_BY "VAX/VMS VAXC compiler"
99# undef VMS
100# define VMS 1
101#endif
102
103
104#ifdef COHERENT
105# ifdef _I386
106# define COH_386 1
107# define COH_286 0
108# else
109# define COH_386 0
110# define COH_286 1
111# endif
112# undef COHERENT
113# define COHERENT 1
114#endif
115
116/*************************** end of autoconf section ************************/
15637ed4
RG
117
118/* All undefined symbols are defined to zero here, to allow for older */
119/* compilers which dont understand #if defined() or #if UNDEFINED_SYMBOL */
120
08746e8b
AM
121/*************************** operating systems *****************************/
122
123#ifndef BSD
124# define BSD 0 /* UNIX - Berkeley 4.x */
125#endif
126
127#ifndef UNIXV
15637ed4 128# define UNIXV 0 /* UNIX - AT&T SYSV */
08746e8b
AM
129#endif
130
131#ifndef UNIX7
15637ed4 132# define UNIX7 0 /* UNIX - version 7 */
08746e8b
AM
133#endif
134
135#ifndef MSDOS
15637ed4 136# define MSDOS 0 /* PC */
08746e8b
AM
137#endif
138
139#ifndef TOS
15637ed4 140# define TOS 0 /* Atari ST */
08746e8b
AM
141#endif
142
143#ifndef AMIGA
15637ed4 144# define AMIGA 0 /* Commodore Amiga */
08746e8b
AM
145#endif
146
147#ifndef OSK
15637ed4 148# define OSK 0 /* OS-9 / 68k */
08746e8b
AM
149#endif
150
151#ifndef COHERENT
15637ed4 152# define COHERENT 0 /* Coherent */
08746e8b
AM
153#endif
154
155#ifndef RAINBOW /* DEC Rainbow support, under MS-DOS */
156# define RAINBOW 0
157#endif
158
159#ifndef VMS
160# define VMS 0 /* VAX/VMS */
161#endif
162
163 /* Minix has no predefines */
164#if !BSD && !UNIXV && !UNIX7 && !MSDOS && !TOS && !AMIGA && !OSK && !COHERENT && !VMS
165# define MINIX 1
166#else
15637ed4 167# define MINIX 0
08746e8b 168#endif
15637ed4 169
08746e8b
AM
170 /* generic combination of Unices */
171#if UNIXV || UNIX7 || BSD || MINIX || COHERENT
15637ed4 172# define ANY_UNIX 1
08746e8b
AM
173#else
174# define ANY_UNIX 0
175#endif
176
177#ifndef TINYSTACK
178# define TINYSTACK 0
179#endif
180
181/*************************** compilers **************************************/
182
183#ifndef AZTEC_C
184# define AZTEC_C 0
185#endif
186
187#ifndef MICROSOFT
188# define MICROSOFT 0
189#endif
190
191#ifndef TURBOC
192# define TURBOC 0
193#endif
194
195/* Should we use "new style" ANSI C prototypes? */
196#ifdef __STDC__
197# define NEWSTYLE 1
198#endif
199#ifdef __cplusplus
200# define NEWSTYLE 1
201#endif
202#ifndef NEWSTYLE
203# define NEWSTYLE 0
204#endif
205
206#if NEWSTYLE
207# define P_(s) s
208#else
209# define P_(s) ()
210#endif
15637ed4
RG
211
212/******************************* Credit ************************************/
213
214#if MSDOS
215# define CREDIT "Ported to MS-DOS by Guntram Blohm & Martin Patzel"
08746e8b
AM
216# if RAINBOW
217# define CREDIT2 "Rainbow support added by Willett Kempton"
218# endif
219#endif
220
221#if AMIGA
222# define CREDIT "Ported to AmigaDOS 2.04 by Mike Rieser & Dale Rahn"
15637ed4
RG
223#endif
224
225#if TOS
226# define CREDIT "Ported to Atari/TOS by Guntram Blohm & Martin Patzel"
227#endif
228
229#if OSK
230# define CREDIT "Ported to Microware OS9/68k by Peter Reinig"
231#endif
232
233#if COHERENT
234# define CREDIT "Ported to Coherent by Esa Ahola"
235#endif
236
08746e8b
AM
237#if VMS
238# define CREDIT "Ported to VAX/VMS by John Campbell"
239#endif
15637ed4
RG
240/*************************** functions depending on OS *********************/
241
08746e8b
AM
242/* There are two terminal-related functions that we need: ttyread() and
243 * ttywrite(). The ttyread() function implements read-with-timeout and is
244 * a true function on all systems. The ttywrite() function is almost always
245 * just a macro...
246 */
247#if !TOS && !AMIGA
248# define ttywrite(buf, len) write(1, buf, (unsigned)(len)) /* raw write */
249#endif
250
251/* The strchr() function is an official standard now, so everybody has it
252 * except Unix version 7 (which is old) and BSD Unix (which is academic).
253 * Those guys use something called index() to do the same thing.
254 */
255#if BSD || UNIX7 || OSK
256# define strchr index
257# define strrchr rindex
258#endif
259#if !NEWSTYLE
15637ed4 260extern char *strchr();
08746e8b
AM
261#endif
262
263/* BSD uses bcopy() instead of memcpy() */
264#if BSD
265# define memcpy(dest, src, siz) bcopy(src, dest, siz)
266#endif
267
268/* BSD uses getwd() instead of getcwd(). The arguments are a little different,
269 * but we'll ignore that and hope for the best; adding arguments to the macro
270 * would mess up an "extern" declaration of the function.
271 *
272 * Also, the Coherent-286 uses getwd(), but Coherent-386 uses getcwd()
273 */
274#if BSD
275#ifndef __386BSD__
276# define getcwd getwd
277#endif
278#endif
279#if COH_286
280# define getcwd getwd
281#endif
282extern char *getcwd();
15637ed4 283
08746e8b
AM
284/* text versa binary mode for read/write */
285#if !TOS
15637ed4
RG
286#define tread(fd,buf,n) read(fd,buf,(unsigned)(n))
287#define twrite(fd,buf,n) write(fd,buf,(unsigned)(n))
08746e8b
AM
288#endif
289
290/**************************** Compiler quirks *********************************/
15637ed4 291
08746e8b
AM
292/* the UNIX version 7 and (some) TOS compilers, don't allow "void" */
293#if UNIX7 || TOS
294# define void int
295#endif
296
297/* as far as I know, all compilers except version 7 support unsigned char */
298/* NEWFLASH: the Minix-ST compiler has subtle problems with unsigned char */
299#if UNIX7 || MINIX
300# define UCHAR(c) ((c) & 0xff)
301# define uchar char
302#else
303# define UCHAR(c) ((unsigned char)(c))
304# define uchar unsigned char
305#endif
15637ed4 306
08746e8b
AM
307/* Some compilers prefer to have malloc declared as returning a (void *) */
308/* ANSI, on the other hand, needs the arguments to free() to be cast */
309#ifndef __STDC__
310# if BSD || AMIGA || MINIX
15637ed4 311extern void *malloc();
08746e8b
AM
312# define _free_(ptr) free((void *)ptr)
313# else
314extern char *malloc();
315# define _free_(ptr) free((char *)ptr)
316# endif
317#else
318# define _free_(ptr) free((void *)ptr)
319#endif /* __STDC__ */
320
321/* everybody but Amiga wants lseek declared here */
322#if !AMIGA
323extern long lseek();
324#endif
15637ed4 325
08746e8b
AM
326/* ANSI C has getenv() declared in stdlib.h, which we've already included.
327 * Other compilers will need it declared here, though.
328 */
329#ifndef __STDC__
330extern char *getenv();
15637ed4
RG
331#endif
332
08746e8b
AM
333/* Signal handler functions used to return an int value, which was ignored.
334 * On newer systems, signal handlers are void functions. Here, we try to
335 * guess the proper return type for this system.
336 */
337#ifdef __STDC__
338# define SIGTYPE void
339#else
340# if MSDOS
341# define SIGTYPE void
342# else
343# if UNIXV
344# define SIGTYPE void /* Note: This is wrong for SCO Xenix. */
345# endif
346# endif
347#endif
348#ifndef SIGTYPE
349# define SIGTYPE int
350#endif
15637ed4
RG
351
352/******************* Names of files and environment vars **********************/
353
08746e8b
AM
354#if ANY_UNIX
355# ifndef TMPDIR
356# if MINIX
357# define TMPDIR "/usr/tmp" /* Keep elvis' temp files off RAM disk! */
358# else
359# define TMPDIR "/var/tmp" /* directory where temp files live */
360# endif
361# endif
362# ifndef PRSVDIR
363# define PRSVDIR "/var/preserve" /* directory where preserved file live */
364# endif
365# ifndef PRSVINDEX
366# define PRSVINDEX "/var/preserve/Index" /* index of files in PRSVDIR */
367# endif
15637ed4
RG
368# ifndef EXRC
369# define EXRC ".exrc" /* init file in current directory */
370# endif
371# define SCRATCHOUT "%s/soXXXXXX" /* temp file used as input to filter */
15637ed4
RG
372# ifndef SHELL
373# define SHELL "/bin/sh" /* default shell */
374# endif
08746e8b
AM
375# if COHERENT
376# ifndef REDIRECT
377# define REDIRECT ">" /* Coherent CC writes errors to stdout */
378# endif
379# endif
380# define gethome(x) getenv("HOME")
381#endif
382
383#if AMIGA /* Specify AMIGA environment */
384# ifndef CC_COMMAND
385# define CC_COMMAND "cc" /* generic C compiler */
386# endif
387# ifndef COLON
388# define COLON ':' /* Amiga files can also end in `:' */
389# endif
390# ifndef SYSEXRC
391# define SYSEXRC "S:" EXRC /* name of ".exrc" file in system dir */
392# endif
393# ifndef MAXRCLEN
394# define MAXRCLEN 2048 /* max size of a .exrc file */
395# endif
396# ifndef NBUFS
397# define NBUFS 10 /* must be at least 3 -- more is better */
398# endif
399# ifndef NEEDSYNC
400# define NEEDSYNC TRUE /* assume ":se sync" by default */
401# endif
15637ed4 402# ifndef PRSVDIR
08746e8b 403# define PRSVDIR "Elvis:" /* directory where preserved file live */
15637ed4
RG
404# endif
405# ifndef PRSVINDEX
08746e8b
AM
406# define PRSVINDEX "Elvis:Index" /* index of files in PRSVDIR */
407# endif
408# ifndef REDIRECT
409# define REDIRECT ">" /* Amiga writes errors to stdout */
410# endif
411# ifndef SCRATCHIN
412# define SCRATCHIN "%sSIXXXXXX"
413# endif
414# ifndef SCRATCHOUT
415# define SCRATCHOUT "%sSOXXXXXX"
416# endif
417# ifndef SHELL
418# define SHELL "newshell" /* default shell */
419# endif
420# ifndef TERMTYPE
421# define TERMTYPE "amiga" /* default termtype */
422# endif
423# ifndef TMPDIR /* for AMIGA should end in `:' or `/' */
424# define TMPDIR "T:" /* directory where temp files live */
425# endif
426# ifndef TMPNAME
427# define TMPNAME "%selv_%x.%x" /* format of names for temp files */
428# endif
429# define gethome(x) getenv("HOME")
430#endif
431
432#if MSDOS || TOS
433/* do not change TMPNAME and SCRATCH*: they MUST begin with '%s\\'! */
434# ifndef TMPDIR
435# define TMPDIR "C:\\tmp" /* directory where temp files live */
436# endif
437# ifndef PRSVDIR
438# define PRSVDIR "C:\\preserve" /* directory where preserved file live */
439# endif
440# ifndef PRSVINDEX
441# define PRSVINDEX "C:\\preserve\\Index" /* index of files in PRSVDIR */
442# endif
443# define TMPNAME "%s\\elv_%x.%x" /* temp file */
444# if MSDOS
445# if MICROSOFT
446# define CC_COMMAND "cl -c" /* C compiler */
447# else
448# if __BORLANDC__ /* Borland C */
449# define CC_COMMAND "bcc" /* C compiler */
450# else
451# if TURBOC /* Turbo C */
452# define CC_COMMAND "tcc" /* C compiler */
453# endif /* TURBOC */
454# endif /* BORLANDC */
455# endif /* MICROSOFT */
456# endif /* MSDOS */
457# define SCRATCHIN "%s\\siXXXXXX" /* DOS ONLY - output of filter program */
458# define SCRATCHOUT "%s\\soXXXXXX" /* temp file used as input to filter */
459# define SLASH '\\'
460# ifndef SHELL
461# if TOS
462# define SHELL "shell.ttp" /* default shell */
463# else
464# define SHELL "command.com" /* default shell */
465# endif
466# endif
467# define NEEDSYNC TRUE /* assume ":se sync" by default */
468# if TOS && __GNUC__ /* probably on other systems, too */
469# define REDIRECT "2>" /* GNUC reports on 2, others on 1 */
470# define CC_COMMAND "gcc -c"
471# else
472# define REDIRECT ">" /* shell's redirection of stderr */
473# endif
474#endif
475
476#if VMS
477/* do not change TMPNAME, and SCRATCH*: they MUST begin with '%s\\'! */
478# ifndef TMPDIR
479# define TMPDIR "sys$scratch:" /* directory where temp files live */
15637ed4 480# endif
08746e8b
AM
481# define TMPNAME "%selv_%x.%x;1" /* temp file */
482# define SCRATCHIN "%ssiXXXXXX" /* DOS ONLY - output of filter program */
483# define SCRATCHOUT "%ssoXXXXXX" /* temp file used as input to filter */
484# define SLASH '\:' /* Worry point... jdc */
485# ifndef SHELL
486# define SHELL "" /* default shell */
487# endif
488# define REDIRECT ">" /* shell's redirection of stderr */
489# define tread(fd,buf,n) vms_read(fd,buf,(unsigned)(n))
490# define close vms_close
491# define lseek vms_lseek
492# define unlink vms_delete
493# define delete __delete /* local routine conflicts w/VMS rtl routine. */
494# define rpipe vms_rpipe
495# define rpclose vms_rpclose
496# define ttyread vms_ttyread
497# define gethome(x) getenv("HOME")
498/* There is no sync() on vms */
499# define sync()
500/* jdc -- seems VMS external symbols are case insensitive */
501# define m_fWord m_fw_ord
502# define m_bWord m_bw_ord
503# define m_eWord m_ew_ord
504# define m_Nsrch m_n_srch
505# define m_Fch m_f_ch
506# define m_Tch m_t_ch
507# define v_Xchar v_x_char
508/* jdc -- also, braindead vms curses always found by linker. */
509# define LINES elvis_LINES
510# define COLS elvis_COLS
511# define curscr elvis_curscr
512# define stdscr elvis_stdscr
513# define initscr elvis_initscr
514# define endwin elvis_endwin
515# define wrefresh elvis_wrefresh
516#endif
517
518#if OSK
519# ifndef TMPDIR
520# define TMPDIR "/dd/tmp" /* directory where temp files live */
521# endif
522# ifndef PRSVDIR
523# define PRSVDIR "/dd/usr/preserve" /* directory where preserved file live */
524# endif
525# ifndef PRSVINDEX
526# define PRSVINDEX "/dd/usr/preserve/Index" /* index of files in PRSVDIR */
527# endif
528# ifndef CC_COMMAND
529# define CC_COMMAND "cc -r" /* name of the compiler */
530# endif
531# ifndef EXRC
532# define EXRC ".exrc" /* init file in current directory */
533# endif
534# define SCRATCHOUT "%s/soXXXXXX" /* temp file used as input to filter */
535# ifndef SHELL
536# define SHELL "shell" /* default shell */
537# endif
538# define FILEPERMS (S_IREAD|S_IWRITE) /* file permissions used for creat() */
539# define REDIRECT ">>-" /* shell's redirection of stderr */
540# define sync() /* OS9 doesn't need a sync() */
541# define gethome(x) getenv("HOME")
542#endif
15637ed4
RG
543
544#ifndef TAGS
08746e8b
AM
545# define TAGS "tags" /* name of the tags file */
546#endif
547
548#ifndef TMPNAME
549# define TMPNAME "%s/elv_%x.%x" /* format of names for temp files */
550#endif
551
552#ifndef EXINIT
553# define EXINIT "EXINIT" /* name of EXINIT environment variable */
554#endif
555
556#ifndef EXRC
557# define EXRC "elvis.rc" /* name of ".exrc" file in current dir */
558#endif
559
560#ifndef HMEXRC
561# define HMEXRC EXRC /* name of ".exrc" file in home dir */
15637ed4
RG
562#endif
563
564#ifndef KEYWORDPRG
565# define KEYWORDPRG "ref"
566#endif
567
568#ifndef SCRATCHOUT
569# define SCRATCHIN "%s/SIXXXXXX"
570# define SCRATCHOUT "%s/SOXXXXXX"
571#endif
572
573#ifndef ERRLIST
08746e8b 574# define ERRLIST "errs"
15637ed4
RG
575#endif
576
577#ifndef SLASH
578# define SLASH '/'
579#endif
580
581#ifndef SHELL
582# define SHELL "shell"
583#endif
584
585#ifndef REG
08746e8b 586# define REG register
15637ed4
RG
587#endif
588
589#ifndef NEEDSYNC
590# define NEEDSYNC FALSE
591#endif
592
593#ifndef FILEPERMS
594# define FILEPERMS 0666
595#endif
596
08746e8b
AM
597#ifndef PRESERVE
598# define PRESERVE "/usr/libexec/elvispreserve" /* name of the "preserve" program */
599#endif
600
15637ed4
RG
601#ifndef CC_COMMAND
602# define CC_COMMAND "cc -c"
603#endif
604
605#ifndef MAKE_COMMAND
606# define MAKE_COMMAND "make"
607#endif
608
609#ifndef REDIRECT
610# define REDIRECT "2>"
611#endif
612
15637ed4
RG
613#ifndef BLKSIZE
614# ifdef CRUNCH
615# define BLKSIZE 1024
616# else
617# define BLKSIZE 2048
618# endif
619#endif
620
621#ifndef KEYBUFSIZE
622# define KEYBUFSIZE 1000
623#endif
624
08746e8b
AM
625#ifndef MAILER
626# define MAILER "mail"
15637ed4 627#endif
08746e8b
AM
628
629#ifndef gethome
630extern char *gethome();
631#endif
632
633#endif /* ndef _CONFIG_H */