]> diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/conf/RCS/mhconfig.c,v
sbr/mts.c: Delete mmdlm2; use same-valued mmdlm1 instead.
[nmh] / docs / historical / mh-6.8.5 / conf / RCS / mhconfig.c,v
1 head 2.73;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 2.73
9 date 96.02.08.19.07.47; author jromine; state Exp;
10 branches;
11 next 2.72;
12
13 2.72
14 date 96.02.08.18.36.25; author jromine; state Exp;
15 branches;
16 next 2.71;
17
18 2.71
19 date 93.11.30.22.01.04; author jromine; state Exp;
20 branches;
21 next 2.70;
22
23 2.70
24 date 93.08.25.18.07.10; author jromine; state Exp;
25 branches;
26 next 2.69;
27
28 2.69
29 date 93.08.20.19.47.46; author jromine; state Exp;
30 branches;
31 next 2.68;
32
33 2.68
34 date 93.08.19.23.51.43; author jromine; state Exp;
35 branches;
36 next 2.67;
37
38 2.67
39 date 93.06.03.17.59.55; author jromine; state Exp;
40 branches;
41 next 2.66;
42
43 2.66
44 date 93.06.03.17.43.20; author jromine; state Exp;
45 branches;
46 next 2.65;
47
48 2.65
49 date 93.02.26.19.01.17; author jromine; state Exp;
50 branches;
51 next 2.64;
52
53 2.64
54 date 92.12.16.21.01.07; author jromine; state Exp;
55 branches;
56 next 2.63;
57
58 2.63
59 date 92.12.02.19.08.03; author jromine; state Exp;
60 branches;
61 next 2.62;
62
63 2.62
64 date 92.11.13.00.55.38; author jromine; state Exp;
65 branches;
66 next 2.61;
67
68 2.61
69 date 92.11.12.22.48.51; author jromine; state Exp;
70 branches;
71 next 2.60;
72
73 2.60
74 date 92.11.11.22.58.07; author jromine; state Exp;
75 branches;
76 next 2.59;
77
78 2.59
79 date 92.11.11.21.26.23; author jromine; state Exp;
80 branches;
81 next 2.58;
82
83 2.58
84 date 92.11.10.22.40.56; author jromine; state Exp;
85 branches;
86 next 2.57;
87
88 2.57
89 date 92.11.09.17.37.20; author jromine; state Exp;
90 branches;
91 next 2.56;
92
93 2.56
94 date 92.11.06.00.46.48; author jromine; state Exp;
95 branches;
96 next 2.55;
97
98 2.55
99 date 92.11.05.19.25.27; author jromine; state Exp;
100 branches;
101 next 2.54;
102
103 2.54
104 date 92.11.05.17.20.49; author jromine; state Exp;
105 branches;
106 next 2.53;
107
108 2.53
109 date 92.11.04.03.00.54; author jromine; state Exp;
110 branches;
111 next 2.52;
112
113 2.52
114 date 92.10.31.07.56.48; author jromine; state Exp;
115 branches;
116 next 2.51;
117
118 2.51
119 date 92.10.27.20.22.26; author jromine; state Exp;
120 branches;
121 next 2.50;
122
123 2.50
124 date 92.10.27.18.10.15; author jromine; state Exp;
125 branches;
126 next 2.49;
127
128 2.49
129 date 92.10.26.22.32.44; author jromine; state Exp;
130 branches;
131 next 2.48;
132
133 2.48
134 date 92.10.21.02.06.58; author jromine; state Exp;
135 branches;
136 next 2.47;
137
138 2.47
139 date 92.10.20.23.49.51; author jromine; state Exp;
140 branches;
141 next 2.46;
142
143 2.46
144 date 92.10.20.20.40.19; author jromine; state Exp;
145 branches;
146 next 2.45;
147
148 2.45
149 date 92.10.19.21.59.33; author jromine; state Exp;
150 branches;
151 next 2.44;
152
153 2.44
154 date 92.10.19.19.57.22; author jromine; state Exp;
155 branches;
156 next 2.43;
157
158 2.43
159 date 92.10.19.16.46.32; author jromine; state Exp;
160 branches;
161 next 2.42;
162
163 2.42
164 date 92.05.12.21.45.45; author jromine; state Exp;
165 branches;
166 next 2.41;
167
168 2.41
169 date 92.03.03.17.09.57; author jromine; state Exp;
170 branches;
171 next 2.40;
172
173 2.40
174 date 92.03.03.17.07.48; author jromine; state Exp;
175 branches;
176 next 2.39;
177
178 2.39
179 date 92.02.09.23.30.11; author jromine; state Exp;
180 branches;
181 next 2.38;
182
183 2.38
184 date 92.02.08.00.02.59; author jromine; state Exp;
185 branches;
186 next 2.37;
187
188 2.37
189 date 92.02.07.19.12.39; author jromine; state Exp;
190 branches;
191 next 2.36;
192
193 2.36
194 date 92.02.05.22.10.00; author jromine; state Exp;
195 branches;
196 next 2.35;
197
198 2.35
199 date 92.02.05.21.52.46; author jromine; state Exp;
200 branches;
201 next 2.34;
202
203 2.34
204 date 92.02.05.21.10.45; author jromine; state Exp;
205 branches;
206 next 2.33;
207
208 2.33
209 date 92.01.31.22.47.36; author jromine; state Exp;
210 branches;
211 next 2.32;
212
213 2.32
214 date 92.01.31.21.07.51; author jromine; state Exp;
215 branches;
216 next 2.31;
217
218 2.31
219 date 92.01.27.17.34.29; author jromine; state Exp;
220 branches;
221 next 2.30;
222
223 2.30
224 date 91.01.25.14.48.44; author mh; state Exp;
225 branches;
226 next 2.29;
227
228 2.29
229 date 90.12.18.14.13.31; author mh; state Exp;
230 branches;
231 next 2.28;
232
233 2.28
234 date 90.12.18.13.38.31; author mh; state Exp;
235 branches;
236 next 2.27;
237
238 2.27
239 date 90.12.18.13.36.49; author mh; state Exp;
240 branches;
241 next 2.26;
242
243 2.26
244 date 90.11.05.16.24.55; author mh; state Exp;
245 branches;
246 next 2.25;
247
248 2.25
249 date 90.11.05.16.05.46; author mh; state Exp;
250 branches;
251 next 2.24;
252
253 2.24
254 date 90.11.05.15.56.27; author mh; state Exp;
255 branches;
256 next 2.23;
257
258 2.23
259 date 90.04.08.10.57.33; author sources; state Exp;
260 branches;
261 next 2.22;
262
263 2.22
264 date 90.04.06.09.54.00; author sources; state Exp;
265 branches;
266 next 2.21;
267
268 2.21
269 date 90.04.05.22.20.02; author sources; state Exp;
270 branches;
271 next 2.20;
272
273 2.20
274 date 90.04.05.15.29.12; author sources; state Exp;
275 branches;
276 next 2.19;
277
278 2.19
279 date 90.04.05.14.43.07; author sources; state Exp;
280 branches;
281 next 2.18;
282
283 2.18
284 date 90.04.02.14.49.52; author sources; state Exp;
285 branches;
286 next 2.17;
287
288 2.17
289 date 90.04.02.14.11.33; author sources; state Exp;
290 branches;
291 next 2.16;
292
293 2.16
294 date 90.03.21.11.01.12; author sources; state Exp;
295 branches;
296 next 2.15;
297
298 2.15
299 date 90.03.20.20.53.14; author sources; state Exp;
300 branches;
301 next 2.14;
302
303 2.14
304 date 90.03.19.15.49.44; author sources; state Exp;
305 branches;
306 next 2.13;
307
308 2.13
309 date 90.03.19.10.23.21; author sources; state Exp;
310 branches;
311 next 2.12;
312
313 2.12
314 date 90.03.15.21.25.01; author sources; state Exp;
315 branches;
316 next 2.11;
317
318 2.11
319 date 90.03.12.14.28.10; author sources; state Exp;
320 branches;
321 next 2.10;
322
323 2.10
324 date 90.03.09.14.27.20; author sources; state Exp;
325 branches;
326 next 2.9;
327
328 2.9
329 date 90.03.09.14.26.10; author sources; state Exp;
330 branches;
331 next 2.8;
332
333 2.8
334 date 90.02.16.11.07.25; author sources; state Exp;
335 branches;
336 next 2.7;
337
338 2.7
339 date 90.02.16.10.57.17; author sources; state Exp;
340 branches;
341 next 2.6;
342
343 2.6
344 date 90.02.15.15.55.37; author sources; state Exp;
345 branches;
346 next 2.5;
347
348 2.5
349 date 90.02.15.13.58.03; author sources; state Exp;
350 branches;
351 next 2.4;
352
353 2.4
354 date 90.02.15.13.56.08; author sources; state Exp;
355 branches;
356 next 2.3;
357
358 2.3
359 date 90.02.08.15.47.58; author sources; state Exp;
360 branches;
361 next 2.2;
362
363 2.2
364 date 90.02.06.12.50.08; author sources; state Exp;
365 branches;
366 next 2.1;
367
368 2.1
369 date 90.02.01.13.13.31; author sources; state Exp;
370 branches;
371 next 2.0;
372
373 2.0
374 date 89.11.17.15.56.51; author sources; state Exp;
375 branches;
376 next 1.2;
377
378 1.2
379 date 89.06.02.11.02.18; author sources; state Exp;
380 branches;
381 next 1.1;
382
383 1.1
384 date 88.06.29.13.57.02; author sources; state Exp;
385 branches;
386 next ;
387
388
389 desc
390 @Initial revision with no mods.
391 Gary <erickson>
392 @
393
394
395 2.73
396 log
397 @update for 6.8.4
398 @
399 text
400 @/* mhconfig.c - configure MH */
401 /* cc [-DSYS5] mhconfig.c -o mhconfig */
402 #ifndef lint
403 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.72 1996/02/08 18:36:25 jromine Exp jromine $";
404 #endif /* lint */
405
406 #include <ctype.h>
407 #include <stdio.h>
408 #ifdef hpux
409 #define SYS5
410 #endif
411 #ifdef SYS5
412 #define index strchr
413 #define rindex strrchr
414 #endif /* SYS5 */
415
416 static void insopt(), mkopts();
417
418 extern char *strcpy(), *malloc(), *index(), *rindex();
419 #ifdef notdef
420 extern char *sprintf(); /* rely on stdio.h to declare this */
421 #endif
422
423 #define BANNER "This is %s, for generic UNIX (MH.6 configuration program)\n\n"
424
425
426 #define SED "config.sed"
427 #define SEDOC "doc/config.sed"
428 #define MAKE "../%s/Makefile"
429
430 #define WARNING "This file is automatically generated. Do not edit!"
431 #define MHRELEASE "6.8.4" /* for version: "Maj.min.pat" */
432 #define MHCENTERFOOT "MH.6.8" /* for nroff page footers */
433 #define MHLEFTFOOT "[mh.6]" /* [mh.6] MH.6.6 page# */
434 #define MHSLIBVER "3.2" /* SunOS4 shared library version */
435
436 #define NOTOK (-1)
437
438 #define NULLCP ((char *) 0)
439
440 #define SVAL(s) (s ? s : "")
441
442 #define QUOTE '\\'
443
444 /* \f */
445
446 static int smtp = 0;
447 static int mpop = 0;
448
449 static int sedP = 1;
450 static int filesP = 1;
451 static int docP = 1;
452 static int makeP = 1;
453
454 static char *myname = "mhconfig";
455 static char *config = NULL;
456 static char *myopts = NULL;
457
458 static char *binpath = "/usr/local";
459 static char *bbhome = "/usr/spool/bboards";
460 static char *bboards = "off";
461 static char *bbdelivery = "off";
462 static char *ccoptions = NULL;
463 static char *chownpath = "/etc/chown";
464 static char *compiler = "/bin/cc";
465 static char *copy = "cp";
466 static char *curses = "-lcurses -ltermlib";
467 static char *debug = "off";
468 static char *editor = "prompter";
469 static char *etcpath = "/usr/local/lib/mh";
470 static char *ldoptions = NULL;
471 static char *ldoptlibs = NULL;
472 static char *lex = "lex -nt";
473 static char *ln = "ln";
474 static char *mailgroup = "off";
475 static char *mailpath = "/usr/spool/mail";
476 static char *maildir = NULL;
477 static char *mailfile = NULL;
478 static char *mancat = "man";
479 static char *mandir = "/usr/man";
480 static char *manuals = "standard";
481 static char *mf = "off";
482 static char *mts = "sendmail";
483 static char *poppath = "/usr/etc";
484 static char *removeit = "mv -f";
485 static char *regtest = "off";
486 static char *oldload = "off";
487 static char *options = NULL;
488 static char *pop = "off";
489 static char *ranlib = "on";
490 static char *sharedlib = "off";
491 static char *signl = "int";
492 static char *slibdir = "/usr/local/lib";
493 static char *slflags = "-pic";
494 static char *sprntf = NULL;
495
496 /* \f */
497
498 #define unknown 0
499 #define mmdf 1
500 #define mmdf2 2
501 #define mh 3
502 #define sendmail 4
503 static int mtsnum = unknown;
504
505 static struct mtsopt {
506 char *mtskey;
507 char *optval;
508 int code;
509 int mtsflags;
510 #define NOFLAGS 0x00
511 #define DOSMTP 0x01
512 #define NOMF 0x02
513 } mtsopts[] = {
514 "mmdf", "MMDFMTS MMDFI", mmdf, NOFLAGS,
515 "mmdf/smtp", "SENDMTS SMTP", mmdf, DOSMTP,
516 "mmdf2", "MMDFMTS MMDFII", mmdf2, NOFLAGS,
517 "mmdf2/smtp", "SENDMTS MMDFII SMTP", mmdf2, DOSMTP,
518 "mh", "MHMTS", mh, NOFLAGS,
519 "sendmail", "SENDMTS", sendmail, NOMF,
520 "sendmail/smtp", "SENDMTS SMTP", sendmail, NOMF,
521 "zmailer", "ZMAILER SENDMTS", sendmail, NOMF,
522 "zmailer/smtp", "ZMAILER SENDMTS SMTP", sendmail, NOMF,
523 NULL, NULL, unknown, NOFLAGS
524 };
525
526 /* other options which cause sed BEGIN/END configuration changes */
527
528 static struct copt {
529 char *c_name;
530 int c_value;
531 } copts[] = {
532 "APOP", 0, /* authenticated pop */
533 "BSD43", 0, /* sgid ttys */
534 "BSD44", 0, /* manual headings */
535 "KPOP", 0, /* KERBEROS pop */
536 "HESIOD", 0,
537 "MIME", 0, /* multi-media extensions */
538 "MPOP", 0, /* mobile pop */
539 "MSGID", 0, /* slocal dup surpression */
540 "NORUSERPASS", 0, /* no ruserpass(3) */
541 "TMA", 0, /* trusted mail */
542 "TTYD", 0,
543 "UCI", 0,
544 NULL, 0
545 };
546
547
548
549 /* \f */
550
551 static struct bind {
552 char *keyword;
553
554 char **value;
555
556 int flags;
557 #define BD_NIL 0x00
558 #define BD_ADD 0x01
559 } binds[] = {
560 "bin", &binpath, BD_NIL,
561 "bbhome", &bbhome, BD_NIL,
562 "bboards", &bboards, BD_NIL,
563 "bbdelivery", &bbdelivery, BD_NIL,
564 "ccoptions", &ccoptions, BD_ADD,
565 "chown", &chownpath, BD_NIL,
566 "cc", &compiler, BD_NIL,
567 "cp", &copy, BD_NIL,
568 "curses", &curses, BD_NIL,
569 "debug", &debug, BD_NIL,
570 "editor", &editor, BD_NIL,
571 "etc", &etcpath, BD_NIL,
572 "ldoptions", &ldoptions, BD_ADD,
573 "ldoptlibs", &ldoptlibs, BD_ADD,
574 "lex", &lex, BD_NIL,
575 "ln", &ln, BD_NIL,
576 "mail", &mailpath, BD_NIL,
577 "mailgroup", &mailgroup, BD_NIL,
578 "mandir", &mandir, BD_NIL,
579 "manuals", &manuals, BD_NIL,
580 "mf", &mf, BD_NIL,
581 "mts", &mts, BD_NIL,
582 "oldload", &oldload, BD_NIL,
583 "options", &options, BD_ADD,
584 "pop", &pop, BD_NIL,
585 "popdir", &poppath, BD_NIL,
586 "ranlib", &ranlib, BD_NIL,
587 "remove", &removeit, BD_NIL,
588 "regtest", &regtest, BD_NIL,
589 "sharedlib", &sharedlib, BD_NIL,
590 "signal", &signl, BD_NIL,
591 "slflags", &slflags, BD_NIL,
592 "slibdir", &slibdir, BD_NIL,
593 "sprintf", &sprntf, BD_NIL,
594 NULL
595 };
596
597 /* \f */
598
599 char *files[] = {
600 "../support/bboards/bboards.daily",
601 "../support/bboards/bboards.weekly",
602 "../support/bboards/crontab",
603 "../support/bboards/MakeBBoards",
604 "../config/config.c",
605 "../zotnet/mts/mts.c",
606 "../zotnet/mts/mtstailor",
607 "../support/general/MailAliases",
608 "../mts/sendmail/bboardsMH.m4",
609 "../mts/sendmail/popMH.m4",
610 NULL
611 };
612
613 static struct pair {
614 char *infile;
615 char *outfile;
616 } makefiles[] = {
617 "makefiles/MH-Makefile", ".",
618 "makefiles/config","config",
619 "makefiles/dist","dist",
620 "makefiles/doc","doc",
621 "makefiles/mtsM","mts",
622 "makefiles/mts/mh","mts/mh",
623 "makefiles/mts/mmdf","mts/mmdf",
624 "makefiles/mts/sendmail","mts/sendmail",
625 "makefiles/papers","papers",
626 "makefiles/sbr","sbr",
627 "makefiles/supportM","support",
628 "makefiles/support/bboards","support/bboards",
629 "makefiles/support/general","support/general",
630 "makefiles/support/pop","support/pop",
631 "makefiles/uip","uip",
632 "makefiles/zotnetM","zotnet",
633 "makefiles/zotnet/bboards","zotnet/bboards",
634 "makefiles/zotnet/mf","zotnet/mf",
635 "makefiles/zotnet/mts","zotnet/mts",
636 "makefiles/zotnet/tws","zotnet/tws",
637 NULL
638 };
639
640
641 static do_sed(), do_sedfile(), do_files(), do_doc(), do_make();
642 static shell(), arginit(), add_option(), trim();
643
644 static char *stradd (), *strdup (), *tail ();
645
646 long time ();
647
648 /* \f */
649
650 /* ARGSUSED */
651
652 main (argc, argv, envp)
653 int argc;
654 char **argv,
655 **envp;
656 {
657 arginit (argv);
658
659 if (sedP)
660 do_sed ();
661 if (filesP)
662 do_files ();
663 if (docP)
664 do_doc ();
665 if (makeP)
666 do_make ();
667
668 #ifdef notdef
669 printf ("Don't forget to edit \"config/mtstailor\"\n");
670 #endif
671 if (filesP || makeP)
672 printf ("Don't forget to run \"make clean\" in the top directory before compiling\n");
673
674 exit (0);
675 }
676
677 /* \f */
678
679 static do_sed () {
680 if (docP != 2)
681 do_sedfile (SED, 0);
682 do_sedfile (SEDOC, smtp);
683 }
684
685 static do_alldoc (fp)
686 FILE *fp;
687 {
688 fprintf (fp, "%s\n%s\n%s\n%s\n", /* turn @@BEGIN: XX into #ifdef XX */
689 "s!^@@BEGIN: \\(.*\\)$!.br\\", /* for MH wizard manual set */
690 ".ti 0i\\",
691 "#ifdef \\1\\",
692 ".br!"
693 );
694 fprintf (fp, "%s\n%s\n%s\n%s\n",
695 "s!^@@END: \\(.*\\)$!.br\\",
696 ".ti 0i\\",
697 "#endif /* \\1\\ */",
698 ".br!"
699 );
700 }
701
702 /* \f */
703
704 static do_sedfile (sed, flag)
705 char *sed;
706 int flag;
707 {
708 int i;
709 FILE * fp;
710 struct copt *op;
711
712 if ((fp = fopen (sed, "w")) == NULL)
713 adios (sed, "unable to write");
714 printf ("generating %s\n", sed);
715
716 if (docP == 2) {
717 printf ("...using special all-doc format.\n");
718 printf ("Be sure to reconfigure before compiling.\n");
719 do_alldoc(fp); /* hack up doc/config.sed */
720 }
721
722 fprintf (fp, "s%%@@(MHCONFIGFILE)%%%s%%g\n", SVAL(config));
723 fprintf (fp, "s%%@@(MHWARNING)%%%s%%g\n", WARNING);
724 fprintf (fp, "s%%@@(MHRELEASE)%%%s%%g\n", MHRELEASE);
725 fprintf (fp, "s%%@@(MHCENTERFOOT)%%%s%%g\n", MHCENTERFOOT);
726 fprintf (fp, "s%%@@(MHLEFTFOOT)%%%s%%g\n", MHLEFTFOOT);
727 fprintf (fp, "s%%@@(MHBINPATH)%%%s%%g\n", SVAL (binpath));
728 fprintf (fp, "s%%@@(MHETCPATH)%%%s%%g\n", SVAL (etcpath));
729 fprintf (fp, "s%%@@(MHPOPDPATH)%%%s%%g\n", SVAL (poppath));
730 fprintf (fp, "s%%@@(MHCHOWNPATH)%%%s%%g\n", SVAL (chownpath));
731 fprintf (fp, "s%%@@(MHDROPATH)%%%s%%g\n", SVAL (maildir));
732 fprintf (fp, "s%%@@(MHDROPFIL)%%%s%%g\n", SVAL (mailfile));
733 if (maildir)
734 fprintf (fp, "s%%@@(MHDROPLOC)%%%s/$USER%%g\n", SVAL (maildir));
735 else
736 fprintf (fp, "s%%@@(MHDROPLOC)%%$HOME/%s%%g\n", SVAL (mailfile));
737 fprintf (fp, "s%%@@(MHDROPHAK)%%%s%%g\n",/* HACK */
738 maildir ? maildir : "/usr/spool/mail");
739
740 fprintf (fp, "s%%@@(MHMANDIR)%%%s%%g\n", mandir);
741 fprintf (fp, "s%%@@(MHCATMAN)%%%s%%g\n",
742 strcmp(mancat, "cat") == 0 ? "| nroff -man" : "");
743 if (strcmp (manuals, "standard") == 0 || strcmp (manuals, "gen") == 0)
744 for (i = 1; i <= 8; i++) {
745 fprintf (fp, "s%%@@(MHMANDIR%d)%%%s%d%%g\n", i, mancat, i);
746 fprintf (fp, "s%%@@(MHMANEXT%d)%%%d%%g\n", i, i);
747 }
748 else
749 for (i = 1; i <= 8; i++) {
750 fprintf (fp, "s%%@@(MHMANDIR%d)%%%s%c%%g\n", i, mancat,
751 strcmp (manuals, "new") == 0 ? 'n'
752 : strcmp (manuals, "old") == 0 ? 'o'
753 : strcmp (manuals, "bsd44") == 0 ? i + '0'
754 : 'l');
755 fprintf (fp, "s%%@@(MHMANEXT%d)%%%c%%g\n", i,
756 strcmp (manuals, "new") == 0 ? 'n'
757 : strcmp (manuals, "old") == 0 ? 'o'
758 : strcmp (manuals, "bsd44") == 0 ? '0'
759 : 'l');
760 }
761
762 /* \f */
763
764 if (strcmp (regtest, "on") == 0)
765 fprintf (fp, "s%%@@(MHHOSTVER)%%%s%%g\n", "-n");
766 else
767 fprintf (fp, "s%%@@(MHHOSTVER)%%%s%%g\n", "");
768
769 if (strcmp (manuals, "gen") == 0 || strcmp (manuals, "none") == 0)
770 fprintf (fp, "s%%@@(MHMANGEN)%%%s%%g\n", "#"); /* comment char */
771 else
772 fprintf (fp, "s%%@@(MHMANGEN)%%%s%%g\n", "");
773
774 fprintf (fp, "s%%@@(MHEDITOR)%%%s%%g\n", SVAL (editor));
775 fprintf (fp, "s%%@@(MHCONFIG)%%%s%%g\n", SVAL (myopts));
776 fprintf (fp, "s%%@@(MHCOMPILER)%%%s%%g\n", SVAL (compiler));
777 fprintf (fp, "s%%@@(CP)%%%s%%g\n", SVAL (copy));
778 fprintf (fp, "s%%@@(LN)%%%s%%g\n", SVAL (ln));
779 fprintf (fp, "s%%@@(LEX)%%%s%%g\n", SVAL (lex));
780 if (ccoptions)
781 fprintf (fp, "s%%@@(MHOPTIONS)%%%s %s%%g\n",
782 SVAL (options), SVAL (ccoptions));
783 else
784 fprintf (fp, "s%%@@(MHOPTIONS)%%%s %s%%g\n",
785 SVAL (options), "-O");
786 fprintf (fp, "s%%@@(LDOPTIONS)%%%s%%g\n", SVAL (ldoptions));
787 fprintf (fp, "s%%@@(LDOPTLIB)%%%s%%g\n", SVAL (ldoptlibs));
788 fprintf (fp, "s%%@@(LDCURSES)%%%s%%g\n", SVAL (curses));
789
790 if (strcmp (bboards, "off") == 0)
791 fprintf (fp, "/^@@BEGIN: BBOARDS$/,/^@@END: BBOARDS$/d\n");
792 else
793 fprintf (fp, "/^@@BEGIN: BBOARDS$/d\n/^@@END: BBOARDS$/d\n");
794 fprintf (fp, "s%%@@(BBHOME)%%%s%%g\n", SVAL (bbhome));
795 if (strcmp (bbdelivery, "off") == 0)
796 fprintf (fp, "/^@@BEGIN: BBSERVER$/,/^@@END: BBSERVER$/d\n");
797 else
798 fprintf (fp, "/^@@BEGIN: BBSERVER$/d\n/^@@END: BBSERVER$/d\n");
799
800 if (strcmp (debug, "on") == 0) {
801 fprintf (fp, "/^@@BEGIN: DEBUG$/d\n/^@@END: DEBUG$/d\n");
802 fprintf (fp, "/^@@BEGIN: OPTIM$/,/^@@END: OPTIM$/d\n");
803 }
804 else {
805 fprintf (fp, "/^@@BEGIN: DEBUG$/,/^@@END: DEBUG$/d\n");
806 fprintf (fp, "/^@@BEGIN: OPTIM$/d\n/^@@END: OPTIM$/d\n");
807 }
808
809 if (strcmp (mailgroup, "off")) { /* for SYS5 sgid-inc */
810 fprintf (fp, "/^@@BEGIN: MAILGROUP$/d\n/^@@END: MAILGROUP$/d\n");
811 fprintf (fp, "s%%@@(MAILGROUP)%%%s%%g\n", SVAL (mailgroup));
812 }
813 else
814 fprintf (fp, "/^@@BEGIN: MAILGROUP$/,/^@@END: MAILGROUP$/d\n");
815
816 if (strcmp (oldload, "on") == 0)
817 fprintf (fp, "/^@@BEGIN: OLDLOAD$/d\n/^@@END: OLDLOAD$/d\n");
818 else
819 fprintf (fp, "/^@@BEGIN: OLDLOAD$/,/^@@END: OLDLOAD$/d\n");
820 if (strcmp (oldload, "off") == 0)
821 fprintf (fp, "/^@@BEGIN: NEWLOAD$/d\n/^@@END: NEWLOAD$/d\n");
822 else
823 fprintf (fp, "/^@@BEGIN: NEWLOAD$/,/^@@END: NEWLOAD$/d\n");
824
825 /* \f */
826
827 if (strcmp (ranlib, "on") == 0) {
828 fprintf (fp, "/^@@BEGIN: RANLIB$/d\n/^@@END: RANLIB$/d\n");
829 fprintf (fp, "/^@@BEGIN: LORDER$/,/^@@END: LORDER$/d\n");
830 }
831 else {
832 fprintf (fp, "/^@@BEGIN: LORDER$/d\n/^@@END: LORDER$/d\n");
833 fprintf (fp, "/^@@BEGIN: RANLIB$/,/^@@END: RANLIB$/d\n");
834 }
835
836 if (strcmp (sharedlib, "off")) { /* if not off */
837 fprintf (fp, "/^@@BEGIN: SHAREDLIB$/d\n/^@@END: SHAREDLIB$/d\n");
838 fprintf (fp, "/^@@BEGIN: STDLIB$/,/^@@END: STDLIB$/d\n");
839 fprintf (fp, "s%%@@(SLIBDIR)%%%s%%g\n", slibdir);
840 fprintf (fp, "s%%@@(SLIBVER)%%%s%%g\n", MHSLIBVER);
841 fprintf (fp, "s%%@@(SLFLAGS)%%%s%%g\n", SVAL(slflags));
842 if (strcmp (sharedlib, "secure") == 0)
843 fprintf (fp, "s%%@@(SLDFLAG)%%-L%s%%g\n",slibdir);
844 else
845 fprintf (fp, "s%%@@(SLDFLAG)%%%%g\n");
846 }
847 else {
848 fprintf (fp, "/^@@BEGIN: STDLIB$/d\n/^@@END: STDLIB$/d\n");
849 fprintf (fp, "/^@@BEGIN: SHAREDLIB$/,/^@@END: SHAREDLIB$/d\n");
850 }
851 if (strcmp (sharedlib, "sun4") == 0 || strcmp (sharedlib, "on") == 0)
852 fprintf (fp, "/^@@BEGIN: SUN4SHLIB$/d\n/^@@END: SUN4SHLIB$/d\n");
853 else
854 fprintf (fp, "/^@@BEGIN: SUN4SHLIB$/,/^@@END: SUN4SHLIB$/d\n");
855 if (strcmp (sharedlib, "sys5") == 0)
856 fprintf (fp, "/^@@BEGIN: SYS5SHLIB$/d\n/^@@END: SYS5SHLIB$/d\n");
857 else
858 fprintf (fp, "/^@@BEGIN: SYS5SHLIB$/,/^@@END: SYS5SHLIB$/d\n");
859
860 /* \f */
861
862 if (flag || ((mtsnum == mmdf || mtsnum == mmdf2) && !smtp)) {
863 fprintf (fp, "/^@@BEGIN: MMDFMTS$/d\n/^@@END: MMDFMTS$/d\n");
864 if (mtsnum == mmdf)
865 fprintf (fp, "/^@@BEGIN: MMDFIMTS$/d\n/^@@END: MMDFIMTS$/d\n");
866 else
867 fprintf (fp, "/^@@BEGIN: MMDFIMTS$/,/^@@END: MMDFIMTS$/d\n");
868 if (mtsnum == mmdf2)
869 fprintf (fp, "/^@@BEGIN: MMDFIIMTS$/d\n/^@@END: MMDFIIMTS$/d\n");
870 else
871 fprintf (fp, "/^@@BEGIN: MMDFIIMTS$/,/^@@END: MMDFIIMTS$/d\n");
872 }
873 else {
874 fprintf (fp, "/^@@BEGIN: MMDFMTS$/,/^@@END: MMDFMTS$/d\n");
875 fprintf (fp, "/^@@BEGIN: MMDFIMTS$/,/^@@END: MMDFIMTS$/d\n");
876 fprintf (fp, "/^@@BEGIN: MMDFIIMTS$/,/^@@END: MMDFIIMTS$/d\n");
877 }
878
879 if (mtsnum == mh)
880 fprintf (fp, "/^@@BEGIN: MHMTS$/d\n/^@@END: MHMTS$/d\n");
881 else
882 fprintf (fp, "/^@@BEGIN: MHMTS$/,/^@@END: MHMTS$/d\n");
883
884 if (!flag && (mtsnum == sendmail || smtp))
885 fprintf (fp, "/^@@BEGIN: SENDMTS$/d\n/^@@END: SENDMTS$/d\n");
886 else
887 fprintf (fp, "/^@@BEGIN: SENDMTS$/,/^@@END: SENDMTS$/d\n");
888
889 switch (mtsnum) {
890 case mh:
891 case sendmail:
892 case mmdf:
893 fprintf (fp, "/^@@BEGIN: SENDMTSHACK$/d\n/^@@END: SENDMTSHACK$/d\n");
894 break;
895
896 default:
897 fprintf (fp, "/^@@BEGIN: SENDMTSHACK$/,/^@@END: SENDMTSHACK$/d\n");
898 break;
899 }
900
901 /* \f */
902
903 /* special hack for support/pop/popser.c */
904 fprintf (fp, "s%%@@(POPUUMBOX)%%%s%%g\n",
905 mtsnum == sendmail ? "-DPOPUUMBOX" : "");
906
907 if (smtp)
908 fprintf (fp, "/^@@BEGIN: SMTP$/d\n/^@@END: SMTP$/d\n");
909 else
910 fprintf (fp, "/^@@BEGIN: SMTP$/,/^@@END: SMTP$/d\n");
911
912 if (strcmp (pop, "on") == 0)
913 fprintf (fp, "/^@@BEGIN: POP$/d\n/^@@END: POP$/d\n");
914 else
915 fprintf (fp, "/^@@BEGIN: POP$/,/^@@END: POP$/d\n");
916
917 if (strcmp (bboards, "pop") == 0)
918 fprintf (fp, "/^@@BEGIN: BPOP$/d\n/^@@END: BPOP$/d\n");
919 else
920 fprintf (fp, "/^@@BEGIN: BPOP$/,/^@@END: BPOP$/d\n");
921
922 if (strcmp (bboards, "nntp") == 0)
923 fprintf (fp, "/^@@BEGIN: NNTP$/d\n/^@@END: NNTP$/d\n");
924 else
925 fprintf (fp, "/^@@BEGIN: NNTP$/,/^@@END: NNTP$/d\n");
926
927 if (strcmp (mf, "on") == 0)
928 fprintf (fp, "/^@@BEGIN: MF$/d\n/^@@END: MF$/d\n");
929 else
930 fprintf (fp, "/^@@BEGIN: MF$/,/^@@END: MF$/d\n");
931
932 fprintf (fp, "s%%@@(MHREMOVE)%%%s%%g\n", SVAL (removeit));
933
934 for (op = copts; op->c_name; op++) {
935 fprintf (fp, op->c_value ? "/^@@BEGIN: %s$/d\n/^@@END: %s$/d\n" :
936 "/^@@BEGIN: %s$/,/^@@END: %s$/d\n",
937 op->c_name, op->c_name);
938 }
939
940 (void) fclose (fp);
941 }
942
943 /* \f */
944
945 static do_files () {
946 char **pp;
947
948 for (pp = files; *pp; pp++)
949 shell ("rm -f %s; sed -f %s < config/%s > %s",
950 *pp, SED, tail (*pp), *pp);
951 }
952
953
954 static do_doc () {
955 shell ("./mhdoc");
956 }
957
958
959 static do_make () {
960 char buffer[BUFSIZ];
961 struct pair *pp;
962
963 for (pp = makefiles; pp -> infile; pp++) {
964 (void) sprintf (buffer, MAKE, pp -> outfile);
965 shell ("rm -f %s; sed -f %s < %s > %s",
966 buffer, SED, pp -> infile, buffer);
967 }
968 }
969
970 /* \f */
971
972 /* VARARGS */
973
974 static shell (fmt, a, b, c, d)
975 char *fmt,
976 *a,
977 *b,
978 *c,
979 *d;
980 {
981 char buffer[BUFSIZ];
982
983 (void) sprintf (buffer, fmt, a, b, c, d);
984 printf ("%s\n", buffer);
985 (void) fflush (stdout);
986
987 if (system (buffer))
988 adios (NULLCP, "failed");
989 }
990
991 /* \f */
992
993 static arginit (vec)
994 char **vec;
995 {
996 int i;
997 char *ap,
998 *cp,
999 *dp,
1000 buffer[BUFSIZ];
1001 struct bind *bp;
1002 FILE * fp;
1003
1004 myname = tail (*vec);
1005 printf (BANNER, myname);
1006 (void) fflush (stdout);
1007
1008 for (vec++; *vec; vec++) {
1009 if (strcmp (*vec, "-D") == 0) {
1010 sedP = 1; filesP = makeP = 0; docP = 2;
1011 continue;
1012 }
1013 if (strcmp (*vec, "-s") == 0) {
1014 sedP = !sedP;
1015 continue;
1016 }
1017 if (strcmp (*vec, "-f") == 0) {
1018 filesP = !filesP;
1019 continue;
1020 }
1021 if (strcmp (*vec, "-d") == 0) {
1022 docP = !docP;
1023 continue;
1024 }
1025 if (strcmp (*vec, "-m") == 0) {
1026 makeP = !makeP;
1027 continue;
1028 }
1029 if (strcmp (*vec, "-help") == 0) {
1030 printf ("usage: %s [opt] file\n", myname);
1031 printf ("%s\n%s\n%s\n%s\n",
1032 " -s\tno sed files", " -f\tno config files",
1033 " -d\tno doc files", " -m\tno makefiles");
1034 exit (0);
1035 }
1036 break;
1037 }
1038 if ((config = *vec) == NULL || vec[1] != NULL) /* no arg or too many */
1039 adios (NULLCP, "usage: %s file", myname);
1040
1041 /* \f */
1042
1043 if ((fp = fopen (config, "r")) == NULL)
1044 adios (config, "unable to read");
1045
1046 while (fgets (buffer, sizeof buffer, fp)) {
1047 if (ap = index (buffer, '\n'))
1048 *ap-- = '\0';
1049 else
1050 ap = &buffer[strlen (buffer) - 1];
1051 while (ap >= buffer)
1052 if (isspace (*ap))
1053 *ap = '\0';
1054 else
1055 break;
1056 for (cp = buffer; isspace (*cp); cp++)
1057 continue;
1058 if (*cp == '\0' || *cp == '#')
1059 continue;
1060 for (ap = cp; *ap; ap++)
1061 if (isspace (*ap) || *ap == ':') {
1062 *ap++ = '\0';
1063 while (isspace (*ap))
1064 ap++;
1065 break;
1066 }
1067 for (bp = binds; bp -> keyword; bp++)
1068 if (strcmp (bp -> keyword, cp) == 0)
1069 break;
1070 if (bp -> keyword == NULL)
1071 adios (NULLCP, "unknown option %s in %s", cp, config);
1072 else
1073 if (*(bp -> value) == NULL || !(bp -> flags & BD_ADD))
1074 *(bp -> value) = strdup (ap);
1075 else
1076 *(bp -> value) = stradd (ap, stradd (" ", *(bp -> value)));
1077 }
1078
1079 (void) fclose (fp);
1080
1081 /* \f */
1082
1083 if (binpath == NULL)
1084 adios (NULLCP, "bin must be specified in %s", config);
1085 trim (binpath);
1086
1087 if (strcmp (bboards, "on") && strcmp (bboards, "off") &&
1088 strcmp (bboards, "pop") && strcmp (bboards, "nntp"))
1089 adios (NULLCP, "bboards should be %s not %s",
1090 "either \"on\", \"off\", \"pop\" or \"nntp\"", bboards);
1091 if (strcmp (bboards, "off") == 0 && strcmp (bbdelivery, "off"))
1092 adios (NULLCP,
1093 "you cannot have \"bbdelivery\" \"%s\" with \"bboards\" \"%s\"",
1094 bbdelivery, bboards);
1095 if (bbhome == NULL)
1096 adios (NULLCP, "bbhome must be specified in %s", config);
1097 trim (bbhome);
1098
1099 if (strcmp (debug, "on") && strcmp (debug, "off"))
1100 adios (NULLCP, "debug should be either \"on\" or \"off\", not %s",
1101 debug);
1102
1103 if (etcpath == NULL)
1104 adios (NULLCP, "etc must be specified in %s", config);
1105 trim (etcpath);
1106
1107 if (strcmp (mailgroup, "off")) /* if not "off" */
1108 add_option ("MAILGROUP");
1109 if (mailpath == NULL)
1110 adios (NULLCP, "mail must be specified in %s", config);
1111 trim (mailpath);
1112 if (*mailpath == '/')
1113 maildir = mailpath;
1114 else
1115 mailfile = mailpath;
1116
1117 if (cp = index (manuals, '/')) { /* "standard/cat" */
1118 *cp++ = 0;
1119 mancat = cp;
1120 if (strcmp (mancat, "cat"))
1121 adios (NULLCP,"invalid manuals setting: %s/%s",manuals, mancat);
1122 }
1123 if (strcmp (manuals, "standard")
1124 && strcmp (manuals, "bsd44")
1125 && strcmp (manuals, "local")
1126 && strcmp (manuals, "new")
1127 && strcmp (manuals, "old")
1128 && strcmp (manuals, "gen")
1129 && strcmp (manuals, "none"))
1130 adios (NULLCP,"invalid manuals setting: %s",manuals);
1131
1132 if (mts == NULL)
1133 adios (NULLCP, "mts must be specified in %s", config);
1134 for (i = 0; mtsopts[i].mtskey; i++)
1135 if (strcmp (mts, mtsopts[i].mtskey) == 0)
1136 break;
1137 if ((mtsnum = mtsopts[i].code) == unknown)
1138 adios (NULLCP, "invalid mts setting: %s", mts);
1139 add_option (mtsopts[i].optval);
1140 smtp = mtsopts[i].mtsflags & DOSMTP;
1141 if (mtsopts[i].mtsflags & NOMF)
1142 mf = "off"; /* hack... */
1143
1144 if (strcmp (pop, "on") && strcmp (pop, "off"))
1145 adios (NULLCP, "pop should be either \"on\" or \"off\", not %s", pop);
1146 if (strcmp (pop, "on") == 0)
1147 add_option ("POP");
1148
1149 if (strcmp (bboards, "pop") == 0) {
1150 add_option ("BPOP");
1151 if (strcmp (pop, "on"))
1152 adios (NULLCP, "bboards \"pop\" requires pop \"on\"");
1153 }
1154 else if (strcmp (bboards, "nntp") == 0) {
1155 add_option ("BPOP");/* used by msh.c & bbc.c, but see also pshsbr.c */
1156 add_option ("NNTP");
1157 if (mpop)
1158 adios (NULLCP,
1159 "bboards \"nntp\" is incompatible with \"options MPOP\"");
1160 }
1161
1162 if (strcmp (mf, "on") && strcmp (mf, "off"))
1163 adios (NULLCP, "mf should be either \"on\" or \"off\", not %s", mf);
1164 if (strcmp (mf, "on") == 0)
1165 add_option ("MF");
1166
1167 if (sprntf && strcmp (sprntf, "char *")) {/* this defaults to "char *" */
1168 if (strcmp (sprntf, "int"))
1169 adios (NULLCP,
1170 "sprintf should be either \"int\" or \"char *\", not %s",
1171 sprntf);
1172 add_option ("SPRINTFTYPE=int");
1173 }
1174
1175 if (strcmp (sharedlib, "on") && strcmp (sharedlib, "off")
1176 && strcmp (sharedlib, "sun4") && strcmp (sharedlib, "sys5")
1177 && strcmp (sharedlib, "secure"))
1178 adios (NULLCP,
1179 "sharedlib should be either \"sun4\", \"sys5\", or \"off\", not %s",
1180 sharedlib);
1181
1182 (void) sprintf(buffer, "TYPESIG=%s", signl);
1183 add_option (buffer);
1184
1185 /* loop over options string and add -D ccoptions */
1186
1187 begin_myopt ();
1188 if (cp = options) {
1189 for (ap = cp; *ap; ap++)
1190 if (isspace (*ap))
1191 *ap = ' ';
1192 options = NULL;
1193 for (ap = cp; dp = index (ap, ' '); ap = dp) {
1194 *dp++ = '\0';
1195 add_myopt (ap);
1196 (void) sprintf (buffer, "%s-D%s", options ? " " : "", ap);
1197 ap = buffer;
1198 options = stradd (ap, options);
1199 while (isspace (*dp))
1200 dp++;
1201 }
1202 if (*ap) {
1203 add_myopt (ap);
1204 (void) sprintf (buffer, "%s-D%s", options ? " " : "", ap);
1205 ap = buffer;
1206 options = stradd (ap, options);
1207 }
1208 free (cp);
1209 }
1210 end_myopt ();
1211 if (strcmp (bboards, "nntp") == 0 && mpop)
1212 adios (NULLCP,
1213 "bboards \"nntp\" is incompatible with \"options MPOP\"");
1214 }
1215
1216 /* \f */
1217
1218 static add_option (s)
1219 char *s;
1220 {
1221 options = options ? stradd (s, stradd (" ", options)) : strdup (s);
1222 }
1223
1224
1225 begin_myopt () {
1226 myopts = strdup ("char *options[] = {");
1227 }
1228
1229
1230 add_myopt (s)
1231 char *s;
1232 {
1233 int len;
1234 char *bp,
1235 buffer[BUFSIZ];
1236 struct copt *op;
1237 static int nameoutput = 0;
1238 static int linepos = 0;
1239 static int outputlinelen = 72;
1240
1241 for (op = copts; op->c_name; op++)
1242 if (!strncmp (op->c_name,s,strlen(op->c_name))) {
1243 op->c_value = 1;
1244 break;
1245 }
1246
1247 if (strcmp (s, "MPOP") == 0)
1248 mpop = 1;
1249 if (smtp && strcmp (s, "BERK") == 0) {
1250 fprintf (stderr, "\"options BERK\" overriding smtp suffix...\n");
1251 smtp = 0;
1252 }
1253 if (!nameoutput) {
1254 printf ("%s: ", bp = "options");
1255 linepos += (nameoutput = strlen (bp) + 2);
1256 }
1257 len = strlen (s);
1258 if (linepos != nameoutput)
1259 if (len + linepos + 3 > outputlinelen)
1260 printf ("\n%*s", linepos = nameoutput, "");
1261 else
1262 printf (" "), linepos++;
1263 printf ("[%s]", s);
1264 linepos += len + 2;
1265 (void) fflush (stdout);
1266
1267 bp = buffer;
1268 *bp++ = '"';
1269 while (*s) {
1270 if (*s == '"')
1271 *bp++ = QUOTE, *bp++ = QUOTE;
1272 *bp++ = *s++;
1273 }
1274 (void) strcpy (bp, "\", ");
1275 insopt (buffer);
1276 }
1277
1278
1279 end_myopt () {
1280 printf ("\n");
1281 (void) fflush (stdout);
1282 mkopts();
1283 myopts = stradd ("NULL};", myopts);
1284 }
1285
1286 /* \f */
1287
1288 static trim (s)
1289 char *s;
1290 {
1291 char *p;
1292
1293 if (s == NULL || (p = rindex (s, '/')) == NULL)
1294 return;
1295 if (*++p == '\0')
1296 *--p = '\0';
1297 }
1298
1299
1300 static char *tail (s)
1301 char *s;
1302 {
1303 char *p;
1304
1305 if (p = rindex (s, '/'))
1306 p++;
1307 return ((p == NULL || *p == '\0') ? s : p);
1308 }
1309
1310 /* \f */
1311
1312 static char *stradd (s1, s2)
1313 char *s1,
1314 *s2;
1315 {
1316 char *p;
1317
1318 if (s1 == NULL || *s1 == '\0')
1319 return s2;
1320 if (s2 == NULL)
1321 return strdup (s1);
1322 if ((p = malloc ((unsigned) (strlen (s1) + strlen (s2) + 2))) == NULL)
1323 adios (NULLCP, "insufficient memory");
1324
1325 (void) sprintf (p, "%s%s", s2, s1);
1326 if (s2)
1327 free (s2);
1328 return p;
1329 }
1330
1331
1332 static char *strdup (s)
1333 char *s;
1334 {
1335 char *p;
1336
1337 if ((p = malloc ((unsigned) (strlen (s) + 1))) == NULL)
1338 adios (NULLCP, "insufficient memory");
1339
1340 (void) strcpy (p, s);
1341 return p;
1342 }
1343
1344 /* \f */
1345
1346 #ifdef notdef
1347 /* these used to be for SYS5 machines, but now this is compiled
1348 * with -DSYS5 which redefines the SYS5 str[r]chr names to [r]index.
1349 */
1350 static char *index (s, c)
1351 char *s,
1352 c;
1353 {
1354 char i;
1355
1356 while (i = *s++)
1357 if (i == c)
1358 return (s - 1);
1359
1360 return NULL;
1361 }
1362
1363
1364 static char *rindex (s, c)
1365 char *s,
1366 c;
1367 {
1368 char i,
1369 *t;
1370
1371 t = NULL;
1372 while (i = *s++)
1373 if (i == c)
1374 t = s - 1;
1375
1376 return t;
1377 }
1378 #endif /* notdef */
1379
1380 /* \f */
1381
1382 /* VARARGS */
1383
1384 adios (what, fmt, a, b, c)
1385 char *what,
1386 *fmt,
1387 *a,
1388 *b,
1389 *c;
1390 {
1391 (void) fflush (stdout);
1392
1393 fprintf (stderr, "%s: ", myname);
1394 fprintf (stderr, fmt, a, b, c);
1395 if (what) {
1396 (void) fputc (' ', stderr);
1397 perror (what);
1398 }
1399 else
1400 (void) fputc ('\n', stderr);
1401
1402 exit (1);
1403 }
1404
1405 /* quick and dirty ordering of options for readability */
1406
1407 struct opt {
1408 char *s;
1409 struct opt *n;
1410 };
1411
1412 static struct opt *optp = (struct opt *)NULL;
1413
1414 static void
1415 insopt(s)
1416 char *s; /* string for sorting */
1417 {
1418 struct opt *p,
1419 *np,
1420 *lp = (struct opt *)NULL;
1421
1422 if ((np = (struct opt *) malloc ((unsigned) sizeof (struct opt))) ==
1423 (struct opt *)NULL)
1424 adios (NULL, "unable to malloc opt");
1425 np -> s = strdup(s);
1426 np -> n = (struct opt *)NULL;
1427
1428 for (p = optp; p; lp = p, p = p -> n) {
1429 if (strcmp (p->s, s) > 0)
1430 break;
1431 }
1432 if (p)
1433 np -> n = p;
1434 if (lp)
1435 lp -> n = np;
1436 else
1437 optp = np;
1438 }
1439
1440 static void
1441 mkopts()
1442 {
1443 struct opt *p;
1444
1445 for (p = optp; p; p = p -> n)
1446 myopts = stradd (p->s, myopts);
1447 }
1448 @
1449
1450
1451 2.72
1452 log
1453 @add BSD44
1454 @
1455 text
1456 @d4 1
1457 a4 1
1458 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.71 1993/11/30 22:01:04 jromine Exp jromine $";
1459 d32 1
1460 a32 1
1461 #define MHRELEASE "6.8.3" /* for version: "Maj.min.pat" */
1462 @
1463
1464
1465 2.71
1466 log
1467 @update for MH 6.8.3
1468 @
1469 text
1470 @d4 1
1471 a4 1
1472 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.70 1993/08/25 18:07:10 jromine Exp jromine $";
1473 d135 1
1474 @
1475
1476
1477 2.70
1478 log
1479 @update to MH 6.8.2
1480 @
1481 text
1482 @d4 1
1483 a4 1
1484 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.69 1993/08/20 19:47:46 jromine Exp jromine $";
1485 d32 1
1486 a32 1
1487 #define MHRELEASE "6.8.2" /* for version: "Maj.min.pat" */
1488 @
1489
1490
1491 2.69
1492 log
1493 @update version
1494 @
1495 text
1496 @d4 1
1497 a4 1
1498 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.68 1993/08/19 23:51:43 jromine Exp jromine $";
1499 d32 1
1500 a32 1
1501 #define MHRELEASE "6.8.1" /* for version: "Maj.min.pat" */
1502 @
1503
1504
1505 2.68
1506 log
1507 @add bsd44 hacks
1508 @
1509 text
1510 @d4 1
1511 a4 1
1512 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.67 1993/06/03 17:59:55 jromine Exp $";
1513 d32 1
1514 a32 1
1515 #define MHRELEASE "6.8" /* for version: "Maj.min.pat" */
1516 @
1517
1518
1519 2.67
1520 log
1521 @fixup
1522 @
1523 text
1524 @d4 1
1525 a4 1
1526 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.66 1993/06/03 17:43:20 jromine Exp jromine $";
1527 d353 1
1528 d358 1
1529 d724 1
1530 @
1531
1532
1533 2.66
1534 log
1535 @allow manuals to be installed "pre-nroff'd" (manuals: standard/cat)
1536 @
1537 text
1538 @d4 1
1539 a4 1
1540 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.63 1992/12/02 19:08:03 jromine Exp $";
1541 d715 3
1542 a717 2
1543 if (mancat = index (manuals, '/')) { /* "standard/cat" */
1544 *mancat++ = '\0';
1545 @
1546
1547
1548 2.65
1549 log
1550 @add NORUSERPASS for 386BSD
1551 @
1552 text
1553 @d4 1
1554 a4 1
1555 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.64 1992/12/16 21:01:07 jromine Exp jromine $";
1556 d79 1
1557 d341 2
1558 d345 1
1559 a345 1
1560 fprintf (fp, "s%%@@(MHMANDIR%d)%%man%d%%g\n", i, i);
1561 d350 1
1562 a350 1
1563 fprintf (fp, "s%%@@(MHMANDIR%d)%%man%c%%g\n", i,
1564 d715 5
1565 @
1566
1567
1568 2.64
1569 log
1570 @typo -- fix "manuals: none"
1571 @
1572 text
1573 @d4 1
1574 a4 1
1575 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.63 1992/12/02 19:08:03 jromine Exp jromine $";
1576 d139 1
1577 @
1578
1579
1580 2.63
1581 log
1582 @changes for release 6.8
1583 @
1584 text
1585 @d4 1
1586 a4 1
1587 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.62 1992/11/13 00:55:38 jromine Exp jromine $";
1588 d363 1
1589 a363 1
1590 if (strcmp (manuals, "gen") == 0 || strcmp (manuals, "gen") == 0)
1591 @
1592
1593
1594 2.62
1595 log
1596 @add TTYD config
1597 @
1598 text
1599 @d4 1
1600 a4 1
1601 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.61 1992/11/12 22:48:51 jromine Exp jromine $";
1602 d32 2
1603 a33 2
1604 #define MHRELEASE "6.7" /* for version: "Maj.min.pat" */
1605 #define MHCENTERFOOT "MH.6.7.5beta" /* for nroff page footers */
1606 @
1607
1608
1609 2.61
1610 log
1611 @typo
1612 @
1613 text
1614 @d4 1
1615 a4 1
1616 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.60 1992/11/11 22:58:07 jromine Exp jromine $";
1617 d140 1
1618 @
1619
1620
1621 2.60
1622 log
1623 @typo
1624 add slflags for "-pic" or "-K pic"
1625 @
1626 text
1627 @d4 1
1628 a4 1
1629 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.59 1992/11/11 21:26:23 jromine Exp $";
1630 d188 1
1631 a189 1
1632 "slflags", &slflags, BD_NIL,
1633 @
1634
1635
1636 2.59
1637 log
1638 @typo
1639 @
1640 text
1641 @d4 1
1642 a4 1
1643 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.58 1992/11/10 22:40:56 jromine Exp jromine $";
1644 d93 1
1645 d189 1
1646 d432 1
1647 a432 1
1648 fprintf (fp, "s%%@@(SLIBDIR)%%%s%%g\n",slibdir);
1649 d434 1
1650 d769 1
1651 a769 1
1652 add_options (buffer);
1653 @
1654
1655
1656 2.58
1657 log
1658 @add "signal"--defines TYPESIG
1659 @
1660 text
1661 @d4 1
1662 a4 1
1663 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.57 1992/11/09 17:37:20 jromine Exp jromine $";
1664 d267 1
1665 a267 1
1666 printf ("Don't forget to run \"make clean\" before compiling\n");
1667 @
1668
1669
1670 2.57
1671 log
1672 @typo "link" -> "ln"
1673 @
1674 text
1675 @d4 1
1676 a4 1
1677 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.56 1992/11/06 00:46:48 jromine Exp jromine $";
1678 d91 1
1679 d186 1
1680 d764 3
1681 @
1682
1683
1684 2.56
1685 log
1686 @allow "directive: value"
1687 @
1688 text
1689 @d4 1
1690 a4 1
1691 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.55 1992/11/05 19:25:27 jromine Exp jromine $";
1692 d170 1
1693 a170 1
1694 "link", &ln, BD_NIL,
1695 @
1696
1697
1698 2.55
1699 log
1700 @add "ln"
1701 @
1702 text
1703 @d4 1
1704 a4 1
1705 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.54 1992/11/05 17:20:49 jromine Exp jromine $";
1706 d649 1
1707 a649 1
1708 if (isspace (*ap)) {
1709 @
1710
1711
1712 2.54
1713 log
1714 @add "popdir"
1715 @
1716 text
1717 @d4 1
1718 a4 1
1719 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.53 1992/11/04 03:00:54 jromine Exp jromine $";
1720 d74 1
1721 d170 1
1722 d367 1
1723 @
1724
1725
1726 2.53
1727 log
1728 @slib 3.2
1729 @
1730 text
1731 @d4 1
1732 a4 1
1733 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.52 1992/10/31 07:56:48 jromine Exp jromine $";
1734 d178 1
1735 a178 1
1736 "poppath", &poppath, BD_NIL,
1737 @
1738
1739
1740 2.52
1741 log
1742 @fix in m_getfld -> libver 3.1
1743 @
1744 text
1745 @d4 1
1746 a4 1
1747 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.51 1992/10/27 20:22:26 jromine Exp jromine $";
1748 d35 1
1749 a35 1
1750 #define MHSLIBVER "3.1" /* SunOS4 shared library version */
1751 @
1752
1753
1754 2.51
1755 log
1756 @add MSGID
1757 @
1758 text
1759 @d4 1
1760 a4 1
1761 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.50 1992/10/27 18:10:15 jromine Exp jromine $";
1762 d35 1
1763 a35 1
1764 #define MHSLIBVER "3.0" /* SunOS4 shared library version */
1765 @
1766
1767
1768 2.50
1769 log
1770 @force incompatibility between NNTP & MPOP
1771 @
1772 text
1773 @d4 1
1774 a4 1
1775 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.49 1992/10/26 22:32:44 jromine Exp jromine $";
1776 d135 1
1777 @
1778
1779
1780 2.49
1781 log
1782 @make it clearer what are bad args
1783 @
1784 text
1785 @d4 1
1786 a4 1
1787 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.48 1992/10/21 02:06:58 jromine Exp jromine $";
1788 d48 1
1789 d734 3
1790 d785 3
1791 d821 2
1792 @
1793
1794
1795 2.48
1796 log
1797 @release 6.7.5beta
1798 @
1799 text
1800 @d4 1
1801 a4 1
1802 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.47 1992/10/20 23:49:51 jromine Exp jromine $";
1803 d621 1
1804 a621 1
1805 if ((config = *vec++) == NULL || *vec != NULL)
1806 @
1807
1808
1809 2.47
1810 log
1811 @add MHPOPDPATH
1812 @
1813 text
1814 @d4 1
1815 a4 1
1816 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.46 1992/10/20 20:40:19 jromine Exp jromine $";
1817 d33 1
1818 a33 1
1819 #define MHCENTERFOOT "MH.6.7.3" /* for nroff page footers */
1820 @
1821
1822
1823 2.46
1824 log
1825 @sharedlib ver 3.0
1826 @
1827 text
1828 @d4 1
1829 a4 1
1830 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.45 1992/10/19 21:59:33 jromine Exp jromine $";
1831 d81 1
1832 d176 1
1833 d318 1
1834 @
1835
1836
1837 2.45
1838 log
1839 @MH 6.7.3
1840 @
1841 text
1842 @d4 1
1843 a4 1
1844 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.44 1992/10/19 19:57:22 jromine Exp jromine $";
1845 d35 1
1846 a35 1
1847 #define MHSLIBVER "2.0" /* SunOS4 shared library version */
1848 @
1849
1850
1851 2.44
1852 log
1853 @add struct copts for "special" options
1854 @
1855 text
1856 @d4 1
1857 a4 1
1858 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.43 1992/10/19 16:46:32 jromine Exp jromine $";
1859 d33 1
1860 a33 1
1861 #define MHCENTERFOOT "MH.6.7.2" /* for nroff page footers */
1862 @
1863
1864
1865 2.43
1866 log
1867 @add page breaks
1868 @
1869 text
1870 @d4 1
1871 a4 1
1872 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.42 1992/05/12 21:45:45 jromine Exp jromine $";
1873 a46 1
1874 static int bsd43 = 0;
1875 a47 1
1876 static int uci = 0;
1877 d73 1
1878 a73 1
1879 static char *mailgroup = NULL;
1880 a85 2
1881 static char *kpop = "off";
1882 static char *hesiod = "off";
1883 a89 1
1884 static char *tma = "off";
1885 d121 19
1886 a174 2
1887 "kpop", &kpop, BD_NIL,
1888 "hesiod", &hesiod, BD_NIL,
1889 a180 1
1890 "tma", &tma, BD_NIL,
1891 d297 1
1892 d390 1
1893 a390 1
1894 if (mailgroup && strcmp (mailgroup, "off")) { /* for SYS5 sgid-inc */
1895 a439 5
1896 if (strcmp (tma, "on") == 0)
1897 fprintf (fp, "/^@@BEGIN: TMA$/d\n/^@@END: TMA$/d\n");
1898 else
1899 fprintf (fp, "/^@@BEGIN: TMA$/,/^@@END: TMA$/d\n");
1900
1901 a486 10
1902 if (bsd43) /* for sgid(tty)-rcvtty */
1903 fprintf (fp, "/^@@BEGIN: BSD43$/d\n/^@@END: BSD43$/d\n");
1904 else
1905 fprintf (fp, "/^@@BEGIN: BSD43$/,/^@@END: BSD43$/d\n");
1906
1907 if (uci)
1908 fprintf (fp, "/^@@BEGIN: UCI$/d\n/^@@END: UCI$/d\n");
1909 else
1910 fprintf (fp, "/^@@BEGIN: UCI$/,/^@@END: UCI$/d\n");
1911
1912 a496 10
1913 if (strcmp (kpop, "on") == 0)
1914 fprintf (fp, "/^@@BEGIN: KPOP$/d\n/^@@END: KPOP$/d\n");
1915 else
1916 fprintf (fp, "/^@@BEGIN: KPOP$/,/^@@END: KPOP$/d\n");
1917
1918 if (strcmp (hesiod, "on") == 0)
1919 fprintf (fp, "/^@@BEGIN: HESIOD$/d\n/^@@END: HESIOD$/d\n");
1920 else
1921 fprintf (fp, "/^@@BEGIN: HESIOD$/,/^@@END: HESIOD$/d\n");
1922
1923 d514 6
1924 d687 1
1925 a687 1
1926 if (mailgroup && strcmp (mailgroup, "off")) /* if not "off" */
1927 d752 1
1928 a752 4
1929 if (strcmp (tma, "on") && strcmp (tma, "off"))
1930 adios (NULLCP, "tma should be either \"on\" or \"off\", not %s", tma);
1931 if (strcmp (tma, "on") == 0)
1932 add_option ("TMA");
1933 d800 1
1934 d805 6
1935 a814 2
1936 if (strcmp (s, "UCI") == 0) uci = 1;
1937 if (strcmp (s, "BSD43") == 0) bsd43 = 1;
1938 @
1939
1940
1941 2.42
1942 log
1943 @fix ifdefs
1944 @
1945 text
1946 @d4 1
1947 a4 1
1948 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.41 1992/03/03 17:09:57 jromine Exp jromine $";
1949 d96 2
1950 d126 2
1951 d173 1
1952 d278 2
1953 d331 3
1954 d394 2
1955 d432 3
1956 d473 3
1957 d627 2
1958 @
1959
1960
1961 2.41
1962 log
1963 @fixes from mtr
1964 @
1965 text
1966 @d4 2
1967 a5 2
1968 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.40 1992/03/03 17:07:48 jromine Exp jromine $";
1969 #endif lint
1970 d15 1
1971 a15 1
1972 #endif SYS5
1973 d268 1
1974 a268 1
1975 "#endif \\1\\",
1976 d925 1
1977 a925 1
1978 #endif notdef
1979 @
1980
1981
1982 2.40
1983 log
1984 @nroff page footer -> MH.6.7.2
1985 @
1986 text
1987 @d4 1
1988 a4 1
1989 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.39 1992/02/09 23:30:11 jromine Exp jromine $";
1990 d674 1
1991 a674 1
1992 if (strcmp (mailgroup, "off")) /* if not "off" */
1993 @
1994
1995
1996 2.39
1997 log
1998 @fix for "manuals none" from Jos Vos <jos@@bull.nl>
1999 @
2000 text
2001 @d4 1
2002 a4 1
2003 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.38 1992/02/08 00:02:59 jromine Exp $";
2004 d33 1
2005 a33 1
2006 #define MHCENTERFOOT "MH.6.7" /* for nroff page footers */
2007 @
2008
2009
2010 2.38
2011 log
2012 @add MAILGROUP auto-option
2013 @
2014 text
2015 @d4 1
2016 a4 1
2017 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.37 1992/02/07 19:12:39 jromine Exp $";
2018 d329 1
2019 a329 1
2020 if (strcmp (manuals, "gen") == 0)
2021 @
2022
2023
2024 2.37
2025 log
2026 @add SYS5 shared libs
2027 @
2028 text
2029 @d4 1
2030 a4 1
2031 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.36 1992/02/05 22:10:00 jromine Exp jromine $";
2032 d674 2
2033 @
2034
2035
2036 2.36
2037 log
2038 @add zmailer support
2039 @
2040 text
2041 @d4 1
2042 a4 1
2043 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.35 1992/02/05 21:52:46 jromine Exp jromine $";
2044 d393 1
2045 a393 1
2046 if (strcmp (sharedlib, "on") == 0 || strcmp (sharedlib, "secure") == 0) {
2047 d407 8
2048 d731 1
2049 d734 1
2050 a734 1
2051 "sharedlib should be either \"on\", \"off\", or \"secure\", not %s",
2052 @
2053
2054
2055 2.35
2056 log
2057 @add "regtest: on/off" to not include hostname and date
2058 in version.c
2059 @
2060 text
2061 @d4 1
2062 a4 1
2063 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.34 1992/02/05 21:10:45 jromine Exp jromine $";
2064 d119 2
2065 @
2066
2067
2068 2.34
2069 log
2070 @update MHSLIBVER
2071 @
2072 text
2073 @d4 1
2074 a4 1
2075 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.33 1992/01/31 22:47:36 jromine Exp jromine $";
2076 d84 1
2077 d159 1
2078 d322 5
2079 @
2080
2081
2082 2.33
2083 log
2084 @add "cp" option
2085 @
2086 text
2087 @d4 1
2088 a4 1
2089 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.32 1992/01/31 21:07:51 jromine Exp jromine $";
2090 d35 1
2091 a35 1
2092 #define MHSLIBVER "1.1" /* SunOS4 shared library version */
2093 @
2094
2095
2096 2.32
2097 log
2098 @kerberos
2099 @
2100 text
2101 @d4 1
2102 a4 1
2103 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.31 1992/01/27 17:34:29 jromine Exp jromine $";
2104 d67 1
2105 d137 1
2106 d328 1
2107 @
2108
2109
2110 2.31
2111 log
2112 @shared libs changes
2113 @
2114 text
2115 @d4 1
2116 a4 1
2117 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.30 1991/01/25 14:48:44 mh Exp jromine $";
2118 d86 2
2119 d152 2
2120 d462 10
2121 d595 1
2122 a595 1
2123 *ap-- = NULL;
2124 d600 1
2125 a600 1
2126 *ap = NULL;
2127 d605 1
2128 a605 1
2129 if (*cp == NULL || *cp == '#')
2130 d609 1
2131 a609 1
2132 *ap++ = NULL;
2133 d728 1
2134 a728 1
2135 *dp++ = NULL;
2136 d819 2
2137 a820 2
2138 if (*++p == NULL)
2139 *--p = NULL;
2140 d831 1
2141 a831 1
2142 return ((p == NULL || *p == NULL) ? s : p);
2143 d842 1
2144 a842 1
2145 if (s1 == NULL || *s1 == NULL)
2146 @
2147
2148
2149 2.30
2150 log
2151 @sort options
2152 ./
2153 @
2154 text
2155 @d4 1
2156 a4 1
2157 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.29 90/12/18 14:13:31 mh Exp Locker: mh $";
2158 d35 1
2159 d57 1
2160 a57 1
2161
2162 d280 1
2163 d381 1
2164 a534 1
2165 *config,
2166 @
2167
2168
2169 2.29
2170 log
2171 @jlr
2172 @
2173 text
2174 @d4 1
2175 a4 1
2176 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.28 90/12/18 13:38:31 mh Exp Locker: mh $";
2177 d9 3
2178 a11 1
2179
2180 d17 2
2181 d783 1
2182 a783 1
2183 myopts = stradd (buffer, myopts);
2184 d790 1
2185 a790 1
2186
2187 d911 44
2188 @
2189
2190
2191 2.28
2192 log
2193 @jlr
2194 @
2195 text
2196 @d4 1
2197 a4 1
2198 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.27 90/12/18 13:36:49 mh Exp Locker: mh $";
2199 d375 1
2200 a375 1
2201 if (strcmp (sharedlib, "secure") == 0)
2202 d377 2
2203 @
2204
2205
2206 2.27
2207 log
2208 @sharedlib: secure
2209 jlr
2210 @
2211 text
2212 @d4 1
2213 a4 1
2214 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.26 90/11/05 16:24:55 mh Exp Locker: mh $";
2215 d688 5
2216 a692 3
2217 if (strcmp (sharedlib, "on") && strcmp (sharedlib, "off"))
2218 adios (NULLCP, "sharedlib should be either \"on\" or \"off\", not %s",
2219 sharedlib);
2220 @
2221
2222
2223 2.26
2224 log
2225 @fix
2226 @
2227 text
2228 @d4 1
2229 a4 1
2230 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.25 90/11/05 16:05:46 mh Exp Locker: mh $";
2231 d371 1
2232 a371 1
2233 if (strcmp (sharedlib, "on") == 0) {
2234 d375 2
2235 @
2236
2237
2238 2.25
2239 log
2240 @typo
2241 @
2242 text
2243 @d4 1
2244 a4 1
2245 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.24 90/11/05 15:56:27 mh Exp Locker: mh $";
2246 a412 2
2247 case sendmail: /* special hack for support/pop/popser.c */
2248 fprintf (fp, "s%%@@(POPUUMBOX)%%%s%%g\n", "-DPOPUUMBOX");
2249 d414 1
2250 d423 3
2251 @
2252
2253
2254 2.24
2255 log
2256 @special hack for popser.c -- yuk!
2257 /JLR
2258 @
2259 text
2260 @d4 1
2261 a4 1
2262 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.23 90/04/08 10:57:33 sources Exp Locker: mh $";
2263 d414 1
2264 a414 1
2265 fprintf (fp, "s%%@@(UUCPMBOX)%%%s%%g\n", "-DUUCPMBOX");
2266 @
2267
2268
2269 2.23
2270 log
2271 @*** empty log message ***
2272 @
2273 text
2274 @d4 1
2275 a4 1
2276 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.22 90/04/06 09:54:00 sources Exp Locker: sources $";
2277 d413 2
2278 a415 1
2279 case sendmail:
2280 @
2281
2282
2283 2.22
2284 log
2285 @update to MH.6.7
2286 @
2287 text
2288 @d4 1
2289 a4 1
2290 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.21 90/04/05 22:20:02 sources Exp Locker: sources $";
2291 d246 1
2292 a246 1
2293 ".ti -.25i\\",
2294 d252 1
2295 a252 1
2296 ".ti -.25in\\",
2297 @
2298
2299
2300 2.21
2301 log
2302 @version changes
2303 @
2304 text
2305 @d4 1
2306 a4 1
2307 static char ident[] = "@@(#)$Id: mhconfig.c,v 2.20 90/04/05 15:29:12 sources Exp Locker: sources $";
2308 d28 2
2309 a29 2
2310 #define MHRELEASE "6.6" /* for version: "Maj.min.pat" */
2311 #define MHCENTERFOOT "MH.6.6" /* for nroff page footers */
2312 @
2313
2314
2315 2.20
2316 log
2317 @add ID
2318 @
2319 text
2320 @d4 1
2321 a4 1
2322 static char ident[] = "@@(#)$Id:$";
2323 d28 2
2324 a29 1
2325 #define MHCENTERFOOT "MH.6.6" /* for man page footers */
2326 d276 1
2327 @
2328
2329
2330 2.19
2331 log
2332 @add ID
2333 @
2334 text
2335 @d4 1
2336 a4 1
2337 static char ident[] = "$Id:";
2338 @
2339
2340
2341 2.18
2342 log
2343 @remove spurious warnding
2344 @
2345 text
2346 @d3 3
2347 @
2348
2349
2350 2.17
2351 log
2352 @add sprintf config option
2353 remove include of strings.h, try to declare things ourselves
2354 @
2355 text
2356 @d220 1
2357 d222 1
2358 @
2359
2360
2361 2.16
2362 log
2363 @"bbdeliver: {on,off}"
2364 @
2365 text
2366 @d2 1
2367 a3 1
2368 #include "../h/strings.h"
2369 d7 10
2370 d80 1
2371 d145 1
2372 d667 8
2373 @
2374
2375
2376 2.15
2377 log
2378 @add footers for man pages
2379 @
2380 text
2381 @d44 1
2382 d110 1
2383 d313 4
2384 d592 4
2385 @
2386
2387
2388 2.14
2389 log
2390 @add special '-D' option for making developer
2391 manual set.
2392 @
2393 text
2394 @a6 1
2395
2396 d15 2
2397 d224 2
2398 a225 2
2399 fprintf (fp, "%s\n%s\n%s\n%s\n",
2400 "s!^@@BEGIN: \\(.*\\)$!.br\\",
2401 d250 1
2402 a250 1
2403 printf ("using special all-doc format.\n");
2404 d253 1
2405 a253 1
2406 }
2407 d256 2
2408 @
2409
2410
2411 2.13
2412 log
2413 @merge "nntpbboards" and "popbboards" into "bboards: nntp/pop"
2414 @
2415 text
2416 @d215 2
2417 a216 1
2418 do_sedfile (SED, 0);
2419 d220 16
2420 d248 6
2421 d503 4
2422 @
2423
2424
2425 2.12
2426 log
2427 @reminder to edit config/mtstailor
2428 @
2429 text
2430 @a60 1
2431 static char *nntpbboards = "off";
2432 a64 1
2433 static char *popbboards = "off";
2434 a123 1
2435 "nntpbboards", &nntpbboards, BD_NIL,
2436 a126 1
2437 "popbboards", &popbboards, BD_NIL,
2438 d280 3
2439 a282 1
2440 if (strcmp (bboards, "on") == 0)
2441 a283 2
2442 else
2443 fprintf (fp, "/^@@BEGIN: BBOARDS$/,/^@@END: BBOARDS$/d\n");
2444 d393 1
2445 a393 1
2446 if (strcmp (popbboards, "on") == 0)
2447 d398 1
2448 a398 1
2449 if (strcmp (nntpbboards, "on") == 0)
2450 d552 4
2451 a555 3
2452 if (strcmp (bboards, "on") && strcmp (bboards, "off"))
2453 adios (NULLCP, "bboards should be either \"on\" or \"off\", not %s",
2454 bboards);
2455 d601 1
2456 a601 4
2457 if (strcmp (popbboards, "on") && strcmp (popbboards, "off"))
2458 adios (NULLCP, "popbboards should be either \"on\" or \"off\", not %s",
2459 popbboards);
2460 if (strcmp (popbboards, "on") == 0) {
2461 d603 2
2462 a604 3
2463 if (strcmp (bboards, "on") || strcmp (pop, "on"))
2464 adios (NULLCP,
2465 "popbboards \"on\" requires both bboards and pop \"on\"");
2466 d606 1
2467 a606 5
2468
2469 if (strcmp (nntpbboards, "on") && strcmp (nntpbboards, "off"))
2470 adios (NULLCP, "nntpbboards should be either \"on\" or \"off\", not %s",
2471 nntpbboards);
2472 if (strcmp (nntpbboards, "on") == 0) {
2473 a608 2
2474 if (strcmp (bboards, "on"))
2475 adios (NULLCP, "nntpbboards \"on\" requires bboards \"on\"");
2476 a609 2
2477 if (strcmp (popbboards, "on") == 0 && strcmp (nntpbboards, "on") == 0)
2478 adios (NULLCP, "you can't have both nntpbboards and popbboards \"on\"");
2479 @
2480
2481
2482 2.11
2483 log
2484 @BSD43 for rcvtty (sgid-tty)
2485 @
2486 text
2487 @d209 1
2488 d211 1
2489 a211 1
2490 printf ("Don't forget to run \"make clean\" before proceeding\n");
2491 @
2492
2493
2494 2.10
2495 log
2496 @fix "remove" for new K&R defn
2497 @
2498 text
2499 @d27 1
2500 d277 2
2501 a278 1
2502 fprintf (fp, "s%%@@(MHOPTIONS)%%%s%%g\n", SVAL (options));
2503 d376 5
2504 d694 1
2505 @
2506
2507
2508 2.9
2509 log
2510 @add master Makefile
2511 @
2512 text
2513 @d61 1
2514 a61 1
2515 static char *remove = "mv -f";
2516 d131 1
2517 a131 1
2518 "remove", &remove, BD_NIL,
2519 d404 1
2520 a404 1
2521 fprintf (fp, "s%%@@(MHREMOVE)%%%s%%g\n", SVAL (remove));
2522 @
2523
2524
2525 2.8
2526 log
2527 @add -help
2528 @
2529 text
2530 @d157 1
2531 @
2532
2533
2534 2.7
2535 log
2536 @minor fix, and usage message improvement
2537 @
2538 text
2539 @d491 7
2540 d501 1
2541 a501 1
2542 adios (NULLCP, "usage: %s [-s -f -d -m] file", myname);
2543 @
2544
2545
2546 2.6
2547 log
2548 @typo
2549 @
2550 text
2551 @d474 1
2552 a474 1
2553 for (vec++;; vec++) {
2554 d494 1
2555 a494 1
2556 adios (NULLCP, "usage: %s file", myname);
2557 @
2558
2559
2560 2.5
2561 log
2562 @fix to MAILGROUP
2563 @
2564 text
2565 @d51 1
2566 a51 1
2567 static char *lex = "lex -nt"
2568 @
2569
2570
2571 2.4
2572 log
2573 @MAILGROUP stuff
2574 @
2575 text
2576 @d295 1
2577 a295 1
2578 if (mailgroup) { /* for SYS5 sgid-inc */
2579 @
2580
2581
2582 2.3
2583 log
2584 @add "lex" (lex -nt) option
2585 @
2586 text
2587 @d52 1
2588 d120 1
2589 d294 7
2590 @
2591
2592
2593 2.2
2594 log
2595 @ANSI Compilance
2596 @
2597 text
2598 @d51 1
2599 d117 1
2600 d268 1
2601 @
2602
2603
2604 2.1
2605 log
2606 @try to run "mhdoc" in current directory (for those without
2607 . in their path).
2608 @
2609 text
2610 @a12 2
2611 #define MFIL(f) "makefiles/f", "f"
2612 #define MMFIL(f,g) "makefiles/f", "g"
2613 d44 1
2614 d109 1
2615 d153 19
2616 a171 19
2617 MFIL (config),
2618 MFIL (dist),
2619 MFIL (doc),
2620 MMFIL (mtsM,mts),
2621 MFIL (mts/mh),
2622 MFIL (mts/mmdf),
2623 MFIL (mts/sendmail),
2624 MFIL (papers),
2625 MFIL (sbr),
2626 MMFIL (supportM,support),
2627 MFIL (support/bboards),
2628 MFIL (support/general),
2629 MFIL (support/pop),
2630 MFIL (uip),
2631 MMFIL (zotnetM,zotnet),
2632 MFIL (zotnet/bboards),
2633 MFIL (zotnet/mf),
2634 MFIL (zotnet/mts),
2635 MFIL (zotnet/tws),
2636 d176 2
2637 a177 1
2638 char *stradd (), *strdup (), *tail ();
2639 d179 2
2640 d265 1
2641 d760 4
2642 d792 1
2643 @
2644
2645
2646 2.0
2647 log
2648 @changes for SUN40 shared libraries and NNTP under bbc
2649 @
2650 text
2651 @d404 1
2652 a404 1
2653 shell ("mhdoc");
2654 @
2655
2656
2657 1.2
2658 log
2659 @*** empty log message ***
2660 @
2661 text
2662 @d59 1
2663 d121 1
2664 d377 5
2665 d582 12
2666 d600 2
2667 a601 2
2668 adios (NULLCP, "sharedlib should be either \"on\" or \"off\", not %s"
2669 , sharedlib);
2670 @
2671
2672
2673 1.1
2674 log
2675 @Initial revision
2676 @
2677 text
2678 @d30 1
2679 d65 2
2680 d126 2
2681 d302 10
2682 d355 5
2683 d580 4
2684 d643 1
2685 @