Debian Codegraph @

Configure

raw ◀ ▶
3 Debian patches touch this file
1 #! /bin/sh
2 #
3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
5 #
6 # (If you are trying to port this package to a machine without sh, I would
7 # suggest you cut out the prototypical config.h from the end of Configure
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
10 #
11 # $Header: Head.U,v 2.0 88/06/28 23:13:13 lwall Locked $
12 #
13 # Yes, you may rip this off to use in other distribution packages.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.)
16 # Except I dont have "metaconfig", so I'm tweaking all this by hand.
17 # Phil Brown, Jan 2000
18 # with thanks to Jim Brown (no relation :-)
19
20 : sanity checks
21 PATH=".:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin:$PATH"
22 export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
23
•24 case "$1" in
25 -d) shift; fastread='yes';;
26 esac
27
28 if test -z "$fastread" ; then
29 if test ! -t 0; then
30 echo "Say 'sh Configure', not 'sh <Configure'"
31 exit 1
•32 fi
33 fi
34
35 (alias) >/dev/null 2>&1 && \
36 echo "(I see you are using the Korn shell. Some ksh's blow up on Configure," && \
37 echo "especially on exotic machines. If yours does, try the Bourne shell instead.)"
38
39 if test ! -d ../UU; then
40 if test ! -d UU; then
41 mkdir UU
42 fi
43 cd UU
44 fi
45
46 bin=''
47 contains=''
48 cppstdin=''
49 cppminus=''
50 d_havetlib=''
51 termlib=''
52 d_memcpy=''
53 d_whoami=''
54 n=''
55 c=''
56 package=''
57 startsh=''
58 d_eunice=''
59 define=''
60 eunicefix=''
61 loclist=''
62 expr=''
63 sed=''
64 echo=''
65 cat=''
66 rm=''
67 mv=''
68 cp=''
69 tail=''
70 tr=''
71 mkdir=''
72 sort=''
73 uniq=''
74 grep=''
75 trylist=''
76 test=''
77 inews=''
78 ispell=''
79 egrep=''
80 more=''
81 pg=''
82 Mcc=''
83 vi=''
84 mailx=''
85 mail=''
86 cpp=''
87 perl=''
88 emacs=''
89 ls=''
90 rmail=''
91 sendmail=''
92 shar=''
93 smail=''
94 submit=''
95 tbl=''
96 troff=''
97 nroff=''
98 uname=''
99 uuname=''
100 line=''
101 chgrp=''
102 chmod=''
103 lint=''
104 sleep=''
105 pr=''
106 tar=''
107 ln=''
108 lpr=''
109 lp=''
110 touch=''
111 make=''
112 date=''
113 csh=''
114 pmake=''
115 mips=''
116 col=''
117 pack=''
118 compress=''
119 execmail=''
120 libswanted=''
121 d_broke_ctype=''
122 d_cuserid=''
123 d_flock=''
124 d_dotlock=''
125 d_fcntlock=''
126 lock_dir=''
127 has_flock=''
128 has_fcntl=''
129 d_gethname=''
130 d_douname=''
131 d_host_comp=''
132 ign_hname=''
133 d_index=''
134 d_internet=''
135 d_locale=''
136 d_nl_types=''
137 d_msgcat=''
138 d_usenls=''
139 d_mallocvoid=''
140 d_mmdf=''
141 d_noxheader=''
142 d_pidcheck=''
143 d_setgid=''
144 d_savegrpmboxid=''
145 mailermode=''
146 d_sigvec=''
147 d_sigvectr=''
148 d_sigset=''
149 d_sighold=''
150 d_sigprocmask=''
151 d_sigblock=''
152 d_sigaction=''
153 d_strings=''
154 d_pwdinsys=''
155 strings=''
156 includepath=''
157 d_useembed=''
158 d_utimbuf=''
•159 hostname='debian'
160 phostname=''
161 mydomain=''
162 autohostname=''
163 i_memory=''
164 i_stdarg=''
165 i_stdlib=''
166 i_time=''
167 i_systime=''
168 d_systimekernel=''
169 i_unistd=''
170 i_utime=''
171 i_sysutime=''
172 lib=''
173 libc=''
174 maildir=''
175 mailhome=''
176 mailer=''
177 mailgrp=''
178 mansrc=''
179 catmansrc=''
180 manext=''
181 manext_choice=''
182 catmanext=''
183 catmanext_choice=''
184 packed=''
185 manroff=''
186 manroffopts=''
187 suffix=''
188 packer=''
189 models=''
190 split=''
191 small=''
192 medium=''
193 large=''
194 huge=''
195 optimize=''
196 ccflags=''
197 cppflags=''
198 ldflags=''
199 cc=''
200 libs=''
201 nametype=''
202 d_passnames=''
203 d_berknames=''
204 d_usgnames=''
205 d_rcpthdr=''
206 rcpthdr='none'
207 passcat=''
208 roff=''
209 roffopts=''
210 sigtype=''
211 spitshell=''
212 shsharp=''
213 sharpbang=''
214 tzname_handling=''
215 use_pmake=''
216 xencf=''
217 xenlf=''
218 d_xenix=''
219 d_bsd=''
220 CONFIG=''
221 : set package name
222 package=filter
223
224 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
225 # Elm 2
226 #
227 echo " "
228 echo "Beginning of configuration questions for $package kit."
229 : Eunice requires " " instead of "", can you believe it
230 echo " "
231
232 define='define'
233 undef='undef'
234 : change the next line if compiling for Xenix/286 on Xenix/386
235 xlibpth='/usr/lib/386 /lib/386 /lib'
236 libpth='/usr/lib /usr/ccs/lib /usr/local/lib /usr/lib/large /lib '$xlibpth' /lib/large /usr/lib/small /lib/small'
237 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
238 rmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
239 trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
240
241 : We must find out about Eunice early
242 eunicefix=':'
243 if test -f /etc/unixtovms; then
244 eunicefix=/etc/unixtovms
245 fi
246 if test -f /etc/unixtovms.exe; then
247 eunicefix=/etc/unixtovms.exe
248 fi
249
250 : Now test for existence of everything in MANIFEST
251
252 echo "First let's make sure your kit is complete. Checking..."
253 awk '$1 !~ /PACKINGLIST/ {print $1}' ../MANIFEST | split -100
254 rm -f missing
255 for filelist in x??; do
256 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
257 done
258 if test -s missing; then
259 cat missing
260 kill $$
261 fi
262 echo "Looks good..."
263
264 : Do one time items.....
265
266 for file in OneTime.PL* ; do
267 if test -f "$file" ; then
268 echo "Executing patch cleanup script $file . . ."
269 . ./$file
270 fi
271 done
272 d_newshome="/usr/NeWS"
273 defvoidused=7
274 attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
275 attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
276 attrlist="$attrlist hpux hp9000s300 hp9000s500 hp9000s800"
277 attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
278 attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
279 attrlist="$attrlist $mc68k __STDC__ UTS M_I8086 M_I186 M_I286 M_I386"
280 attrlist="$attrlist i186 __m88k__ m88k DGUX __DGUX__ NeXT _AIX ultrix"
281 pth="/bin /usr/bin /usr/ucb /sbin /usr/sbin /usr/local /usr/local/bin /usr/lbin"
282 pth="$pth /usr/5bin /vol/local/bin /etc /usr/bsd /usr/lib /usr/ccs/lib /usr/ccs/bin /lib"
283 pth="$pth /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb"
284 pth="$pth /usr/convex /usr/mmdf/bin /usr/mmdf/lib /usr/lib/mail"
285 pth="$pth ${BSDBASE-/bsd}/usr/ucb ${BSDBASE-/bsd}/bin ${BSDBASE-/bsd}/usr/bin"
286 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
287 # Elm 2
288 #
289
290 : check for out bin directory
291 if test ! -d ../bin; then
292 echo "Making bin directory"
293 mkdir ../bin
294 else
295 echo "Found bin directory"
296 fi
297
298 libswanted="intl nls"
299 attrlist="$attrlist sgi"
300
301 : some greps do not return status, grrr.
302 echo "grimblepritz" >grimble
303 if grep blurfldyick grimble >/dev/null 2>&1 ; then
304 contains=contains
305 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
306 contains=grep
307 else
308 contains=contains
309 fi
310 rm -f grimble
311 : the following should work in any shell
312 case "$contains" in
313 contains*)
314 echo " "
315 echo "AGH! Grep doesn't return a status. Attempting remedial action."
316 cat >contains <<'EOSS'
317 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
318 EOSS
319 chmod +x contains
320 esac
321
322 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
323 # Elm 2
324 #
325 : see if sh knows # comments
326 echo " "
327 echo "Checking your sh to see if it knows about # comments..."
328 if sh -c '#' >/dev/null 2>&1 ; then
329 echo "Your sh handles # comments correctly."
330 shsharp=true
331 spitshell=cat
332 echo " "
333 echo "Okay, let's see if #! works on this system..."
334 e=/bin/echo; test -f $e || e=/usr/bin/echo
335 echo "#!$e hi" > try
336 $eunicefix try
337 chmod +x try
338 ./try > today
339 if $contains hi today >/dev/null 2>&1; then
340 echo "It does."
341 sharpbang='#!'
342 else
343 echo "#! $e hi" > try
344 $eunicefix try
345 chmod +x try
346 ./try > today
347 if test -s today; then
348 echo "It does."
349 sharpbang='#! '
350 else
351 echo "It doesn't."
352 sharpbang=': use '
353 fi
354 fi
355 else
356 echo "Your sh doesn't grok # comments--I will strip them later on."
357 shsharp=false
358 echo "exec grep -v '^#'" >spitshell
359 chmod +x spitshell
360 $eunicefix spitshell
361 spitshell=`pwd`/spitshell
362 echo "I presume that if # doesn't work, #! won't work either!"
363 sharpbang=': use '
364 fi
365
366 : figure out how to guarantee sh startup
367 echo " "
368 echo "Checking out how to guarantee sh startup..."
369 startsh=$sharpbang'/bin/sh'
370 echo "Let's see if '$startsh' works..."
371 cat >try <<EOSS
372 $startsh
373 set abc
374 test "$?abc" != 1
375 EOSS
376
377 chmod +x try
378 $eunicefix try
379 if ./try; then
380 echo "Yup, it does."
381 else
382 echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
383 fi
384 rm -f try today
385
386 : first determine how to suppress newline on echo command
387 echo "Checking echo to see how to suppress newlines..."
388 (echo "hi there\c" ; echo " ") >.echotmp
389 if $contains c .echotmp >/dev/null 2>&1 ; then
390 echo "...using -n."
391 n='-n'
392 c=''
393 else
394 cat <<'EOM'
395 ...using \c
396 EOM
397 n=''
398 c='\c'
399 fi
400 rm -f .echotmp
401
•402 #We want things fully automated
403 #echo $n "Type carriage return to continue. Your cursor should be here-->$c"
404 #read ans
405
406 : now set up to do reads with possible shell escape and default assignment
407 cat <<EOSC >myread
408 case "\$fastread" in
409 yes) ans=''; echo " " ;;
410 *) ans='!';;
411 esac
412 while expr "X\$ans" : "X!" >/dev/null; do
413 read ans
414 case "\$ans" in
415 !)
416 sh
417 echo " "
418 echo $n "\$rp $c"
419 ;;
420 !*)
421 set \`expr "X\$ans" : "X!\(.*\)\$"\`
422 sh -c "\$*"
423 echo " "
424 echo $n "\$rp $c"
425 ;;
426 esac
427 done
428 rp='Your answer:'
429 case "\$ans" in
430 '') ans="\$dflt";;
431 esac
432 EOSC
433
434 # Revision 1.1.1.1 1995/04/13 19:38:53 wfp5p
435 # Elm 2
436 #
437 : general instructions
438 cat <<EOH
439
440 This installation shell script will examine your system and ask you questions
441 to determine how the $package package should be installed. If you get stuck
442 on a question, you may use a ! shell escape to start a subshell or execute
443 a command. Many of the questions will have default answers in square
444 brackets--typing carriage return will give you the default.
445
446 On some of the questions which ask for file or directory names you are
447 allowed to use the ~name construct to specify the login directory belonging
448 to "name", even if you don't have a shell which knows about that. Questions
449 where this is allowed will be marked "(~name ok)".
450
451 EOH
452 rp="[Type carriage return to continue]"
453 echo $n "$rp $c"
454 . myread
455 cat <<EOH
456
457 Much effort has been expended to ensure that this shell script will run
458 on any Unix system. If despite that it blows up on you, your best bet is
459 to edit Configure and run it again. Also, let the Elm Development Group
460 ([email protected]) know how they blew it. If you can't run Configure for
461 some reason, you'll have to generate a config.sh file by hand.
462
463 This installation script affects things in two ways: 1) it may do direct
464 variable substitutions on some of the files included in this kit, and
465 2) it builds a config.h file for inclusion in C programs. You may edit
466 any of these files as the need arises after running this script.
467
468 If you make a mistake on a question, there is no easy way to back up to it
469 currently. The easiest thing to do is to edit config.sh and rerun all the
470 SH files. Configure will offer to let you do this before it runs the SH files.
471
472 EOH
473 rp="[Type carriage return to continue]"
474 echo $n "$rp $c"
475 . myread
476
477 : get old answers, if there is a config file out there
478 if test -f ../config.sh; then
479 echo " "
480 dflt=y
481 rp="I see a config.sh file. Did Configure make it on THIS system? [$dflt]"
482 echo $n "$rp $c"
483 . myread
484 case "$ans" in
485 n*) echo "OK, I'll ignore it.";;
486 *) echo "Fetching default answers from your old config.sh file..."
487 tmp="$n"
488 ans="$c"
489 . ../config.sh
490 n="$tmp"
491 c="$ans"
492 ;;
493 esac
494 fi
495
496 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
497 # Elm 2
498 #
499 : find out where common programs are
500 echo " "
501 echo "Locating common programs..."
502 cat <<EOSC >loc
503 $startsh
504 case \$# in
505 0) exit 1;;
506 esac
507 thing=\$1
508 shift
509 dflt=\$1
510 shift
511 for dir in \$*; do
512 case "\$thing" in
513 .)
514 if test -d \$dir/\$thing; then
515 echo \$dir
516 exit 0
517 fi
518 ;;
519 *)
520 if test -f \$dir/\$thing; then
521 echo \$dir/\$thing
522 exit 0
523 elif test -f \$dir/\$thing.exe; then
524 : on Eunice apparently
525 echo \$dir/\$thing
526 exit 0
527 fi
528 ;;
529 esac
530 done
531 echo \$dflt
532 exit 1
533 EOSC
534 chmod +x loc
535 $eunicefix loc
536 loclist="
537 cat
538 chgrp
539 chmod
540 cp
541 echo
542 expr
543 grep
544 ln
545 ls
546 make
547 mv
548 rm
549 sed
550 touch
551 tr
552 "
553 trylist="
554 Mcc
555 compress
556 cpp
557 execmail
558 line
559 lint
560 mips
561 nroff
562 pack
563 pmake
564 rmail
565 sendmail
566 smail
567 submit
568 tbl
569 test
570 troff
571 uname
572 uuname
573 "
574 for file in $loclist; do
575 xxx=`loc $file $file $pth`
576 eval $file=$xxx
577 eval _$file=$xxx
578 case "$xxx" in
579 /*)
580 echo $file is in $xxx.
581 ;;
582 *)
583 echo "I don't know where $file is. I hope it's in everyone's PATH."
584 ;;
585 esac
586 done
587 echo " "
588 echo "Don't worry if any of the following aren't found..."
589 ans=offhand
590 for file in $trylist; do
591 xxx=`loc $file $file $pth`
592 eval $file=$xxx
593 eval _$file=$xxx
594 case "$xxx" in
595 /*)
596 echo $file is in $xxx.
597 ;;
598 *)
599 echo "I don't see $file out there, $ans."
600 ans=either
601 ;;
602 esac
603 done
604 case "$egrep" in
605 egrep)
606 echo "Substituting grep for egrep."
607 egrep=$grep
608 ;;
609 esac
610 case "$test" in
611 test)
612 echo "Hopefully test is built into your sh."
613 ;;
614 /bin/test)
615 if sh -c "PATH= test true" >/dev/null 2>&1; then
616 echo "Using the test built into your sh."
617 test=test
618 fi
619 ;;
620 *)
621 test=test
622 ;;
623 esac
624 case "$echo" in
625 echo)
626 echo "Hopefully echo is built into your sh."
627 ;;
628 /bin/echo)
629 echo " "
630 echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
631 $echo $n "hi there$c" >foo1
632 echo $n "hi there$c" >foo2
633 if cmp foo1 foo2 >/dev/null 2>&1; then
634 echo "They are compatible. In fact, they may be identical."
635 else
636 case "$n" in
637 '-n') n='' c='\c' ans='\c' ;;
638 *) n='-n' c='' ans='-n' ;;
639 esac
640 cat <<FOO
641 They are not compatible! You are probably running ksh on a non-USG system.
642 I'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
643 have echo built in and we may have to run some Bourne shell scripts. That
644 means I'll have to use $ans to suppress newlines now. Life is ridiculous.
645
646 FOO
647 rp="Your cursor should be here-->"
648 $echo $n "$rp$c"
649 . myread
650 fi
651 rm -f foo1 foo2
652 ;;
653 *)
654 : cross your fingers
655 echo=echo
656 ;;
657 esac
658 rmlist="$rmlist loc"
659
660 : set up shell script to do ~ expansion
661 cat >filexp <<EOSS
662 $startsh
663 : expand filename
664 case "\$1" in
665 ~/*|~)
666 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
667 ;;
668 ~*)
669 if $test -f /bin/csh; then
670 /bin/csh -f -c "glob \$1"
671 echo ""
672 else
673 name=\`$expr x\$1 : '..\([^/]*\)'\`
674 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
675 if $test ! -d "\$dir"; then
676 me=\`basename \$0\`
677 echo "\$me: can't locate home directory for: \$name" >&2
678 exit 1
679 fi
680 case "\$1" in
681 */*)
682 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
683 ;;
684 *)
685 echo \$dir
686 ;;
687 esac
688 fi
689 ;;
690 *)
691 echo \$1
692 ;;
693 esac
694 EOSS
695 chmod +x filexp
696 $eunicefix filexp
697
698 : determine where public executables go
699 case "$bin" in
700 '')
701 dflt=`loc . /bin /usr/local/bin /usr/local /usr/lbin /usr/bin`
702 ;;
703 *) dflt="$bin"
704 ;;
705 esac
706 cont=true
707 while $test "$cont" ; do
708 echo " "
709 rp="Where do you want to put the public executables? [$dflt]"
710 $echo $n "$rp $c"
711 . myread
712 bin="$ans"
713 bin=`filexp $bin`
714 if test -d $bin; then
715 cont=''
716 else
717 case "$fastread" in
718 yes) dflt=y;;
719 *) dflt=n;;
720 esac
721 rp="Directory $bin doesn't exist. Use that name anyway? [$dflt]"
722 $echo $n "$rp $c"
723 . myread
724 dflt=''
725 case "$ans" in
726 y*) cont='';;
727 esac
728 fi
729 done
730
731 # Revision 1.1.1.1 1995/04/13 19:38:53 wfp5p
732 # Elm 2
733 #
734 : make some quick guesses about what we are up against
735 echo " "
736 $echo $n "Hmm... $c"
737 if $test -f "$uname"; then
738 uname_os=`$uname -s`
739 uname_rel=`$uname -r`
740 uname_rel=`expr "$uname_rel" : "\(...\).*"`
741 else
742 uname_os=unknown
743 uname_rel=unknown
744 fi
745 cat /usr/include/signal.h /usr/include/sys/signal.h >foo
746 if test `echo abc | tr a-z A-Z` = Abc ; then
747 echo "Looks kind of like a USG system, but we'll see..."
748 echo exit 1 >bsd
749 echo exit 0 >usg
750 echo exit 1 >v7
751 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
752 if $test "(" "$uname_os" = "SunOS" -a "$uname_rel" = "4.1" ")" ; then
753 echo "Looks like SunOs 4.1, a USG system, but we'll see..."
754 echo exit 1 >bsd
755 echo exit 0 >usg
756 echo exit 1 >v7
757 elif $test "$uname_os" = "OSF1" ; then
758 echo "Looks like an OSF/1 system, but we'll see.."
759 echo exit 1 >bsd
760 echo exit 1 >usg
761 echo exit 1 >v7
762 elif $test "$uname_os" = "HP-UX" ; then
763 echo "Looks like an HP-UX system, but we'll see.."
764 echo exit 1 >bsd
765 echo exit 0 >usg
766 echo exit 1 >v7
767 else
768 echo "Looks kind of like a BSD system, but we'll see..."
769 echo exit 0 >bsd
770 echo exit 1 >usg
771 echo exit 1 >v7
772 fi
773 else
774 echo "Looks kind of like a version 7 system, but we'll see..."
775 echo exit 1 >bsd
776 echo exit 1 >usg
777 echo exit 0 >v7
778 fi
779 case "$eunicefix" in
780 *unixtovms*)
781 cat <<'EOI'
782 There is, however, a strange, musty smell in the air that reminds me of
783 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
784 EOI
785 echo "exit 0" >eunice
786 d_eunice="$define"
787 ;;
788 *)
789 echo " "
790 echo "Congratulations. You aren't running Eunice."
791 d_eunice="$undef"
792 echo "exit 1" >eunice
793 ;;
794 esac
795 if test -f /xenix; then
796 echo "Actually, this looks more like a XENIX system..."
797 echo "exit 0" >xenix
798 else
799 echo " "
800 echo "It's not Xenix..."
801 echo "exit 1" >xenix
802 fi
803 chmod +x xenix
804 $eunicefix xenix
805 if test -f /venix; then
806 echo "Actually, this looks more like a VENIX system..."
807 echo "exit 0" >venix
808 else
809 echo " "
810 if xenix; then
811 : null
812 else
813 echo "Nor is it Venix..."
814 fi
815 echo "exit 1" >venix
816 fi
817 chmod +x bsd usg v7 eunice venix
818 $eunicefix bsd usg v7 eunice venix
819 $rm -rf foo
820 rmlist="$rmlist bsd usg v7 eunice venix xenix"
821
822 if $test "(" "$uname_os" = "SunOS" ")" ; then
823 if $test "(" ! "$uname_rel" = "4.1" ")" ; then
824 echo "I'm guessing this is Solaris"
825 is_solaris="y"
826 fi
827 fi
828 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
829 # Elm 2
830 #
831 # determine text processor to use, default to troff if found.
832 case "$roff" in
833 '')
834 if $test -n "$troff"; then
835 dflt="$troff"
836 else
837 dflt=$nroff
838 fi
839 ;;
840 *) dflt="$roff";;
841 esac
842 $cat <<EOM
843
844 The Filter documentation is set up for troff. If you only have nroff, it can
845 be used, but the documentation will not be as readable. If you use an alternate
846 processor for troff/nroff documents it can be specified here. Filter expects
847 the text processor to write to standard out. You will be given a chance to
848 provide command line options to this command in the next question.
849
850 EOM
851 cont=true
852 while $test "$cont" ; do
853 echo " "
854 echo "Give the name of the program used to format the Filter documentation on"
855 $echo $n "your system: [$dflt] $c"
856 rp="Preferred Filter documentation formatter program: [$dflt]"
857 . myread
858 roff=$ans;
859 if $test -f "$ans"; then
860 cont=''
861 else
862 lookup=`loc "$ans" "" . $pth`
863 if $test -f "$lookup"; then
864 cont=''
865 roff=$lookup
866 else
867 if $test "$fastread" = yes; then
868 dflt=y
869 else
870 dflt=n
871 fi
872 echo "Text processor $ans doesn't exist."
873 rp="Use that name anyway? [$dflt]"
874 $echo $n "$rp $c"
875 . myread
876 dflt=''
877 case "$ans" in
878 y*) cont='';;
879 esac
880 fi
881 fi
882 done
883
884 # determine text processor flags to use.
885 $cat <<EOM
886
887 If this text processor requires any options for proper formatting, specify
888 them here. To specify no options, enter the word "none". Some versions
889 of troff require the -t option to write to standard out. This is the
890 proper place to specify that option.
891
892 EOM
893 dflt="$roffopts"
894 rp="What options should Filter use with $roff: [$dflt]"
895 $echo $n "$rp $c"
896 . myread
897 roffopts=$ans
898 case "$roffopts" in
899 'none') roffopts=''
900 ;;
901 esac
902
903 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
904 # Elm 2
905 #
906 : determine where manual pages go
907 $cat <<EOM
908
909 $package has manual pages that can be installed in unformatted or formatted form.
910 Either or both (or neither) of these may be installed.
911
912 Please give the location in which to store each type of man page.
913 To specify that a particular type is not to be installed, answer "none"
914 to the question.
915
916 EOM
917 case "$mansrc" in
918 '')
919 dflt="/usr/local/man/mann /usr/local/man/man1"
920 dflt="$dflt /usr/man/mann /usr/man/manl /usr/man/man.L"
921 dflt="$dflt /usr/man/l_man/man1"
922 dflt="$dflt /usr/local/man/u_man/man1"
923 dflt="$dflt /usr/local/man/l_man/man1 /usr/man/man1 /usr/man/u_man/man1"
924 dflt="$dflt /usr/share/man/man1 /usr/share/man/manl"
925 dflt=`loc . none $dflt`
926 ;;
927 *) dflt="$mansrc"
928 ;;
929 esac
930 cont=true
931 while $test "$cont" ; do
932 echo " "
933 rp="Where do the unformatted manual pages go? [$dflt]"
934 $echo $n "$rp $c"
935 . myread
936 mansrc=`filexp "$ans"`
937 if $test "$mansrc" = none -o -d "$mansrc"; then
938 cont=''
939 else
940 if $test "$fastread" = yes; then
941 dflt=y
942 else
943 dflt=n
944 fi
945 rp="Directory $mansrc doesn't exist. Use that name anyway? [$dflt]"
946 $echo $n "$rp $c"
947 . myread
948 dflt=''
949 case "$ans" in
950 y*) cont='';;
951 esac
952 fi
953 done
954
955 # determine the extension for man pages
956 if $test "$mansrc" != none ; then
957 case "$manext" in
958 '')
959 if $test "$manext_choice" = none; then
960 dflt=none
961 else
962 case "$mansrc" in
963 *l) dflt=.l ;;
964 *n) dflt=.n ;;
965 *L) dflt=.L ;;
966 *) dflt=.1 ;;
967 esac
968 fi
969 ;;
970 .*) dflt="$manext";;
971 *) dflt=".$manext";;
972 esac
973
974 $cat <<EOM
975
976 The installed unformatted manual pages can have various extensions to suit the
977 conventions of the host operating system, for example "page.1".
978
979 Note that the period '.' must be included as part of the extension.
980
981 To specify no extension, enter the word "none".
982
983 EOM
984 rp="What extension should be used on installed unformatted man pages: [$dflt]"
985 $echo $n "$rp $c"
986 . myread
987 manext=$ans
988 manext_choice=$ans
989 case "$manext" in
990 'none')
991 manext=''
992 ;;
993 esac
994 fi
995
996 # Now the formatted man pages ala System V
997 case "$catmansrc" in
998 '')
999 dflt="/usr/man/catn /usr/man/catl /usr/catman/man.L /usr/catman/local/man1"
1000 dflt="$dflt /usr/local/catman/u_man/man1 /usr/local/catman/l_man/man1"
1001 dflt="$dflt /usr/catman/l_man/man1 /usr/man/cat1 /usr/catman/man1"
1002 dflt="$dflt /usr/catman/u_man/man1 /usr/catman/URM/g1"
1003 dflt="$dflt /usr/share/man/cat1 /usr/share/man/catl"
1004 dflt=`loc . none $dflt`
1005 ;;
1006 *) dflt="$catmansrc"
1007 ;;
1008 esac
1009 cont=true
1010 while $test "$cont" ; do
1011 echo " "
1012 rp="Where do the formatted manual pages go? [$dflt]"
1013 $echo $n "$rp $c"
1014 . myread
1015 catmansrc=`filexp "$ans"`
1016 if $test "$catmansrc" = none -o -d "$catmansrc"; then
1017 cont=''
1018 else
1019 if $test "$fastread" = yes; then
1020 dflt=y
1021 else
1022 dflt=n
1023 fi
1024 rp="Directory $catmansrc doesn't exist. Use that name anyway? [$dflt]"
1025 $echo $n "$rp $c"
1026 . myread
1027 dflt=''
1028 case "$ans" in
1029 y*) cont='';;
1030 esac
1031 fi
1032 done
1033
1034 # if installing formatted manual pages, determine a number of other things.
1035 if $test "$catmansrc" != none ; then
1036 # determine text processor to use, default to nroff if found.
1037 case "$manroff" in
1038 '')
1039 if $test -n "$nroff"; then
1040 dflt="$nroff"
1041 else
1042 dflt=$troff
1043 fi
1044 ;;
1045 *) dflt="$manroff";;
1046 esac
1047 $cat <<EOM
1048
1049 Online manual pages are generally formatted with nroff. If you use an
1050 alternate text processor for on-line manual pages it can be specified here.
1051 Filter expects the text processor to write to standard out.
1052
1053 Note: This does not effect the formatter previously chosen for the Filter
1054 documentation.
1055
1056 EOM
1057 cont=true
1058 while $test "$cont" ; do
1059 echo " "
1060 echo "Give the name of the program used to format on-line manual pages"
1061 $echo $n "on your system: [$dflt] $c"
1062 rp="Preferred manual page formatter: [$dflt]"
1063 . myread
1064 manroff=$ans;
1065 if $test -f "$ans"; then
1066 cont=''
1067 else
1068 lookup=`loc "$ans" "" . $pth`
1069 if $test -f "$lookup"; then
1070 cont=''
1071 manroff=$lookup
1072 else
1073 if $test "$fastread" = yes; then
1074 dflt=y
1075 else
1076 dflt=n
1077 fi
1078 echo "Text processor $ans doesn't exist."
1079 rp="Use that name anyway? [$dflt]"
1080 $echo $n "$rp $c"
1081 . myread
1082 dflt=''
1083 case "$ans" in
1084 y*) cont='';;
1085 esac
1086 fi
1087 fi
1088 done
1089
1090 # determine text processor flags to use.
1091 $cat <<EOM
1092
1093 If this text processor requires any options for proper formatting, specify
1094 then here. To specify no options, enter the word "none".
1095
1096 EOM
1097 dflt="$manroffopts"
1098 rp="What options should Filter use with $manroff: [$dflt]"
1099 $echo $n "$rp $c"
1100 . myread
1101 manroffopts=$ans
1102 case "$manroffopts" in
1103 'none') manroffopts=''
1104 ;;
1105 esac
1106
1107 # determine the extension for catman pages
1108 case "$catmanext" in
1109 '')
1110 if $test "$catmanext_choice" = none; then
1111 dflt=none
1112 else
1113 case "$manext" in
1114 .*) dflt=$manext ;;
1115 *)
1116 if $test "$manext_choice" = none; then
1117 dflt=none
1118 else
1119 case "$catmansrc" in
1120 *l) dflt=.l ;;
1121 *n) dflt=.n ;;
1122 *L) dflt=.L ;;
1123 *g1) dflt=none ;;
1124 *) dflt=.1 ;;
1125 esac
1126 fi
1127 esac
1128 fi
1129 ;;
1130 .*) dflt="$catmanext";;
1131 *) dflt=".$catmanext";;
1132 esac
1133
1134 $cat <<EOM
1135
1136 The installed formatted manual pages can have various extensions to suit the
1137 conventions of the host operating system, for example "page.1".
1138
1139 Note that the period '.' must be included as part of the extension.
1140
1141 To specify no extension, enter the word "none".
1142
1143 EOM
1144 rp="What extension should be used on installed formatted man pages: [$dflt]"
1145 $echo $n "$rp $c"
1146 . myread
1147 catmanext=$ans
1148 catmanext_choice=$ans
1149 case "$catmanext" in
1150 'none')
1151 catmanext=''
1152 ;;
1153 esac
1154
1155 if $test -f $pack -o -f $compress ; then
1156 # See if the formatted manual pages are to be packed or compressed
1157 if $test -f $pack; then
1158 $cat <<EOM
1159
1160 The formatted manual pages may be packed (.z suffix) or compressed (.Z
1161 suffix) or left unpacked on your system. The next two questions will deal
1162 with how you want the formatted manual pages installed. Answering no to
1163 both packed and compressed will leave them unpacked. Only one of packed
1164 or compressed can be chosen.
1165
1166 EOM
1167 case "$suffix" in
1168 .Z) dflt=n;;
1169 .z) dflt=y;;
1170 *) if [ "$catmansrc/*.z" != "`$echo $catmansrc/*.z`" ]; then
1171 dflt=y
1172 else
1173 dflt=n
1174 fi ;;
1175 esac
1176 rp="Should the formatted manual pages be packed? [$dflt]"
1177 $echo $n "$rp $c"
1178 . myread
1179 case "$ans" in
1180 y*) packed=y
1181 suffix=.z
1182 packer="$pack -f" ;;
1183 *) packed=n ;;
1184 esac
1185 fi
1186
1187 if $test -f $compress -a "$suffix" != ".z" ; then
1188 case "$suffix" in
1189 .z) dflt=n;;
1190 .Z) dflt=y;;
1191 *) if [ "$catmansrc/*.Z" != "`$echo $catmansrc/*.Z`" ]; then
1192 dflt=y
1193 else
1194 dflt=n
1195 fi ;;
1196 esac
1197 rp="Should the formatted manual pages be compressed? [$dflt]"
1198 $echo $n "$rp $c"
1199 . myread
1200 case "$ans" in
1201 y*) packed=y
1202 suffix=.Z
1203 packer="$compress" ;;
1204 *) packed=n ;;
1205 esac
1206 fi
1207
1208 if $test "$packed" = 'n' ; then
1209 suffix=''
1210 packer=''
1211 fi
1212 else
1213 packed=''
1214 suffix=''
1215 packer=''
1216 fi
1217
1218 fi
1219
1220 # Revision 1.1.1.1 1995/04/13 19:38:56 wfp5p
1221 # Elm 2
1222 #
1223 : default clear to no extra flags
1224 xencf=
1225 xenlf=
1226 d_xenix="$undef"
1227 d_bsd="$undef"
1228 : see if we are xenix
1229 if xenix; then
1230 d_xenix="$define"
1231 : now are we a 286
1232 case "`$uname -p`" in
1233 i80286)
1234 xencf="-LARGE -Ml2et32"
1235 xenlf="-Ml2t32 -F 5600 -SEG 512"
1236 esac
1237 fi
1238 if bsd; then
1239 d_bsd="$define"
1240 fi
1241
1242 : see if we have to deal with yellow pages, if so, put sun
1243 : library first, as the yp password routines must override
1244 : the c library ones
1245 if $test -d /usr/etc/yp || $test -d /etc/yp; then
1246 if $test "$passcat" = "ypcat passwd"; then
1247 dflt=y
1248 elif $contains '^\+:' /etc/passwd; then
1249 dflt=y
1250 else
1251 dflt=n
1252 fi
1253 rp="Are you getting the passwd file via yellow pages? [$dflt]"
1254 $echo $n "$rp $c"
1255 . myread
1256 case "$ans" in
1257 y*) passcat='ypcat passwd'
1258 case "$libswanted" in
1259 '') libswanted='sun c_s';;
1260 *) libswanted=`$echo "$libswanted" | $sed -e 's/sun //g'`
1261 libswanted="sun $libswanted";;
1262 esac
1263 ;;
1264 *) passcat='cat /etc/passwd';;
1265 esac
1266 else
1267 passcat='cat /etc/passwd'
1268 fi
1269
1270 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
1271 # Elm 2
1272 #
1273 : see what memory models we can support
1274 case "$models" in
1275 '')
1276 : We may not use Cppsym or we get a circular dependency through cc.
1277 : But this should work regardless of which cc we eventually use.
1278 cat >pdp11.c <<'EOP'
1279 main() {
1280 #ifdef pdp11
1281 exit(0);
1282 #else
1283 exit(1);
1284 #endif
1285 }
1286 EOP
1287 cc -o pdp11 pdp11.c >/dev/null 2>&1
1288 if pdp11 2>/dev/null; then
1289 dflt='unsplit split'
1290 else
1291 ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
1292 case "$ans" in
1293 X) dflt='none';;
1294 *) if $test -d /lib/small || $test -d /usr/lib/small; then
1295 dflt='small'
1296 else
1297 dflt=''
1298 fi
1299 if $test -d /lib/medium || $test -d /usr/lib/medium; then
1300 dflt="$dflt medium"
1301 fi
1302 if $test -d /lib/large || $test -d /usr/lib/large; then
1303 dflt="$dflt large"
1304 fi
1305 if $test -d /lib/huge || $test -d /usr/lib/huge; then
1306 dflt="$dflt huge"
1307 fi
1308 esac
1309 fi
1310 ;;
1311 *) dflt="$models" ;;
1312 esac
1313 if $test -z "$xencf" ; then
1314 $cat <<EOM
1315
1316 Some systems have different model sizes. On most systems they are called
1317 small, medium, large, and huge. On the PDP11 they are called unsplit and
1318 split. If your system doesn't support different memory models, say "none".
1319 If you wish to force everything to one memory model, say "none" here and
1320 put the appropriate flags later when it asks you for other cc and ld flags.
1321 Xenix and Venix systems may wish to put "none" and let the compiler figure
1322 things out.
1323 (In the following question multiple model names should be space separated.)
1324
1325 EOM
1326 rp="Which models are supported? [$dflt]"
1327 $echo $n "$rp $c"
1328 . myread
1329 models="$ans"
1330
1331 case "$models" in
1332 none)
1333 small=''
1334 medium=''
1335 large=''
1336 huge=''
1337 unsplit=''
1338 split=''
1339 ;;
1340 *split)
1341 case "$split" in
1342 '')
1343 if $contains '\-i' $mansrc/man1/ld.1 >/dev/null 2>&1 || \
1344 $contains '\-i' $mansrc/man1/cc.1 >/dev/null 2>&1; then
1345 dflt='-i'
1346 else
1347 dflt='none'
1348 fi
1349 ;;
1350 *) dflt="$split";;
1351 esac
1352 rp="What flag indicates separate I and D space? [$dflt]"
1353 $echo $n "$rp $c"
1354 . myread
1355 case "$ans" in
1356 none) ans='';;
1357 esac
1358 split="$ans"
1359 unsplit=''
1360 ;;
1361 *large*|*small*|*medium*|*huge*)
1362 case "$models" in
1363 *large*)
1364 case "$large" in
1365 '') dflt='-Ml';;
1366 *) dflt="$large";;
1367 esac
1368 rp="What flag indicates large model? [$dflt]"
1369 $echo $n "$rp $c"
1370 . myread
1371 case "$ans" in
1372 none) ans='';
1373 esac
1374 large="$ans"
1375 ;;
1376 *) large='';;
1377 esac
1378 case "$models" in
1379 *huge*)
1380 case "$huge" in
1381 '') dflt='-Mh';;
1382 *) dflt="$huge";;
1383 esac
1384 rp="What flag indicates huge model? [$dflt]"
1385 $echo $n "$rp $c"
1386 . myread
1387 case "$ans" in
1388 none) ans='';
1389 esac
1390 huge="$ans"
1391 ;;
1392 *) huge="$large";;
1393 esac
1394 case "$models" in
1395 *medium*)
1396 case "$medium" in
1397 '') dflt='-Mm';;
1398 *) dflt="$medium";;
1399 esac
1400 rp="What flag indicates medium model? [$dflt]"
1401 $echo $n "$rp $c"
1402 . myread
1403 case "$ans" in
1404 none) ans='';
1405 esac
1406 medium="$ans"
1407 ;;
1408 *) medium="$large";;
1409 esac
1410 case "$models" in
1411 *small*)
1412 case "$small" in
1413 '') dflt='none';;
1414 *) dflt="$small";;
1415 esac
1416 rp="What flag indicates small model? [$dflt]"
1417 $echo $n "$rp $c"
1418 . myread
1419 case "$ans" in
1420 none) ans='';
1421 esac
1422 small="$ans"
1423 ;;
1424 *) small='';;
1425 esac
1426 ;;
1427 *)
1428 echo "Unrecognized memory models--you may have to edit Makefile.SH"
1429 ;;
1430 esac
1431 fi
1432
1433 : see if we need a special compiler
1434 echo " "
1435 if usg; then
1436 case "$cc" in
1437 '')
1438 case "$Mcc" in
1439 /*) dflt='Mcc'
1440 ;;
1441 *)
1442 case "$large" in
1443 -M*)
1444 dflt='cc'
1445 ;;
1446 *)
1447 if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
1448 dflt='cc -M'
1449 else
1450 dflt='cc'
1451 fi
1452 ;;
1453 esac
1454 ;;
1455 esac
1456 ;;
1457 *) dflt="$cc";;
1458 esac
1459 $cat <<'EOM'
1460
1461 On some systems the default C compiler will not resolve multiple global
1462 references that happen to have the same name. On some such systems the
1463 "Mcc" command may be used to force these to be resolved. On other systems
1464 a "cc -M" command is required. (Note that the -M flag on other systems
1465 indicates a memory model to use!) If you have the Gnu C compiler, you
1466 might wish to use that instead. What command will force resolution on
1467 EOM
1468 $echo $n "this system? [$dflt] $c"
1469 rp="Command to resolve multiple refs? [$dflt]"
1470 . myread
1471 cc="$ans"
1472 else
1473 case "$cc" in
1474 '') dflt=cc;;
1475 *) dflt="$cc";;
1476 esac
1477 rp="Use which C compiler? [$dflt]"
1478 $echo $n "$rp $c"
1479 . myread
1480 cc="$ans"
1481 fi
1482 case "$cc" in
1483 gcc*) cpp=`loc gcc-cpp $cpp $pth`;;
1484 esac
1485
1486 : determine optimize, if desired, or use for debug flag also
1487 case "$optimize" in
1488 ' ') dflt="none"
1489 ;;
1490 '') dflt="-O";
1491 ;;
1492 *) dflt="$optimize"
1493 ;;
1494 esac
1495 cat <<EOH
1496
1497 Some C compilers have problems with their optimizers, by default, $package
1498 compiles with the -O flag to use the optimizer. Alternately, you might
1499 want to use the symbolic debugger, which uses the -g flag (on traditional
1500 UNIX systems). Either flag can be specified here. To use neither flag,
1501 specify the word "none".
1502
1503 EOH
1504 rp="What optimizer/debugger flag should be used? [$dflt]"
1505 $echo $n "$rp $c"
1506 . myread
1507 optimize="$ans"
1508 case "$optimize" in
1509 'none') optimize=" "
1510 ;;
1511 esac
1512
1513 case "$ccflags" in
1514 '') case "$cc" in
1515 *gcc*) dflt='-fpcc-struct-return';;
1516 *) dflt='';;
1517 esac
1518 ;;
1519 *) dflt="$ccflags";;
1520 esac
1521 for thisincl in $inclwanted; do
1522 if test -d $thisincl; then
1523 case "$dflt" in
1524 *$thisincl*);;
1525 *) dflt="$dflt -I$thisincl";;
1526 esac
1527 fi
1528 done
1529 case "$optimize" in
1530 -g*)
1531 case "$dflt" in
1532 *DEBUG*);;
1533 *) dflt="$dflt -DDEBUG";;
1534 esac
1535 ;;
1536 esac
1537 case "$dflt" in
1538 '') dflt=none;;
1539 esac
1540 if $test -n "$xencf" ; then
1541 $echo "Xenix 286 system, using compiler flags $xencf"
1542 $echo "do not respecify these flags below."
1543 $echo ""
1544 fi
1545 cat <<EOH
1546
1547 Your C compiler may want other flags. For this question you should
1548 include -I/whatever and -DWHATEVER flags and any other flags used by
1549 the C compiler, but you should NOT include libraries or ld flags like
1550 -lwhatever. To use no flags, specify the word "none".
1551
1552 EOH
1553 rp="Any additional cc flags? [$dflt]"
1554 $echo $n "$rp $c"
1555 . myread
1556 case "$ans" in
1557 none) ans='';
1558 esac
1559 ccflags="$ans"
1560
1561 : the following weeds options from ccflags that are of no interest to cpp
1562 cppflags="$ccflags"
1563 case "$cc" in
1564 *gcc*) cppflags="$cppflags -D__GNUC__";;
1565 esac
1566 case "$cppflags" in
1567 '');;
1568 *) set X $cppflags
1569 cppflags=''
1570 for flag
1571 do
1572 case $flag in
1573 -D*|-I*|-U*) cppflags="$cppflags $flag";;
1574 esac
1575 done
1576 case "$cppflags" in
1577 *-*) echo "(C preprocessor flags: $cppflags)";;
1578 esac
1579 ;;
1580 esac
1581
1582 if $test -n "$xenlf" ; then
1583 $echo "Xenix 286 system, using linker flags $xenlf"
1584 $echo "do not respecify these flags below"
1585 $echo ""
1586 fi
1587 case "$ldflags" in
1588 '') if venix; then
1589 dflt='-i -z'
1590 else
1591 dflt='none'
1592 fi
1593 ;;
1594 *) dflt="$ldflags";;
1595 esac
1596 cat <<EOH
1597
1598 Your linker/loader may want other flags. For example, you might
1599 want to enable support for the symbolic debugger (-g on traditional
1600 UNIX systems). For this question you should specify those flags.
1601 Do NOT specify libraries (-lwhatever) here. Most systems will not
1602 need any special flags, in which case specify "none".
1603
1604 EOH
1605 rp="Any additional ld flags (NOT including libraries)? [$dflt]"
1606 $echo $n "$rp $c"
1607 . myread
1608 case "$ans" in
1609 none) ans='';
1610 esac
1611 ldflags="$ans"
1612 rmlist="$rmlist pdp11"
1613
1614 echo " "
1615 echo "Checking for optional libraries..."
1616 case "$libs" in
1617 '') dflt='';;
1618 *) dflt="$libs";;
1619 esac
1620 case "$libswanted" in
1621 '') libswanted='c_s';;
1622 esac
1623 for thislib in $libswanted; do
1624 case "$thislib" in
1625 dbm) thatlib=ndbm;;
1626 *_s) thatlib=NONE;;
1627 *) thatlib="${thislib}_s";;
1628 *) thatlib=NONE;;
1629 esac
1630 xxx=`loc lib$thislib.a X /usr/lib /usr/ccs/lib /usr/local/lib /lib`
1631 if test -f $xxx; then
1632 echo "Found -l$thislib."
1633 case "$dflt" in
1634 *-l$thislib*|*-l$thatlib*);;
1635 *) dflt="$dflt -l$thislib";;
1636 esac
1637 else
1638 xxx=`loc lib$thislib.a X $libpth`
1639 if test -f $xxx; then
1640 echo "Found $xxx."
1641 case "$dflt" in
1642 *$xxx*);;
1643 *) dflt="$dflt $xxx";;
1644 esac
1645 else
1646 xxx=`loc Slib$thislib.a X $xlibpth`
1647 if test -f $xxx; then
1648 echo "Found -l$thislib."
1649 case "$dflt" in
1650 *-l$thislib*|*-l$thatlib*);;
1651 *) dflt="$dflt -l$thislib";;
1652 esac
1653 else
1654 echo "No -l$thislib."
1655 fi
1656 fi
1657 fi
1658 done
1659 set X $dflt
1660 shift
1661 dflt="$*"
1662 case "$dflt" in
1663 '') dflt='none';;
1664 esac
1665
1666 $cat <<EOM
1667
1668 Some versions of UNIX support shared libraries, which make
1669 executables smaller but make load time slightly longer.
1670
1671 On some systems, mostly newer UNIX System V's, the shared library
1672 is included by putting the option "-lc_s" as the last thing on the
1673 cc command line when linking. Other systems use shared libraries
1674 by default. There may be other libraries needed to compile $package
1675 on your machine as well. If your system needs the "-lc_s" option,
1676 include it here. Include any other special libraries here as well.
1677 Say "none" for none.
1678 EOM
1679
1680 echo " "
1681 rp="Any additional libraries? [$dflt]"
1682 $echo $n "$rp $c"
1683 . myread
1684 case "$ans" in
1685 none) ans='';
1686 esac
1687 libs="$ans"
1688
1689 : see how we invoke the C preprocessor
1690 echo " "
1691 echo "Now, how can we feed standard input to your C preprocessor..."
1692 cat <<'EOT' >testcpp.c
1693 #define ABC abc
1694 #define XYZ xyz
1695 ABC.XYZ
1696 EOT
1697 echo 'Maybe "'"$cc"' -E" will work...'
1698 $cc -E <testcpp.c >testcpp.out 2>&1
1699 : try to force gcc preprocessor if that is the compiler they are using
1700 case $? in
1701 0) cppstdin="$cc -E";;
1702 *) case "$cc" in
1703 *gcc*)
1704 cd ..
1705 echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
1706 echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
1707 chmod 755 cppstdin
1708 cppstdin=`pwd`/cppstdin
1709 cppminus='';
1710 cd UU
1711 $cppstdin <testcpp.c >testcpp.out 2>&1
1712 ;;
1713 esac
1714 ;;
1715 esac
1716 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1717 echo "Yup, it does."
1718 cppstdin="$cc -E"
1719 cppminus='';
1720 else
1721 echo 'Nope, maybe "'$cpp'" will work...'
1722 $cpp <testcpp.c >testcpp.out 2>&1
1723 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1724 echo "Yup, it does."
1725 cppstdin="$cpp"
1726 cppminus='';
1727 else
1728 echo 'No such luck...maybe "'$cpp' -" will work...'
1729 $cpp - <testcpp.c >testcpp.out 2>&1
1730 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1731 echo "It works!"
1732 cppstdin="$cpp"
1733 cppminus='-';
1734 else
1735 echo 'Nixed again...maybe "'"$cc"' -E -" will work...'
1736 $cc -E - <testcpp.c >testcpp.out 2>&1
1737 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1738 echo "Hooray, it works! I was beginning to wonder."
1739 cppstdin="$cc -E"
1740 cppminus='-';
1741 else
1742 echo 'Nope...maybe "'"$cc"' -P" will work...'
1743 $cc -P <testcpp.c >testcpp.out 2>&1
1744 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1745 echo "Yup, that does."
1746 cppstdin="$cc -P"
1747 cppminus='';
1748 else
1749 echo 'Nope...maybe "'"$cc"' -P -" will work...'
1750 $cc -P - <testcpp.c >testcpp.out 2>&1
1751 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1752 echo "Yup, that does."
1753 cppstdin="$cc -P"
1754 cppminus='-';
1755 else
1756 echo 'Hmm...perhaps you already told me...'
1757 case "$cppstdin" in
1758 '') ;;
1759 *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
1760 esac
1761 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1762 echo "Hooray, you did! I was beginning to wonder."
1763 else
1764 echo 'Uh-uh. Time to get fancy...'
1765 cd ..
1766 echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
1767 echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
1768 chmod 755 cppstdin
1769 cppstdin=`pwd`/cppstdin
1770 cppminus='';
1771 cd UU
1772 $cppstdin <testcpp.c >testcpp.out 2>&1
1773 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1774 echo "Eureka!."
1775 else
1776 dflt=blurfl
1777 $echo $n "No dice. I can't find a C preprocessor. Name one: $c"
1778 rp='Name a C preprocessor:'
1779 . myread
1780 cppstdin="$ans"
1781 $cppstdin <testcpp.c >testcpp.out 2>&1
1782 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1783 echo "OK, that will do."
1784 else
1785 echo "Sorry, I can't get that to work. Go find one."
1786 exit 1
1787 fi
1788 fi
1789 fi
1790 fi
1791 fi
1792 fi
1793 fi
1794 fi
1795 fi
1796 $rm -f testcpp.c testcpp.out
1797
1798 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
1799 # Elm 2
1800 #
1801 : get list of predefined functions in a handy place
1802 echo " "
1803 case "$libc" in
1804 '') if test -d /usr/apollo; then
1805 libc=/lib/libc
1806 else
1807 libc=unknown
1808 fi
1809 ;;
1810 '/lib/libc /lib/clib')
1811 libc=/lib/libc
1812 ;;
1813 esac
1814 case "$mips" in
1815 '') mips=false;;
1816 'mips') mips=false;;
1817 esac
1818 case "$nm_opts" in
1819 '') if test -f /mach_boot; then
1820 nm_opts=''
1821 elif test -d /usr/ccs/lib; then
1822 nm_opts='-p'
1823 elif "$mips"; then
1824 nm_opts='-B'
1825 else
1826 nm_opts=''
1827 fi
1828 ;;
1829 esac
1830 : on mips, we DO NOT want /lib, and we want inclPath/usr/lib
1831 case "$libpth" in
1832 '') if "$mips"; then
1833 libpth='$inclPath/usr/lib /usr/local/lib'
1834 nm_opts='-B'
1835 else
1836 libpth='/usr/ccs/lib /lib /usr/lib /usr/ucblib /usr/local/lib'
1837 fi
1838 ;;
1839 esac
1840 case "$libs" in
1841 *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
1842 esac
1843 libnames='';
1844 case "$libs" in
1845 '') ;;
1846 *) for thislib in $libs; do
1847 case "$thislib" in
1848 -l*) thislib=`expr X$thislib : 'X-l\(.*\)'`
1849 try=`./loc lib$thislib.a blurfl/dyick $libpth`
1850 if test ! -f $try; then
1851 try=`./loc lib$thislib blurfl/dyick $libpth`
1852 if test ! -f $try; then
1853 try=`./loc $thislib blurfl/dyick $libpth`
1854 if test ! -f $try; then
1855 try=`./loc Slib$thislib.a blurfl/dyick $xlibpth`
1856 if test ! -f $try; then
1857 try=''
1858 fi
1859 fi
1860 fi
1861 fi
1862 libnames="$libnames $try"
1863 ;;
1864 *) libnames="$libnames $thislib" ;;
1865 esac
1866 done
1867 ;;
1868 esac
1869 set /usr/ccs/lib/libc.so
1870 test -f $1 || set /usr/lib/libc.so
1871 # workaround for redhat linux/GNU libc.so being a text file not ELF obj.
1872 file $1 | grep text >/dev/null && set /usr/lib/libc.a
1873 test -f $1 || set /usr/lib/libc.so.[0-9]*
1874 test -f $1 || set /lib/libsys_s.a
1875 eval set \$$#
1876 if test -f "$1"; then
1877 echo "Your shared C library is in $1."
1878 libc="$1"
1879 elif test -f "$libc"; then
1880 echo "Your C library is in $libc."
1881 elif test -f /lib/libc.a; then
1882 echo "Your C library is in /lib/libc.a. You're normal."
1883 libc=/lib/libc.a
1884 else
1885 if ans=`./loc libc.a blurfl/dyick $libpth`; test -f "$ans"; then
1886 :
1887 elif ans=`./loc libc blurfl/dyick $libpth`; test -f "$ans"; then
1888 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
1889 elif ans=`./loc clib blurfl/dyick $libpth`; test -f "$ans"; then
1890 :
1891 elif ans=`./loc Slibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
1892 :
1893 elif ans=`./loc Mlibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
1894 :
1895 elif ans=`./loc Llibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
1896 :
1897 fi
1898 if test -f "$ans"; then
1899 echo "Your C library is in $ans, of all places."
1900 libc=$ans
1901 else
1902 cat <<EOM
1903
1904 I can't seem to find your C library. I've looked in the following places:
1905
1906 $libpth
1907
1908 None of these seems to contain your C library. What is the full name
1909 EOM
1910 dflt=None
1911 $echo $n "of your C library? $c"
1912 rp='C library full name?'
1913 . myread
1914 libc="$ans"
1915 fi
1916 fi
1917 echo " "
1918 if test $libc = "/lib/libc"; then
1919 libc="$libc /lib/clib"
1920 fi
1921 set `echo $libc $libnames | tr ' ' '\012' | sort | uniq`
1922 $echo $n "Extracting names from $* for later perusal...$c"
1923 nm $nm_opts $* 2>/dev/null >libc.tmp
1924 $sed -n -e 's/^.* [ATDS] *[_.]*//p' -e 's/^.* [ATDS] //p' <libc.tmp >libc.list
1925 if $contains '^printf$' libc.list >/dev/null 2>&1; then
1926 echo done
1927 elif $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' \
1928 <libc.tmp >libc.list; \
1929 $contains '^printf$' libc.list >/dev/null 2>&1; then
1930 echo done
1931 elif $sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p' <libc.tmp >libc.list; \
1932 $contains '^printf$' libc.list >/dev/null 2>&1; then
1933 echo done
1934 elif $sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list; \
1935 $contains '^printf$' libc.list >/dev/null 2>&1; then
1936 echo done
1937 elif $sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' \
1938 <libc.tmp >libc.list; \
1939 $contains '^printf$' libc.list >/dev/null 2>&1; then
1940 echo done
1941 elif $grep '|' <libc.tmp | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
1942 -e 's/^\([^ ]*\).*/\1/p' >libc.list
1943 $contains '^printf$' libc.list >/dev/null 2>&1; then
1944 echo done
1945 elif $sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p' \
1946 <libc.tmp >libc.list; \
1947 $contains '^printf$' libc.list >/dev/null 2>&1; then
1948 echo done
1949 else
1950 nm -p $* 2>/dev/null >libc.tmp
1951 $sed -n -e 's/^.* [AT] *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list
1952 if $contains '^printf$' libc.list >/dev/null 2>&1; then
1953 nm_opts='-p'
1954 echo "done"
1955 else
1956 echo " "
1957 echo "nm didn't seem to work right."
1958 echo "Trying ar instead..."
1959 if ar t $libc > libc.tmp; then
1960 for thisname in $libnames; do
1961 ar t $thisname >>libc.tmp
1962 done
1963 $sed -e 's/\.o$//' < libc.tmp > libc.list
1964 echo "Ok."
1965 else
1966 echo "ar didn't seem to work right."
1967 echo "Maybe this is a Cray...trying bld instead..."
1968 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
1969 for thisname in $libnames; do
1970 bld t $libnames | \
1971 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
1972 ar t $thisname >>libc.tmp
1973 done
1974 echo "Ok."
1975 else
1976 echo "That didn't work either. Giving up."
1977 exit 1
1978 fi
1979 fi
1980 fi
1981 fi
1982
1983 : old version
1984
1985 inlibc='echo " ";
1986 if $contains "^$1\$" libc.list >/dev/null 2>&1;
1987 then echo "$1() found"; eval "$2=$define";
1988 else echo "$1() not found"; eval "$2=$undef"; fi'
1989
1990 : : new version
1991 :
1992 : inlibc='echo " "; td=$define; tu=$undef;
1993 : if $contains "^$1\$" libc.list >/dev/null 2>&1;
1994 : then echo "$1() found";
1995 : eval "case \"\$$2\" in undef) . whoa; esac"; eval "$2=\$td";
1996 : else echo "$1() not found";
1997 : eval "case \"\$$2\" in define) . whoa; esac"; eval "$2=\$tu"; fi'
1998 :
1999 : rmlist="$rmlist libc.tmp libc.list"
2000 :
2001 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
2002 # Elm 2
2003 #
2004 : get C preprocessor symbols handy
2005 echo " "
2006 echo $attrlist | $tr ' ' '\012' >Cppsym.know
2007 $cat <<EOSS >Cppsym
2008 $startsh
2009 case "\$1" in
2010 -l) list=true
2011 shift
2012 ;;
2013 esac
2014 unknown=''
2015 case "\$list\$#" in
2016 1|2)
2017 for sym
2018 do
2019 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
2020 exit 0
2021 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
2022 :
2023 else
2024 unknown="\$unknown \$sym"
2025 fi
2026 done
2027 set X \$unknown
2028 shift
2029 ;;
2030 esac
2031 case \$# in
2032 0) exit 1;;
2033 esac
2034 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
2035 #ifdef \1\\
2036 exit 0; _ _ _ _\1\\ \1\\
2037 #endif\\
2038 /' >/tmp/Cppsym\$\$
2039 echo exit 1 >>/tmp/Cppsym\$\$
2040 $cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
2041 case "\$list" in
2042 true) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
2043 *)
2044 sh /tmp/Cppsym2\$\$
2045 status=\$?
2046 ;;
2047 esac
2048 $rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
2049 exit \$status
2050 EOSS
2051 chmod +x Cppsym
2052 $eunicefix Cppsym
2053 echo "Your C preprocessor defines the following symbols:"
2054 Cppsym -l $attrlist >Cppsym.true
2055 cat Cppsym.true
2056 rmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
2057
2058 # Revision 1.1.1.1 1995/04/13 19:38:56 wfp5p
2059 # Elm 2
2060 #
2061 : check for broken toupper/tolower
2062 $echo ' '
2063 case "$d_broke_ctype" in
2064 "$define") ;;
2065 "$undef") ;;
2066 *)
2067 $echo "Testing your \"ctype\" conversion routines..."
2068 d_broke_ctype="$define"
2069 $cat >try.c <<'EOF'
2070 #include <stdio.h>
2071 #include <ctype.h>
2072 #define my_tolower(c) (isupper(c) ? (c) - 'A' + 'a' : (c))
2073 #define my_toupper(c) (islower(c) ? (c) - 'a' + 'A' : (c))
2074 main()
2075 {
2076 int i;
2077 for (i = 1 ; i <= 0x7F ; ++i) {
2078 if (my_tolower(i) != tolower(i) || my_toupper(i) != toupper(i))
2079 exit(1);
2080 }
2081 exit(0);
2082 }
2083 EOF
2084 $cc $ccflags -o try try.c >/dev/null 2>&1 \
2085 && ./try >/dev/null 2>&1 && d_broke_ctype="$undef"
2086 rm -f try.c try.o try core
2087 ;;
2088 esac
2089 case "$d_broke_ctype" in
2090 "$define") $echo "Using our own \"ctype\" conversions." ;;
2091 "$undef") $echo "Using standard system \"ctype\" conversions." ;;
2092 esac
2093
2094
2095 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
2096 # Elm 2
2097 #
2098 : check for cuserid function
2099 set cuserid d_cuserid
2100 eval $inlibc
2101
2102 echo " "
2103 if $contains flock libc.list >/dev/null 2>&1; then
2104 echo 'flock() found.'
2105 if $contains EWOULDBLOCK /usr/include/errno.h > /dev/null 2>&1; then
2106 has_flock="$define"
2107 echo 'flock locking available.'
2108 elif $contains EWOULDBLOCK /usr/include/sys/errno.h > /dev/null 2>&1; then
2109 has_flock="$define"
2110 echo 'flock locking available.'
2111 elif $contains EWOULDBLOCK /usr/include/asm/errno.h > /dev/null 2>&1; then
2112 has_flock="$define"
2113 echo 'flock locking available.'
2114 else
2115 has_flock="$undef"
2116 echo 'flock locking not available.'
2117 d_flock="$undef"
2118 fi
2119 else
2120 has_flock="$undef"
2121 d_flock="$undef"
2122 fi
2123
2124 if $contains F_SETLK /usr/include/sys/fcntl.h >/dev/null 2>&1; then
2125 echo 'F_SETLK found, fcntl locking available'
2126 has_fcntl="$define"
2127 elif $contains F_SETLK /usr/include/sys/fcntlcom.h >/dev/null 2>&1; then
2128 echo 'F_SETLK found, fcntl locking available'
2129 has_fcntl="$define"
2130 elif $contains F_SETLK /usr/include/sys/file.h >/dev/null 2>&1; then
2131 echo 'F_SETLK found, fcntl locking available'
2132 has_fcntl="$define"
2133 elif $contains F_SETLK /usr/include/fcntl.h >/dev/null 2>&1; then
2134 echo 'F_SETLK found, fcntl locking available'
2135 has_fcntl="$define"
2136 elif $contains F_SETLK /usr/include/asm/fcntl.h >/dev/null 2>&1; then
2137 echo 'F_SETLK found, fcntl locking available'
2138 has_fcntl="$define"
2139 else
2140 echo 'F_SETLK not found, fcntl locking not available'
2141 has_fcntl="$undef"
2142 d_fcntlock="$undef"
2143 fi
2144
2145 if $test "$has_flock" = "$define" -o "$has_fcntl" = "$define"; then
2146 $cat <<EOM
2147 Mail Transport Agents (sendmail, etc.) and Mail User Agents (Elm) can
2148 use a variety of file locking protocols. Based on your system type,
2149 usage of a network, and MTA/MUAs in use, you may want to configure more
2150 than one of the following Mail Locking Protocols. It is recommended
2151 that you use as many as are possible on your system to avoid problems.
2152 All systems can support the dot locking method (.lock files).
2153
2154 Available locking protocols:
2155 dot locking (.lock)
2156 EOM
2157 if $test "$has_flock" = "$define"; then
2158 echo ' flock style locking'
2159 fi
2160
2161 if $test "$has_fcntl" = "$define"; then
2162 echo ' fcntl style locking'
2163 fi
2164
2165 if $test "$has_flock" = "$define" -a "$has_fcntl" = "$define"; then
2166 $cat <<EOM
2167 On some systems, flock style locking and fcntl style locking use the
2168 same underlying calls so both are not only not necessary, but may
2169 INTERFERE WITH EACH OTHER (so choose only one). On other systems they are
2170 distinct and both should be used. You will have to consult the documentation
2171 for your operating system to determine in which class your system resides.
2172
2173 EOM
2174 fi
2175
2176 case "$d_dotlock" in
2177 "$define") dflt=y;;
2178 "$undef") dflt=n;;
2179 *) dflt=y;;
2180 esac
2181
2182 rp="Would you like to use dot lock style mail spool locking? [$dflt]"
2183 $echo $n "$rp $c"
2184 . myread
2185 case "$ans" in
2186 y*) d_dotlock="$define";;
2187 *) d_dotlock="$undef";;
2188 esac
2189
2190 if $test "$has_flock" = "$define"; then
2191 case "$d_flock" in
2192 "$define") dflt=y;;
2193 "$undef") dflt=n;;
2194 *)
2195 if $test "$is_solaris" = "y" ; then
2196 dflt=n
2197 else
2198 dflt=y
2199 fi
2200 ;;
2201 esac
2202
2203 rp="Would you like to use flock style mail spool locking? [$dflt]"
2204 $echo $n "$rp $c"
2205 . myread
2206 case "$ans" in
2207 y*) d_flock="$define";;
2208 *) d_flock="$undef";;
2209 esac
2210 fi
2211
2212 if $test "$has_fcntl" = "$define"; then
2213 case "$d_fcntlock" in
2214 "$define") dflt=y;;
2215 "$undef") dflt=n;;
2216 *) dflt=y;;
2217 esac
2218
2219 rp="Would you like to use fcntl style mail spool locking? [$dflt]"
2220 $echo $n "$rp $c"
2221 . myread
2222 case "$ans" in
2223 y*) d_fcntlock="$define";;
2224 *) d_fcntlock="$undef";;
2225 esac
2226 fi
2227 else
2228 d_dotlock="$define"
2229 echo 'Dot lock style locking will be used'
2230 fi
2231
2232 if $test -d /usr/spool/locks ; then
2233 lock_dir=/usr/spool/locks
2234 elif $test -d /usr/spool/uucp ; then
2235 lock_dir=/usr/spool/uucp
2236 elif $test -d /var/spool/locks ; then
2237 lock_dir=/var/spool/locks
2238 elif $test -d /var/spool/uucp ; then
2239 lock_dir=/var/spool/uucp
2240 else
2241 lock_dir=/tmp
2242 fi
2243 echo " "
2244 echo "Non-mailbox locks will use the $lock_dir directory"
2245 echo " "
2246
2247 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
2248 # Elm 2
2249 #
2250 : now get the host name
2251 if $test "$autohostname" != "$undef" -o "$hostname" = "" ; then
2252 autohostname="$define"
2253 echo " "
2254 echo "Figuring out host name for forwarding purposes..."
2255 echo 'Maybe "hostname" will work...'
2256 if ans=`sh -c hostname 2>&1` ; then
2257 hostname=$ans
2258 phostname=hostname
2259 else
2260 if xenix; then
2261 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
2262 if ans=`cat /etc/systemid 2>&1` ; then
2263 hostname=$ans
2264 phostname='cat /etc/systemid'
2265 echo "Whadyaknow. Xenix always was a bit strange..."
2266 else
2267 echo 'No, maybe "uuname -l" will work...'
2268 if ans=`sh -c '$uuname -l' 2>&1` ; then
2269 hostname=$ans
2270 phostname='$uuname -l'
2271 else
2272 echo 'Strange. Maybe "uname -n" will work...'
2273 if ans=`sh -c '$uname -n' 2>&1` ; then
2274 hostname=$ans
2275 phostname='$uname -n'
2276 else
2277 echo 'Oh well, maybe I can mine it out of whoami.h...'
2278 if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
2279 hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
2280 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
2281 else
2282 case "$hostname" in
2283 '') echo "Does this machine have an identity crisis or something?"
2284 phostname=''
2285 ;;
2286 *) echo "Well, you said $hostname before...";;
2287 esac
2288 fi
2289 fi
2290 fi
2291 fi
2292 else
2293 if $test -r /etc/systemid ; then
2294 echo "What is a non-Xenix system doing with /etc/systemid?"
2295 fi
2296 echo 'No, maybe "uuname -l" will work...'
2297 if $test -n "$uuname" && ans=`sh -c "$uuname -l" 2>&1` ; then
2298 hostname=$ans
2299 phostname="$uuname -l"
2300 else
2301 echo 'Strange. Maybe "uname -n" will work...'
2302 if $test -n "$uname" && ans=`sh -c "$uname -n" 2>&1` ; then
2303 hostname=$ans
2304 phostname="$uname -n"
2305 else
2306 if ans=`cat /etc/systemid 2>&1` ; then
2307 hostname=$ans
2308 phostname='cat /etc/systemid'
2309 echo "Well, I'll use the systemid file anyway..."
2310 else
2311 echo 'Oh well, maybe I can mine it out of whoami.h...'
2312 if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
2313 hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
2314 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
2315 else
2316 case "$hostname" in
2317 '') echo "Does this machine have an identity crisis or something?"
2318 phostname=''
2319 ;;
2320 *) echo "Well, you said $hostname before...";;
2321 esac
2322 fi
2323 fi
2324 fi
2325 fi
2326 fi
2327 fi
2328 else
2329 echo "Last time you said the hostname was $hostname"
2330 fi
2331 : you do not want to know about this
2332 set $hostname
2333 hostname=$1
2334
2335 : translate upper to lower if necessary
2336 case "$hostname" in
2337 *[A-Z]*)
2338 hostname=`echo $hostname | tr '[A-Z]' '[a-z]'`
2339 echo "(Normalizing case in your host name)"
2340 ;;
2341 esac
2342
2343 : verify guess
2344 if $test "$hostname" ; then
2345 dflt=y
2346 echo 'Your host name appears to be "'$hostname'".'
2347 $echo $n "Is this correct? [$dflt] $c"
2348 rp="Sitename is $hostname? [$dflt]"
2349 . myread
2350 case "$ans" in
2351 y*) ;;
2352 *) hostname='' ;;
2353 esac
2354 fi
2355
2356 : bad guess or no guess
2357 while $test "X$hostname" = X ; do
2358 dflt=''
2359 rp="Please type the (one word) name of your host:"
2360 $echo $n "$rp $c"
2361 . myread
2362 hostname="$ans"
2363 autohostname="$undef"
2364 done
2365
2366 echo " "
2367
2368
2369 : These days, some places do strange things with virtual delivery.
2370 : like shoving all email to a domain into a single mailbox
2371 cat <<EOM
2372
2373 Some sites have a special header, that tells you who an email is "really"
2374 to., eg "Really-To:" or "X-Rcpt-To:".
2375 (In other words, the "envelope" destination).
2376 If you'd like support for this kind of header, enter the header name now.
2377 Or enter "none"
2378
2379 EOM
2380 dflt="$rcpthdr"
2381 $echo $n "Name of Rcpt-To header? [$dflt] $c"
2382 . myread
2383 case $ans in
2384 "")
2385 rcpthdr='none'
2386 ;;
2387 'none')
2388 rcpthdr='none'
2389 ;;
2390 *:)
2391 rcpthdr=$ans
2392 ;;
2393 *)
2394 $echo "Automatically adding expected ':'"
2395 rcpthdr="$ans"":"
2396 ;;
2397 esac
2398
2399 if [ "$rcpthdr" = "none" ] ; then
2400 d_rcpthdr="$undef"
2401 else
2402 d_rcpthdr="$define"
2403 fi
2404
2405 : see if there is a whoami file
2406 echo " "
2407 if $test -r /usr/include/whoami.h ; then
2408 d_whoami="$define"
2409 echo "whoami.h found."
2410 else
2411 d_whoami="$undef"
2412 fi
2413
2414 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
2415 # Elm 2
2416 #
2417 : see how we will look up host name
2418 echo " "
2419 d_douname="$undef"
2420 d_gethname="$undef"
2421
2422 if $contains '^gethostname$' libc.list >/dev/null 2>&1 ; then
2423 echo "gethostname() found."
2424 d_gethname="$define"
2425 ans=gethostname
2426 elif xenix; then
2427 if $test -n "$uname"; then
2428 u_name=`$uname -n`
2429 else
2430 u_name=
2431 fi
2432 if $test -n "$line"; then
2433 if $test -r /etc/systemid; then
2434 s_name=`$line < /etc/systemid`
2435 else
2436 s_name=
2437 fi
2438 else
2439 s_name=
2440 fi
2441 if $test -n "$u_name"; then
2442 if $test "$u_name" = "$s_name"; then
2443 cat <<EOM
2444 On Xenix, UUCP uses the name found in /etc/systemid, while uname()
2445 returns the name compiled into the operating system via configure.
2446 Elm needs the UUCP name, and currently these two match. However, they
2447 need not match. Be sure to always keep these two names in sync.
2448 Since they match, Elm will not consider that the Xenix uname function
2449 is broken. However, if you are not always able to make them
2450 match, answer the compile in hostname question Yes.
2451 EOM
2452 if $contains '^uname$' libc.list >/dev/null 2>&1 ; then
2453 echo "uname() found."
2454 d_douname="$define"
2455 ans=uname
2456 fi
2457 else
2458 cat <<EOM
2459 On Xenix, UUCP uses the name found in /etc/systemid, while uname()
2460 returns the name compiled into the operating system via configure.
2461 Your /etc/systemid file contains $s_name.
2462 But uname returns $u_name.
2463 Since Elm needs the UUCP name, and currently these two do not match,
2464 Elm will assume Xenix uname() is broken.
2465 EOM
2466 fi
2467 else
2468 cat <<EOM
2469 On Xenix, UUCP uses the name found in /etc/systemid, while uname()
2470 returns the name compiled into the operating system via configure.
2471 Elm needs the UUCP name, and currently the compiled in name is undefined.
2472 Since mail needs the UUCP name, and these two need not match, Elm will
2473 assume Xenix uname() is broken.
2474 EOM
2475 fi
2476 elif $contains '^uname$' libc.list >/dev/null 2>&1 ; then
2477 echo "uname() found."
2478 d_douname="$define"
2479 ans=uname
2480 fi
2481
2482 case "$d_douname$d_gethname" in
2483 *define*)
2484 case "$ign_hname" in
2485 '') case "$d_host_comp" in
2486 "$define") dflt=y;;
2487 *) dflt=n;;
2488 esac;;
2489 y) dflt=y;;
2490 *) dflt=n;;
2491 esac
2492 cat <<EOM
2493
2494 Every now and then someone has a $ans() that lies about the hostname
2495 but can't be fixed for political or economic reasons. Would you like to
2496 EOM
2497 rp="pretend $ans() isn't there and maybe compile in the hostname? [$dflt]"
2498 $echo $n "$rp $c"
2499 . myread
2500 case "$ans" in
2501 y*) ign_hname=y
2502 d_douname="$undef"
2503 d_gethname="$undef"
2504 d_host_comp="$define"
2505 $echo $n "Okay... $c"
2506 ;;
2507 *) ign_hname=n
2508 d_host_comp="$undef"
2509 ;;
2510 esac
2511 ;;
2512 *)
2513 $cat <<EOT
2514
2515 There is no gethostname() or uname() on this system. The hostname will
2516 have to be compiled in. It can be overridden in the global elm.rc file
2517 in the library directory to specify hostname, hostfullname and hostdomain.
2518 EOT
2519 d_host_comp="$define"
2520 ;;
2521 esac
2522
2523 : where do we get termlib routines from
2524 echo " "
2525 ans=`loc libcurses.a x $libpth`
2526 if $test "$ans" = x; then
2527 ans=`loc Slibcurses.a x $libpth`
2528 fi
2529 case "$ans" in
2530 /*)
2531 ar t $ans >grimble
2532 if $contains tputs.o grimble >/dev/null 2>&1; then
2533 termlib='-lcurses'
2534 d_havetlib="$define"
2535 echo "Terminfo library found."
2536 else
2537 ans=x
2538 fi
2539 rm -f grimble
2540 ;;
2541 esac
2542 case "$ans" in
2543 x)
2544 ans=`loc libtermlib.a x $libpth`
2545 if $test "$ans" = x; then
2546 ans=`loc Slibtermlib.a x $libpth`
2547 fi
2548 case "$ans" in
2549 /usr/lib*|/lib*)
2550 termlib='-ltermlib'
2551 d_havetlib="$define"
2552 echo "Termlib library found."
2553 ;;
2554 /*)
2555 termlib="$ans"
2556 d_havetlib="$define"
2557 echo "Termlib library found."
2558 ;;
2559 *)
2560 ans=`loc libtermcap.a x $libpth`
2561 if $test "$ans" = x; then
2562 ans=`loc Slibtermcap.a x $libpth`
2563 fi
2564 case "$ans" in
2565 /usr/lib*|/lib*)
2566 termlib='-ltermcap'
2567 d_havetlib="$define"
2568 echo "Termcap library found."
2569 ;;
2570 /*)
2571 termlib="$ans"
2572 d_havetlib="$define"
2573 echo "Termcap library found."
2574 ;;
2575 *)
2576 case "$termlib" in
2577 '')
2578 dflt=y
2579 rp="Your system appears to NOT have termlib-style routines. Is this true? [$dflt]"
2580 $echo $n "$rp $c"
2581 . myread
2582 case "$ans" in
2583 n*|f*) d_havetlib="$define"
2584 echo "Then where are the termlib-style routines kept (specify either -llibname"
2585 $echo $n " or full pathname (~name ok))? $c"
2586 rp='Specify termlib:'
2587 . myread
2588 termlib=`filexp $ans`
2589 ;;
2590 *) d_havetlib="$undef"
2591 termlib=''
2592 echo "You will have to play around with term.c then."
2593 ;;
2594 esac
2595 echo " "
2596 ;;
2597 *) echo "You said termlib was $termlib before."
2598 ;;
2599 esac
2600 ;;
2601 esac
2602 ;;
2603 esac
2604 ;;
2605 esac
2606
2607 : see if strings.h is in /usr/include or /usr/include/sys
2608 echo " "
2609 strings=`loc string.h "" /usr/include $includepath`
2610 if $test -z "$strings"; then
2611 strings=`loc strings.h "" /usr/include $includepath`
2612 fi
2613 while $test -z "$strings"; do
2614 echo " "
2615 dflt=''
2616 rp="What is the full path name of the include file directory? []"
2617 $echo $n "$rp $c"
2618 . myread
2619 includepath=`filexp $ans`
2620 if $test -d "$includepath"; then
2621 strings=`loc string.h "" /usr/include $includepath`
2622 if $test -z "$strings"; then
2623 strings=`loc strings.h "" /usr/include $includepath`
2624 fi
2625 if $test -z "$strings"; then
2626 $cat <<EOM
2627
2628 Include file string.h or strings.h not found in $includepath.
2629 Elm requires string.h on USG type systems or strings.h on BSD type
2630 systems. Please specify the directory where one of these files can
2631 be found.
2632 EOM
2633 fi
2634 else
2635 echo "Directory $includepath not found"
2636 fi
2637 done
2638
2639 strings_f=`$expr "$strings" : ".*/\(.*\)"`
2640 if $test "$strings_f" = "string.h"; then
2641 d_strings="$undef"
2642 echo "Using string.h instead of strings.h"
2643 else
2644 d_strings="$define"
2645 echo "Using strings.h instead of string.h"
2646 fi
2647 pwdinsys=`loc pwd.h "" /usr/include $includepath`
2648 if $test -z "$pwdinsys"; then
2649 d_pwdinsys="$define"
2650 else
2651 d_pwdinsys="$undef"
2652 fi
2653
2654 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
2655 # Elm 2
2656 #
2657 : index or strcpy
2658 echo " "
2659 case "$d_index" in
2660 "$define") dflt=n;;
2661 *) dflt=y;;
2662 esac
2663 if $contains '^index$' libc.list >/dev/null 2>&1 ; then
2664 if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
2665 if $contains strchr "$strings" >/dev/null 2>&1 ; then
2666 if $contains index "$strings" >/dev/null 2>&1 ; then
2667 # has index, strchr, and index and strchr in strings.h
2668 echo "Your system has both index() and strchr(). Shall I use"
2669 rp="index() rather than strchr()? [$dflt]"
2670 $echo $n "$rp $c"
2671 . myread
2672 case "$ans" in
2673 n*) d_index="$define" ;;
2674 *) d_index="$undef" ;;
2675 esac
2676 else
2677 # has index, strchr, and strchr in strings.h
2678 d_index="$define"
2679 echo "strchr() found."
2680 fi
2681 else
2682 # has index, strchr, and no strchr in strings.h
2683 d_index="$undef"
2684 echo "index() found."
2685 fi
2686 else
2687 # has only index, no strchr, strings.h is a moot point
2688 d_index="$undef"
2689 echo "index() found."
2690 fi
2691 else
2692 if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
2693 d_index="$define"
2694 echo "strchr() found."
2695 else
2696 echo "No index() or strchr() found!"
2697 d_index="$undef"
2698 fi
2699 fi
2700
2701 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
2702 # Elm 2
2703 #
2704 case "$d_mmdf" in
2705 "$define") dflt=y;;
2706 "$undef") dflt=n;;
2707 *) if $test -f "$submit"; then
2708 dflt=y
2709 else
2710 dflt=n
2711 fi
2712 ;;
2713 esac
2714 $cat <<EOM
2715
2716 Some systems run MMDF as their Mail Transport Agent. MMDF uses a
2717 different way of delimiting messages in the mailbox files. Other
2718 systems don't run MMDF but use the MMDF separator in their mailbox
2719 files. The MMDF separator is usually a series of four Control A's.
2720 $package needs to know if this system uses the MMDF style message
2721 separator in its mailbox files.
2722
2723 EOM
2724 rp="Does this system use MMDF style message separator? [$dflt]"
2725 $echo $n "$rp $c"
2726 . myread
2727 case "$ans" in
2728 y*) d_mmdf="$define";;
2729 *) d_mmdf="$undef";;
2730 esac
2731
2732 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
2733 # Elm 2
2734 #
2735 : determine mail delivery agent for Elm to use
2736 case "$mailer" in
2737 '')
2738 if $test "$d_mmdf" = "$define" -a -f "$execmail"; then
2739 dflt="$execmail"
2740 elif $test "$d_mmdf" = "$define" -a -f "$submit"; then
2741 dflt="$submit"
2742 elif $test -f "$sendmail"; then
2743 dflt="$sendmail"
2744 elif $test -f "$rmail"; then
2745 dflt="$rmail"
2746 elif $test -f /bin/mail; then
2747 dflt=/bin/mail
2748 else
2749 dflt=$mail
2750 fi
2751 ;;
2752 *) dflt="$mailer";;
2753 esac
2754 cont=true
2755 while $test "$cont" ; do
2756 echo " "
2757 echo "Give the full path name of the program used to deliver mail on your"
2758 $echo $n "system: [$dflt] $c"
2759 rp="Preferred mail delivery agent: [$dflt]"
2760 . myread
2761 mailer="$ans"
2762 if $test -f "$ans"; then
2763 cont=''
2764 else
2765 if $test "$fastread" = yes; then
2766 dflt=y
2767 else
2768 dflt=n
2769 fi
2770 echo "Mail delivery agent $ans doesn't exist."
2771 rp="Use that name anyway? [$dflt]"
2772 $echo $n "$rp $c"
2773 . myread
2774 dflt=''
2775 case "$ans" in
2776 y*) cont='';;
2777 esac
2778 fi
2779 done
2780 if $test "$mailer" != "$sendmail"; then
2781 sendmail=''
2782 fi
2783 if $test "$mailer" != "$submit"; then
2784 submit=''
2785 fi
2786 if $test "$mailer" != "$execmail"; then
2787 execmail=''
2788 fi
2789
2790 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
2791 # Elm 2
2792 #
2793 : check for internet mailer
2794 case "$d_internet" in
2795 "$define") dflt=y;;
2796 "$undef") dflt=n;;
2797 *) if $test -f "$sendmail"; then
2798 dflt=y
2799 elif $test -f "$submit"; then
2800 dflt=y
2801 elif $test -f "$smail"; then
2802 dflt=y
2803 else
2804 dflt=n
2805 fi
2806 ;;
2807 esac
2808 $cat <<EOM
2809
2810 Some newer mailers can deliver mail to addresses of the INTERNET
2811 persuasion, such as [email protected]. Other older mailers require the
2812 complete uucp ! path to the destination to be specified in the address.
2813 EOM
2814 rp="Does your mailer understand INTERNET addresses? [$dflt]"
2815 $echo $n "$rp $c"
2816 . myread
2817 case "$ans" in
2818 y*) d_internet="$define";;
2819 *) d_internet="$undef";;
2820 esac
2821
2822 : see if locale.h is in /usr/include
2823 echo " "
2824 dflt=`loc locale.h "" /usr/include $includepath`
2825 if $test -z "$dflt"; then
2826 echo "locale.h not found, $package will not call setlocale"
2827 d_locale=$undef
2828 else
2829 echo "locale.h found, $package will call setlocale"
2830 d_locale=$define
2831 fi
2832
2833 : see if nl_types.h is in /usr/include
2834 echo " "
2835 dflt=`loc nl_types.h "" /usr/include $includepath`
2836 if $test -z "$dflt"; then
2837 echo "nl_types.h not found, $package will use its own"
2838 d_nl_types=$undef
2839 else
2840 echo "nl_types.h found, $package will include the systems version"
2841 d_nl_types=$define
2842 fi
2843
2844 : see if catgets is in the libraries
2845 set catgets d_msgcat
2846 eval $inlibc
2847
2848 if $test "$d_msgcat" = "$define"; then
2849 echo "Message catalog routines found"
2850 cat <<EOM
2851
2852 The system has the message catalog routines in its library. These routines
2853 are new, and on some systems do not function properly. Also, $package expects
2854 that these routines are X/Open compliant.
2855
2856 EOM
2857
2858 case "$d_usenls" in
2859 "$define") dflt=y;;
2860 "$undef") dflt=n;;
2861 *) dflt=n;;
2862 esac
2863
2864 rp="Should $package use its own routines instead of the systems NLS routines? [$dflt]"
2865 $echo $n "$rp $c"
2866 . myread
2867 case "$ans" in
2868 y*) d_usenls="$define"
2869 d_nl_types=$undef;;
2870 *) d_usenls="$undef";;
2871 esac
2872 else
2873 echo "Message catalog routines not found, $package will use its own"
2874 if $test "$d_usenls" = ""; then
2875 d_usenls="$define"
2876 fi
2877 fi
2878
2879 : see if stdlib.h is in includepath
2880 echo " "
2881 i_stdlib=`loc stdlib.h "" /usr/include $includepath`
2882 if $test -n "$i_stdlib"; then
2883 echo "Found <stdlib.h>"
2884 i_stdlib="$define"
2885 else
2886 echo "Did not find <stdlib.h>"
2887 i_stdlib="$undef"
2888 fi
2889
2890 : see if malloc is void * or char *
2891 echo " "
2892 case "$d_mallocvoid" in
2893 "$define") dflt=y;;
2894 "$undef") dflt=n;;
2895 *) if $test "$i_stdlib" = "$define" ; then
2896 cat >usemymalloc.c <<'END'
2897 #include <stdlib.h>
2898 void *malloc();
2899 END
2900 else
2901 cat >usemymalloc.c <<'END'
2902 #include <malloc.h>
2903 void *malloc();
2904 END
2905 fi
2906 if $cc $ccflags -c usemymalloc.c >/dev/null 2>&1; then
2907 d_mallocvoid=$define
2908 echo "Your system wants malloc to return void *, it would seem."
2909 else
2910 d_mallocvoid=$undef
2911 echo "Your system wants malloc to return char *, it would seem."
2912 fi
2913 ;;
2914 esac
2915 echo " "
2916
2917 : see if memcpy exists
2918 set memcpy d_memcpy
2919 eval $inlibc
2920
2921 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
2922 # Elm 2
2923 #
2924 case "$d_noxheader" in
2925 "$define") dflt=y;;
2926 "$undef") dflt=n;;
2927 *) dflt=n;;
2928 esac
2929 $cat <<EOM
2930
2931 Some sites do not like to see the mail header "X-mailer:" in outgoing
2932 messages. If you choose, you may disable these headers. However, it
2933 is strongly urged to leave these headers in the mail to assist in
2934 tracking down problems.
2935
2936 EOM
2937 rp="Would you like to disable the X-mailer: headers? [$dflt]"
2938 $echo $n "$rp $c"
2939 . myread
2940 case "$ans" in
2941 y*) d_noxheader="$define";;
2942 *) d_noxheader="$undef";;
2943 esac
2944
2945 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
2946 # Elm 2
2947 #
2948 : check for "kill(pid, 0)"
2949 echo " "
2950 case "$d_pidcheck" in
2951 "$define") ;;
2952 "$undef") ;;
2953 *)
2954 echo "Checking to see if kill(pid, 0) works..."
2955 $cat >try.c <<'EOCP'
2956 main()
2957 {
2958 int pid, status0, status9;
2959
2960 if ((pid = fork()) == 0)
2961 {
2962 sleep(30);
2963 exit(1);
2964 }
2965 status0 = kill(pid, 0);
2966 status9 = kill(pid, 9);
2967 exit(status0 == status9);
2968 }
2969 EOCP
2970 if $cc try.c -o try >/dev/null 2>&1 ; then
2971 if try >/dev/null 2>&1 ; then
2972 echo "Your system does not support kill(pid, 0)..."
2973 d_pidcheck="$undef"
2974 else
2975 d_pidcheck="$define"
2976 echo "Your system supports kill(pid, 0)..."
2977 fi
2978 else
2979 echo "Your system does not support kill(pid, 0)..."
2980 d_pidcheck="$undef"
2981 fi
2982 $rm -f try.c try.o try
2983 ;;
2984 esac
2985
2986 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
2987 # Elm 2
2988 #
2989 : see if BSD sigset exists
2990 echo " "
2991 set sigset d_sigset
2992 eval $inlibc
2993 : See if sigaction exists -- POSIX has highest priority in match
2994 if $contains sigaction libc.list >/dev/null 2>&1; then
2995 echo "sigaction() found."
2996 d_sigaction="$define"
2997 d_sigset="$undef"
2998 d_sigvec="$undef"
2999 d_sigvectr="$undef"
3000 else
3001 d_sigaction="$undef"
3002 : see if sigvector exists -- since sigvec will match the substring
3003 if $contains sigvector libc.list >/dev/null 2>&1; then
3004 echo 'sigvector() found--you must be running HP-UX.'
3005 d_sigvectr="$define"
3006 d_sigvec="$define"
3007 else
3008 : try the original name
3009 d_sigvectr="$undef"
3010 if $contains sigvec libc.list >/dev/null 2>&1; then
3011 echo 'sigvec() found.'
3012 d_sigvec="$define"
3013 else
3014 case "$d_sigset" in
3015 "$define")
3016 echo 'sigvec() not found';;
3017 *)
3018 echo 'sigvec() not found--race conditions with signals may occur.';;
3019 esac
3020 d_sigvec="$undef"
3021 fi
3022 fi
3023 fi
3024
3025 : see if sigprocmask exists -- POSIX has highest priority in match
3026 echo " "
3027 if $contains sigprocmask libc.list >/dev/null 2>&1; then
3028 echo 'sigprocmask() found.'
3029 d_sigprocmask="$define"
3030 d_sigblock="$undef"
3031 d_sighold="$undef"
3032 else
3033 d_sigprocmask="$undef"
3034 : see if sigblock exists
3035 if $contains sigblock libc.list >/dev/null 2>&1; then
3036 echo 'sigblock() found.'
3037 d_sigblock="$define"
3038 d_sighold="$undef"
3039 else
3040 : see if sighold exists
3041 d_sigblock="$undef"
3042 if $contains sighold libc.list >/dev/null 2>&1; then
3043 echo 'sighold() found.'
3044 d_sighold="$define"
3045 else
3046 echo 'No signal masking functions found.'
3047 d_sighold="$undef"
3048 fi
3049 fi
3050 fi
3051
3052 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
3053 # Elm 2
3054 #
3055 : see if we should include time.h, sys/time.h, or both
3056 cat <<'EOM'
3057
3058 Testing to see if we should include <time.h>, <sys/time.h> or both.
3059 I'm now running the test program...
3060 EOM
3061 $cat >try.c <<'EOCP'
3062 #ifdef I_TIME
3063 #include <time.h>
3064 #endif
3065 #ifdef I_SYSTIME
3066 #ifdef SYSTIMEKERNEL
3067 #define KERNEL
3068 #endif
3069 #include <sys/time.h>
3070 #endif
3071 main()
3072 {
3073 struct tm foo;
3074 #ifdef S_TIMEVAL
3075 struct timeval bar;
3076 #endif
3077 if (foo.tm_sec == foo.tm_sec)
3078 exit(0);
3079 #ifdef S_TIMEVAL
3080 if (bar.tv_sec == bar.tv_sec)
3081 exit(0);
3082 #endif
3083 exit(1);
3084 }
3085 EOCP
3086 flags=''
3087 for s_timeval in '-DS_TIMEVAL' ''; do
3088 for d_systimekernel in '' '-DSYSTIMEKERNEL'; do
3089 for i_time in '-DI_TIME' ''; do
3090 for i_systime in '-DI_SYSTIME' ''; do
3091 case "$flags" in
3092 '') echo "Trying $i_time $i_systime $d_systimekernel $s_timeval"
3093 if $cc $ccflags $i_time $i_systime $d_systimekernel $s_timeval \
3094 try.c -o try >/dev/null 2>&1 ; then
3095 set X $i_time $i_systime $d_systimekernel $s_timeval
3096 shift
3097 flags="$*"
3098 echo "Succeeded with $flags"
3099 fi
3100 ;;
3101 esac
3102 done
3103 done
3104 done
3105 done
3106 case "$flags" in
3107 *SYSTIMEKERNEL*) d_systimekernel="$define";;
3108 *) d_systimekernel="$undef";;
3109 esac
3110 case "$flags" in
3111 *I_TIME*) i_time="$define";;
3112 *) i_time="$undef";;
3113 esac
3114 case "$flags" in
3115 *I_SYSTIME*) i_systime="$define";;
3116 *) i_systime="$undef";;
3117 esac
3118 $rm -f try.c try
3119
3120 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
3121 # Elm 2
3122 #
3123 : check for valid reply/to fields
3124 case "$d_useembed" in
3125 "$define") dflt=y;;
3126 "$undef") dflt=n;;
3127 *) if $test "$d_internet" = "$define" ; then
3128 dflt=y
3129 else
3130 dflt=n
3131 fi
3132 ;;
3133 esac
3134 $cat <<EOM
3135
3136 One of the more annoying quirks of the UUCP network and various other
3137 systems that interact with it are that everyone seems to have different
3138 ideas about how to do routing, etc. Therefore, a lot of times e-mail
3139 will arrive from off site with corrupt, unusable "Reply-To:" and "From:"
3140 fields. This next question relates to whether your site is liable to
3141 get mangled fields or not...
3142
3143 Does your site receive e-mail with valid "Reply-To:" and "From:" fields?
3144
3145 EOM
3146 $echo $n "Use Reply-To: and From: addresses? [$dflt] $c"
3147 rp="Are Reply-to: and From: addresses reliable? [$dflt]"
3148 . myread
3149 case "$ans" in
3150 y*) d_useembed="$define";;
3151 *) d_useembed="$undef";;
3152 esac
3153
3154 : see if utime.h is in includepath
3155 echo " "
3156 i_utime=`loc utime.h "" /usr/include $includepath`
3157 if $test -n "$i_utime"; then
3158 echo "Found <utime.h>"
3159 i_utime="$define"
3160 i_sysutime="$undef"
3161 else
3162 i_sysutime=`loc sys/utime.h "" /usr/include $includepath`
3163 if $test -n "$i_sysutime"; then
3164 echo "Found <sys/utime.h>"
3165 i_utime="$undef"
3166 i_sysutime="$define"
3167 else
3168 echo "Did not find <utime.h> or <sys/utime.h>"
3169 i_utime="$undef"
3170 i_sysutime="$undef"
3171 fi
3172 fi
3173
3174 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
3175 # Elm 2
3176 #
3177 : check for utimbuf structure
3178 echo " "
3179 case "$d_utimbuf" in
3180 "$define") ;;
3181 "$undef") ;;
3182 *)
3183 : Pyramid passes the att compile test but still needs the definition
3184 if Cppsym pyr ; then
3185 if $test "`/bin/universe`" = "att" ; then
3186 d_utimbuf="$undef"
3187 echo "I will use my 'utimbuf' structure..."
3188 else
3189 d_utimbuf="$define"
3190 echo "You have the 'utimbuf' structure..."
3191 fi
3192 else
3193 if $test "$d_utimbuf" != "$define"; then
3194 echo "Checking to see if struct utimbuf exists."
3195 $cat >try.c <<'EOCP'
3196 #include <stdio.h>
3197 #include <fcntl.h>
3198 #include <sys/types.h>
3199 #include <sys/stat.h>
3200 #define far /* to keep Xenix from complaining */
3201 #if (defined(BSD) || !defined(apollo))
3202 # include <sys/file.h>
3203 #endif
3204 #ifdef I_TIME
3205 # include <time.h>
3206 #endif
3207 #ifdef I_SYSTIME
3208 # include <sys/time.h>
3209 #endif
3210 #ifdef BSD
3211 # include <sys/timeb.h>
3212 #endif
3213 #ifdef I_UTIME
3214 # include <utime.h>
3215 #endif
3216 #ifdef I_SYSUTIME
3217 # include <sys/utime.h>
3218 #endif
3219
3220 main()
3221 {
3222 struct utimbuf test;
3223 test.actime = 0;
3224 exit(1);
3225 }
3226 EOCP
3227 cflags=$ccflags
3228 if $test "$i_utime" = "$define"; then
3229 cflags="$cflags -DI_UTIME"
3230 fi
3231 if $test "$i_sysutime" = "$define"; then
3232 cflags="$cflags -DI_SYSUTIME"
3233 fi
3234 if $test "$i_time" = "$define"; then
3235 cflags="$cflags -DI_TIME"
3236 fi
3237 if $test "$i_systime" = "$define"; then
3238 cflags="$cflags -DI_SYSTIME"
3239 fi
3240 if $test "$d_bsd" = "$define"; then
3241 cflags="$cflags -DBSD"
3242 fi
3243 if $cc $cflags try.c -o try >/dev/null 2>&1 ; then
3244 d_utimbuf="$define"
3245 echo "You have the 'utimbuf' structure..."
3246 else
3247 echo "I will use my 'utimbuf' structure..."
3248 d_utimbuf="$undef"
3249 fi
3250 $rm -f try.c try.o try
3251 fi
3252 fi
3253 ;;
3254 esac
3255
3256 : see if memory.h is in includepath
3257 echo " "
3258 i_memory=`loc memory.h "" /usr/include $includepath`
3259 if $test -n "$i_memory"; then
3260 echo "Found <memory.h>"
3261 i_memory="$define"
3262 else
3263 echo "Did not find <memory.h>"
3264 i_memory="$undef"
3265 fi
3266
3267 : see if stdarg.h is in includepath
3268 echo " "
3269 i_stdarg=`loc stdarg.h "" /usr/include $includepath`
3270 if $test -n "$i_stdarg"; then
3271 echo "Found <stdarg.h>"
3272 i_stdarg="$define"
3273 else
3274 echo "Did not find <stdarg.h>"
3275 i_stdarg="$undef"
3276 fi
3277
3278 : see if unistd.h is in includepath
3279 echo " "
3280 i_unistd=`loc unistd.h "" /usr/include $includepath`
3281 if $test -n "$i_unistd"; then
3282 echo "Found <unistd.h>"
3283 i_unistd="$define"
3284 else
3285 echo "Did not find <unistd.h>"
3286 i_unistd="$undef"
3287 fi
3288
3289 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
3290 # Elm 2
3291 #
3292 : see if signal is declared as pointer to function returning int or void
3293 echo " "
3294 $cppstdin $cppflags < /usr/include/signal.h >$$.tmp
3295 if $contains 'void.*[^s]signal' $$.tmp >/dev/null 2>&1 ; then
3296 echo "You have void (*signal())() instead of int."
3297 sigtype="void"
3298 elif $contains 'int.*[^sg]signal' $$.tmp >/dev/null 2>&1 ; then
3299 echo "You have int (*signal())() instead of void."
3300 sigtype="int"
3301 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
3302 echo "You have int (*signal())() instead of void."
3303 sigtype="int"
3304 elif $contains 'sigfunc_t.*[^s]signal' $$.tmp >/dev/null 2>&1 ; then
3305 echo "You have sigfunc_t (*signal())() instead of int."
3306 sigtype="sigfunc_t"
3307 elif $test -n "$sigtype"; then
3308 echo $n "As you already told me, signal handlers return $sigtype"
3309 else
3310 echo "I can't determine whether signal handlers return void or int..."
3311 echo "I'm assuming they return void like ANSI and POSIX want."
3312 echo "If not, you will have to change sigtype to match the typedef"
3313 echo "used by the signal handlers. Change it config.sh at the edit "
3314 echo "question at the end of Configure."
3315 sigtype="void"
3316 fi
3317 $rm -f $$.tmp
3318
3319 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
3320 # Elm 2
3321 #
3322 : determine where public libraries go
3323
3324 # Revision 1.1.1.1 1995/04/13 19:38:55 wfp5p
3325 # Elm 2
3326 #
3327 : determine where mail is spooled
3328 case "$mailhome" in
3329 '')
3330 base=`loc . /usr/spool/mail /var/spool/mail /var/mail /usr/mail`
3331 dflt=$base/'%u'
3332 ;;
3333 *) dflt="$mailhome"
3334 ;;
3335 esac
3336 cont=true
3337 while $test "$cont" ; do
3338 $echo " "
3339 $echo "NOTE: '%u' expands to the users login name. It MUST be present."
3340 $echo "Normal type of location looks like /var/mail/%u"
3341 $echo " you can also use '%f' as the first letter of the username. "
3342 $echo " EG /var/mail/%f/%u"
3343 rp="Where is yet-to-be-read mail spooled? [$dflt]"
3344 $echo $n "$rp $c"
3345 . myread
3346 # We used to have a long nice check for "maildir" here. but that
•3347 # isn't going to be easy any more.
3348 mailhome="$ans"
3349 : check if we have the "traditional" spool dir
3350 maildir=`$expr "$mailhome" : "\([/A-Za-z_0-9]*\)/%u$"`
3351 if $test "$maildir" = "" ; then
3352 : non-traditional mail delivery. %u is not at END.
3353 : So no point checking if maildir exists
3354 # But we still need to verify that %u is THERE!
3355 hasU=`$expr "$mailhome" : ".*\(%u\)"`
3356 if $test "$hasU" = "%u" ; then
3357 cont=''
3358 else
3359 $echo "No '%u' present!"
3360 fi
3361 elif $test -d "$maildir"; then
3362 # mailspool dir exists. Good!
3363 cont=''
3364 else
3365 if $test "$fastread" = yes; then
3366 dflt=y
3367 else
3368 dflt=n
3369 fi
3370 rp="Directory $maildir doesn't exist. Use that name anyway? [$dflt]"
3371 $echo $n "$rp $c"
3372 . myread
3373 dflt=''
3374 case "$ans" in
3375 y*) cont='';;
3376 esac
3377 fi
3378 done
3379
3380 : determine the group of the mail directory and what group elm should use
3381 : IFFF we are using a mailspool dir
3382 if $test "$maildir" != "" ; then
3383
3384 mailperms=`$ls -lgd $maildir/.`
3385 mailgrp=`$expr "$mailperms" : "[ld][rwxstS-]*[ 0123456789]*\(.*\)"`
3386 : now mailgrp is either user group size mon day time/year name
3387 : or group size mon day time/year name
3388 field1=`$expr "$mailgrp" : "\([A-Za-z_0-9]*\).*"`
3389 field2=`$expr "$mailgrp" : "[A-Za-z_0-9]* *\([A-Za-z_0-9]*\).*"`
3390 numcheck=`$expr "$field2" : "\([0-9]*\).*"`
3391 if $test "$numcheck" = "" ; then
3392 mailgrp=$field2
3393 else
3394 mailgrp=$field1
3395 fi
3396
3397 case "$mailgrp" in
3398 '')
3399 mailgrp=mail
3400 ;;
3401 esac
3402 echo " "
3403 echo "Mail group is $mailgrp"
3404
3405 : Check access perms on mail directory, from prior execution of ls
3406 : If publically writable, then assume we will NOT be running
3407 : setgid.
3408 mailpublic=`$expr "$mailperms" : "d[rwxstT]*\([w-][tx-]\) .*"`
3409
3410 if $test "$d_setgid" = "" ; then
3411 case "$mailpublic" in
3412 wt)
3413 $echo mail dir is publicaly writable. Filter will not be setgid
3414 d_setgid="$undef"
3415 ;;
3416 wx)
3417 $echo "WARNING: mail directory does not have 't' flag set, yet is world-writable"
3418 $echo "(Filter will not be setgid)"
3419 $echo "$mailperms"
3420 d_setgid="$undef"
3421 ;;
3422 "")
3423 $echo "No existing mail directory. Assuming filter will NOT be setgid."
3424 d_setgid="$undef"
3425 ;;
3426 *)
3427 $echo "Spool dir does NOT have writable flag. Filter will be setgid."
3428 d_setgid="$define"
3429 ;;
3430 esac
3431 fi
3432
3433 else
3434 # we dont have a default global spool dir. Assume not setgid
3435 if $test "$d_setgid" = "" ; then
3436 d_setgid="$undef"
3437 fi
3438 #but just in case they say yes, default to the reasonable assumption
3439 #bug right now: they arent asked. oops.
3440 mailgrp=mail
3441 fi
3442
3443 mailermode=755
3444
3445 case "$d_setgid" in
3446 "$define")
3447 mailermode=2755
3448 cat <<EOM
3449
3450 Since Filter is being installed as a setgid program, it must be installed
3451 by root, or a user able to set the setgid bit.
3452 EOM
3453 esac
3454 # Revision 1.1.1.1 1995/04/13 19:38:56 wfp5p
3455 # Elm 2
3456 #
3457 : if pmake exists, allow its use for parallel make
3458
3459 if $test -f "$pmake" ; then
3460 case "$use_pmake" in
3461 n) dflt=n;;
3462 *) dflt=y;;
3463 esac
3464
3465 $cat <<EOM
3466
3467 The executable file pmake was found on this system. Usually this
3468 file indicates a parallel make, which executes much faster. Should
3469 this system use the pmake command as its make command?
3470
3471 EOM
3472 rp="Does this system use pmake as its make? [$dflt]"
3473 $echo $n "$rp $c"
3474 . myread
3475 case "$ans" in
3476 y*) use_pmake=y
3477 make="$pmake";;
3478 *) use_pmake=n;;
3479 esac
3480 else
3481 use_pmake=n
3482 fi
3483 # Revision 1.1.1.1 1995/04/13 19:38:54 wfp5p
3484 # Elm 2
3485 #
3486
3487 : the "config.over" file can be used to patch configuration changes
3488 if test -f ../config.over ; then
3489 echo " "
3490 echo "I have found a \"config.over\" file."
3491 dflt=y
3492 rp="Do you want to load the \"config.over\" file? [$dflt]"
3493 $echo $n "$rp $c"
3494 . myread
3495 case "$ans" in
3496 n*) echo "OK, I'll ignore it."
3497 ;;
3498 *) . ../config.over
3499 echo "Configuration override changes have been loaded from config.over."
3500 ;;
3501 esac
3502 fi
3503
3504 : clean up one time files
3505 for file in OneTime.PL* ; do
3506 if test -f "$file" ; then
3507 echo "Removing patch cleanup script $file . . ."
3508 rm -f $file
3509 fi
3510 done
3511
3512 echo " "
3513 echo "End of configuration questions."
3514 echo " "
3515
3516 : create config.sh file
3517 echo " "
3518 if test -d ../UU; then
3519 cd ..
3520 fi
3521 echo "Creating config.sh..."
3522 $spitshell <<EOT >config.sh
3523 $startsh
3524 # config.sh
3525 # This file was produced by running the Configure script.
3526
3527 bin='$bin'
3528 contains='$contains'
3529 cppstdin='$cppstdin'
3530 cppminus='$cppminus'
3531 d_havetlib='$d_havetlib'
3532 termlib='$termlib'
3533 d_memcpy='$d_memcpy'
3534 d_whoami='$d_whoami'
3535 n='$n'
3536 c='$c'
3537 package='$package'
3538 startsh='$startsh'
3539 d_eunice='$d_eunice'
3540 define='$define'
3541 eunicefix='$eunicefix'
3542 loclist='$loclist'
3543 expr='$expr'
3544 sed='$sed'
3545 echo='$echo'
3546 cat='$cat'
3547 rm='$rm'
3548 mv='$mv'
3549 cp='$cp'
3550 tail='$tail'
3551 tr='$tr'
3552 mkdir='$mkdir'
3553 sort='$sort'
3554 uniq='$uniq'
3555 grep='$grep'
3556 trylist='$trylist'
3557 test='$test'
3558 inews='$inews'
3559 ispell='$ispell'
3560 egrep='$egrep'
3561 more='$more'
3562 pg='$pg'
3563 Mcc='$Mcc'
3564 vi='$vi'
3565 mailx='$mailx'
3566 mail='$mail'
3567 cpp='$cpp'
3568 perl='$perl'
3569 emacs='$emacs'
3570 ls='$ls'
3571 rmail='$rmail'
3572 sendmail='$sendmail'
3573 shar='$shar'
3574 smail='$smail'
3575 submit='$submit'
3576 tbl='$tbl'
3577 troff='$troff'
3578 nroff='$nroff'
3579 uname='$uname'
3580 uuname='$uuname'
3581 line='$line'
3582 chgrp='$chgrp'
3583 chmod='$chmod'
3584 lint='$lint'
3585 sleep='$sleep'
3586 pr='$pr'
3587 tar='$tar'
3588 ln='$ln'
3589 lpr='$lpr'
3590 lp='$lp'
3591 touch='$touch'
3592 make='$make'
3593 date='$date'
3594 csh='$csh'
3595 pmake='$pmake'
3596 mips='$mips'
3597 col='$col'
3598 pack='$pack'
3599 compress='$compress'
3600 execmail='$execmail'
3601 libswanted='$libswanted'
3602 d_broke_ctype='$d_broke_ctype'
3603 d_chown_neg1='$d_chown_neg1'
3604 d_cuserid='$d_cuserid'
3605 d_flock='$d_flock'
3606 d_dotlock='$d_dotlock'
3607 d_fcntlock='$d_fcntlock'
3608 lock_dir='$lock_dir'
3609 has_flock='$has_flock'
3610 has_fcntl='$has_fcntl'
3611 d_gethname='$d_gethname'
3612 d_douname='$d_douname'
3613 d_host_comp='$d_host_comp'
3614 ign_hname='$ign_hname'
3615 d_index='$d_index'
3616 d_internet='$d_internet'
3617 d_locale='$d_locale'
3618 d_nl_types='$d_nl_types'
3619 d_msgcat='$d_msgcat'
3620 d_usenls='$d_usenls'
3621 d_mallocvoid='$d_mallocvoid'
3622 d_mmdf='$d_mmdf'
3623 d_noxheader='$d_noxheader'
3624 d_pidcheck='$d_pidcheck'
3625 d_setgid='$d_setgid'
3626 d_savegrpmboxid='$d_savegrpmboxid'
3627 mailermode='$mailermode'
3628 d_sigvec='$d_sigvec'
3629 d_sigvectr='$d_sigvectr'
3630 d_sigset='$d_sigset'
3631 d_sighold='$d_sighold'
3632 d_sigprocmask='$d_sigprocmask'
3633 d_sigblock='$d_sigblock'
3634 d_sigaction='$d_sigaction'
3635 d_strings='$d_strings'
3636 d_pwdinsys='$d_pwdinsys'
3637 strings='$strings'
3638 includepath='$includepath'
3639 d_strstr='$d_strstr'
3640 d_useembed='$d_useembed'
3641 d_utimbuf='$d_utimbuf'
3642 hostname='$hostname'
3643 phostname='$phostname'
3644 mydomain='$mydomain'
3645 autohostname='$autohostname'
3646 i_memory='$i_memory'
3647 i_stdarg='$i_stdarg'
3648 i_stdlib='$i_stdlib'
3649 i_time='$i_time'
3650 i_systime='$i_systime'
3651 d_systimekernel='$d_systimekernel'
3652 i_unistd='$i_unistd'
3653 i_utime='$i_utime'
3654 i_sysutime='$i_sysutime'
3655 lib='$lib'
3656 libc='$libc'
3657 maildir='$maildir'
3658 mailhome='$mailhome'
3659 mailer='$mailer'
3660 mailgrp='$mailgrp'
3661 mansrc='$mansrc'
3662 catmansrc='$catmansrc'
3663 manext='$manext'
3664 manext_choice='$manext_choice'
3665 catmanext='$catmanext'
3666 catmanext_choice='$catmanext_choice'
3667 packed='$packed'
3668 manroff='$manroff'
3669 manroffopts='$manroffopts'
3670 suffix='$suffix'
3671 packer='$packer'
3672 models='$models'
3673 split='$split'
3674 small='$small'
3675 medium='$medium'
3676 large='$large'
3677 huge='$huge'
3678 optimize='$optimize'
3679 ccflags='$ccflags'
3680 cppflags='$cppflags'
3681 ldflags='$ldflags'
3682 cc='$cc'
3683 libs='$libs'
3684 nametype='$nametype'
3685 d_passnames='$d_passnames'
3686 d_berknames='$d_berknames'
3687 d_usgnames='$d_usgnames'
3688 rcpthdr='$rcpthdr'
3689 passcat='$passcat'
3690 roff='$roff'
3691 roffopts='$roffopts'
3692 d_rcpthdr='$d_rcpthdr'
3693 sigtype='$sigtype'
3694 spitshell='$spitshell'
3695 shsharp='$shsharp'
3696 sharpbang='$sharpbang'
3697 tzname_handling='$tzname_handling'
3698 use_pmake='$use_pmake'
3699 xencf='$xencf'
3700 xenlf='$xenlf'
3701 d_xenix='$d_xenix'
3702 d_bsd='$d_bsd'
3703 CONFIG=true
3704 EOT
3705
3706 CONFIG=true
3707
3708 echo " "
3709 dflt=''
3710 fastread=''
•3711 #We want things fully automated
3712 #echo "If you didn't make any mistakes, then just type a carriage return here."
3713 #rp="If you need to edit config.sh, do it as a shell escape here:"
3714 #$echo $n "$rp $c"
3715 #. UU/myread
3716 #case "$ans" in
3717 #'') ;;
3718 #*) : in case they cannot read
3719 # eval $ans;;
3720 #esac
3721 : if this fails, just run all the .SH files by hand
3722 . ./config.sh
3723
3724 echo " "
3725 echo "Doing variable substitutions on .SH files..."
3726 set x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
3727 shift
3728 case $# in
3729 0) set x *.SH; shift;;
3730 esac
3731 if test ! -f $1; then
3732 shift
3733 fi
3734 for file in $*; do
3735 case "$file" in
3736 */*)
3737 dir=`$expr X$file : 'X\(.*\)/'`
3738 file=`$expr X$file : 'X.*/\(.*\)'`
3739 (cd $dir && . $file)
3740 ;;
3741 *)
3742 . $file
3743 ;;
3744 esac
3745 done
3746 if test -f config.h.SH; then
3747 if test ! -f config.h; then
3748 : oops, they left it out of MANIFEST, probably, so do it anyway.
3749 . config.h.SH
3750 fi
3751 fi
3752
3753 if $contains '^depend:' Makefile >/dev/null 2>&1; then
3754 dflt=n
3755 $cat <<EOM
3756
3757 Now you need to generate make dependencies by running "make depend".
3758 You might prefer to run it in background: "make depend > makedepend.out &"
3759 It can take a while, so you might not want to run it right now.
3760
3761 EOM
3762 rp="Run make depend now? [$dflt]"
3763 $echo $n "$rp $c"
3764 . UU/myread
3765 case "$ans" in
3766 y*) make depend && echo "Now you must run a make."
3767 ;;
3768 *) echo "You must run 'make depend' then 'make'."
3769 ;;
3770 esac
3771 elif test -f Makefile; then
3772 echo " "
3773 echo "Now you must run a make."
3774 else
3775 echo "Done."
3776 fi
3777
3778 $rm -f kit*isdone
3779 : the following is currently useless
3780 cd UU && $rm -f $rmlist
3781 : since this removes it all anyway
3782 cd .. && $rm -rf UU
3783 : end of Configure
3784