perl 3.0 patch #1 (combined patch)
[p5sagit/p5-mst-13.2.git] / Configure
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: Configure,v 3.0.1.1 89/10/26 22:58:02 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
17 : sanity checks
18 PATH=".:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin:$PATH"
19 export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
20
21 if test ! -t 0; then
22     echo "Say 'sh Configure', not 'sh <Configure'"
23     exit 1
24 fi
25
26 (alias) >/dev/null 2>&1 && \
27     echo "(I see you are using the Korn shell.  Some ksh's blow up on Configure," && \
28     echo "especially on exotic machines.  If yours does, try the Bourne shell instead.)"
29
30 if test ! -d ../UU; then
31     if test ! -d UU; then
32         mkdir UU
33     fi
34     cd UU
35 fi
36
37 case "$1" in
38 -d) shift; fastread='yes';;
39 esac
40
41 d_eunice=''
42 eunicefix=''
43 define=''
44 loclist=''
45 expr=''
46 sed=''
47 echo=''
48 cat=''
49 rm=''
50 mv=''
51 cp=''
52 tail=''
53 tr=''
54 mkdir=''
55 sort=''
56 uniq=''
57 grep=''
58 trylist=''
59 test=''
60 inews=''
61 egrep=''
62 more=''
63 pg=''
64 Mcc=''
65 vi=''
66 mailx=''
67 mail=''
68 cpp=''
69 perl=''
70 emacs=''
71 ls=''
72 rmail=''
73 sendmail=''
74 shar=''
75 smail=''
76 tbl=''
77 troff=''
78 nroff=''
79 uname=''
80 uuname=''
81 line=''
82 chgrp=''
83 chmod=''
84 lint=''
85 sleep=''
86 pr=''
87 tar=''
88 ln=''
89 lpr=''
90 lp=''
91 touch=''
92 make=''
93 date=''
94 Log=''
95 Header=''
96 bin=''
97 byteorder=''
98 contains=''
99 cppstdin=''
100 cppminus=''
101 d_bcmp=''
102 d_bcopy=''
103 d_charsprf=''
104 d_crypt=''
105 cryptlib=''
106 d_dosuid=''
107 d_dup2=''
108 d_fchmod=''
109 d_fchown=''
110 d_fcntl=''
111 d_flock=''
112 d_getgrps=''
113 d_gethent=''
114 d_getpgrp=''
115 d_getprior=''
116 d_htonl=''
117 d_index=''
118 d_ioctl=''
119 d_killpg=''
120 d_memcmp=''
121 d_memcpy=''
122 d_mkdir=''
123 d_ndbm=''
124 d_odbm=''
125 d_readdir=''
126 d_rename=''
127 d_rmdir=''
128 d_setegid=''
129 d_seteuid=''
130 d_setpgrp=''
131 d_setprior=''
132 d_setregid=''
133 d_setresgid=''
134 d_setreuid=''
135 d_setresuid=''
136 d_setrgid=''
137 d_setruid=''
138 d_socket=''
139 d_sockpair=''
140 d_oldsock=''
141 socketlib=''
142 sockethdr=''
143 d_statblks=''
144 d_stdstdio=''
145 d_strctcpy=''
146 d_symlink=''
147 d_syscall=''
148 d_tminsys=''
149 i_systime=''
150 d_varargs=''
151 d_vfork=''
152 d_voidsig=''
153 d_vprintf=''
154 d_charvspr=''
155 gidtype=''
156 i_dirent=''
157 d_dirnamlen=''
158 i_fcntl=''
159 i_grp=''
160 i_niin=''
161 i_pwd=''
162 d_pwquota=''
163 d_pwage=''
164 i_sysdir=''
165 i_sysioctl=''
166 i_varargs=''
167 i_vfork=''
168 intsize=''
169 libc=''
170 libdbm=''
171 libndir=''
172 libnm=''
173 mallocsrc=''
174 mallocobj=''
175 usemymalloc=''
176 mansrc=''
177 manext=''
178 models=''
179 split=''
180 small=''
181 medium=''
182 large=''
183 huge=''
184 optimize=''
185 ccflags=''
186 ldflags=''
187 cc=''
188 libs=''
189 n=''
190 c=''
191 package=''
192 randbits=''
193 sig_name=''
194 spitshell=''
195 shsharp=''
196 sharpbang=''
197 startsh=''
198 stdchar=''
199 uidtype=''
200 voidflags=''
201 defvoidused=''
202 lib=''
203 privlib=''
204 CONFIG=''
205 : set package name
206 package=perl
207
208 echo " "
209 echo "Beginning of configuration questions for $package kit."
210 : Eunice requires " " instead of "", can you believe it
211 echo " "
212
213 define='define'
214 undef='undef'
215 libpth='/usr/lib /usr/local/lib /usr/lib/386 /usr/lib/large /lib /lib/386 /lib/large /usr/lib/small /lib/small'
216 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
217 rmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
218 trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
219
220 : We must find out about Eunice early
221 eunicefix=':'
222 if test -f /etc/unixtovms; then
223     eunicefix=/etc/unixtovms
224 fi
225 if test -f /etc/unixtovms.exe; then
226     eunicefix=/etc/unixtovms.exe
227 fi
228
229 : Now test for existence of everything in MANIFEST
230
231 echo "First let's make sure your kit is complete.  Checking..."
232 (cd ..; awk '' `awk '$1 !~ /PACKINGLIST/ {print $1}' MANIFEST` >/dev/null || kill $$)
233 echo " "
234
235 attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
236 attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
237 attrlist="$attrlist hpux hp9000s300 hp9000s500 hp9000s800"
238 attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
239 attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
240 attrlist="$attrlist $mc68k __STDC__ UTS M_I8086 M_I186 M_I286 M_I386"
241 attrlist="$attrlist i186"
242 pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /usr/plx /usr/5bin /vol/local/bin /etc /usr/lib /lib /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb"
243 d_newshome="/usr/NeWS"
244 defvoidused=7
245
246 : some greps do not return status, grrr.
247 echo "grimblepritz" >grimble
248 if grep blurfldyick grimble >/dev/null 2>&1 ; then
249     contains=contains
250 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
251     contains=grep
252 else
253     contains=contains
254 fi
255 rm -f grimble
256 : the following should work in any shell
257 case "$contains" in
258 contains*)
259     echo " "
260     echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
261     cat >contains <<'EOSS'
262 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
263 EOSS
264 chmod +x contains
265 esac
266
267 : first determine how to suppress newline on echo command
268 echo "Checking echo to see how to suppress newlines..."
269 (echo "hi there\c" ; echo " ") >.echotmp
270 if $contains c .echotmp >/dev/null 2>&1 ; then
271     echo "...using -n."
272     n='-n'
273     c=''
274 else
275     cat <<'EOM'
276 ...using \c
277 EOM
278     n=''
279     c='\c'
280 fi
281 echo $n "Type carriage return to continue.  Your cursor should be here-->$c"
282 read ans
283 rm -f .echotmp
284
285 : now set up to do reads with possible shell escape and default assignment
286 cat <<EOSC >myread
287 case "\$fastread" in
288 yes) ans=''; echo " " ;;
289 *) ans='!';;
290 esac
291 while expr "X\$ans" : "X!" >/dev/null; do
292     read ans
293     case "\$ans" in
294     !)
295         sh
296         echo " "
297         echo $n "\$rp $c"
298         ;;
299     !*)
300         set \`expr "X\$ans" : "X!\(.*\)\$"\`
301         sh -c "\$*"
302         echo " "
303         echo $n "\$rp $c"
304         ;;
305     esac
306 done
307 rp='Your answer:'
308 case "\$ans" in
309 '') ans="\$dflt";;
310 esac
311 EOSC
312
313 : general instructions
314 cat <<EOH
315  
316 This installation shell script will examine your system and ask you questions
317 to determine how the $package package should be installed.  If you get stuck
318 on a question, you may use a ! shell escape to start a subshell or execute
319 a command.  Many of the questions will have default answers in square
320 brackets--typing carriage return will give you the default.
321
322 On some of the questions which ask for file or directory names you are
323 allowed to use the ~name construct to specify the login directory belonging
324 to "name", even if you don't have a shell which knows about that.  Questions
325 where this is allowed will be marked "(~name ok)".
326
327 EOH
328 rp="[Type carriage return to continue]"
329 echo $n "$rp $c"
330 . myread
331 cat <<EOH
332
333 Much effort has been expended to ensure that this shell script will run
334 on any Unix system.  If despite that it blows up on you, your best bet is
335 to edit Configure and run it again. Also, let me (lwall@jpl-devvax.jpl.nasa.gov)
336 know how I blew it.  If you can't run Configure for some reason, you'll have
337 to generate a config.sh file by hand.
338
339 This installation script affects things in two ways: 1) it may do direct
340 variable substitutions on some of the files included in this kit, and
341 2) it builds a config.h file for inclusion in C programs.  You may edit
342 any of these files as the need arises after running this script.
343
344 If you make a mistake on a question, there is no easy way to back up to it
345 currently.  The easiest thing to do is to edit config.sh and rerun all the
346 SH files.  Configure will offer to let you do this before it runs the SH files.
347
348 EOH
349 rp="[Type carriage return to continue]"
350 echo $n "$rp $c"
351 . myread
352
353 : get old answers, if there is a config file out there
354 if test -f ../config.sh; then
355     echo " "
356     dflt=y
357     rp="I see a config.sh file.  Did Configure make it on THIS system? [$dflt]"
358     echo $n "$rp $c"
359     . myread
360     case "$ans" in
361     n*) echo "OK, I'll ignore it.";;
362     *)  echo "Fetching default answers from your old config.sh file..."
363         tmp="$n"
364         ans="$c"
365         . ../config.sh
366         n="$tmp"
367         c="$ans"
368         ;;
369     esac
370 fi
371
372 : find out where common programs are
373 echo " "
374 echo "Locating common programs..."
375 cat <<EOSC >loc
376 $startsh
377 case \$# in
378 0) exit 1;;
379 esac
380 thing=\$1
381 shift
382 dflt=\$1
383 shift
384 for dir in \$*; do
385     case "\$thing" in
386     .)
387         if test -d \$dir/\$thing; then
388             echo \$dir
389             exit 0
390         fi
391         ;;
392     *)
393         if test -f \$dir/\$thing; then
394             echo \$dir/\$thing
395             exit 0
396         elif test -f \$dir/\$thing.exe; then
397             : on Eunice apparently
398             echo \$dir/\$thing
399             exit 0
400         fi
401         ;;
402     esac
403 done
404 echo \$dflt
405 exit 1
406 EOSC
407 chmod +x loc
408 $eunicefix loc
409 loclist="
410 cat
411 cp
412 echo
413 expr
414 grep
415 mkdir
416 mv
417 rm
418 sed
419 sort
420 tr
421 uniq
422 "
423 trylist="
424 Mcc
425 cpp
426 egrep
427 test
428 "
429 for file in $loclist; do
430     xxx=`loc $file $file $pth`
431     eval $file=$xxx
432     eval _$file=$xxx
433     case "$xxx" in
434     /*)
435         echo $file is in $xxx.
436         ;;
437     *)
438         echo "I don't know where $file is.  I hope it's in everyone's PATH."
439         ;;
440     esac
441 done
442 echo " "
443 echo "Don't worry if any of the following aren't found..."
444 ans=offhand
445 for file in $trylist; do
446     xxx=`loc $file $file $pth`
447     eval $file=$xxx
448     eval _$file=$xxx
449     case "$xxx" in
450     /*)
451         echo $file is in $xxx.
452         ;;
453     *)
454         echo "I don't see $file out there, $ans."
455         ans=either
456         ;;
457     esac
458 done
459 case "$egrep" in
460 egrep)
461     echo "Substituting grep for egrep."
462     egrep=$grep
463     ;;
464 esac
465 case "$test" in
466 test)
467     echo "Hopefully test is built into your sh."
468     ;;
469 /bin/test)
470     if sh -c "PATH= test true" >/dev/null 2>&1; then
471         echo "Using the test built into your sh."
472         test=test
473     fi
474     ;;
475 *)
476     test=test
477     ;;
478 esac
479 case "$echo" in
480 echo)
481     echo "Hopefully echo is built into your sh."
482     ;;
483 /bin/echo)
484     echo " "
485     echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
486     $echo $n "hi there$c" >foo1
487     echo $n "hi there$c" >foo2
488     if cmp foo1 foo2 >/dev/null 2>&1; then
489         echo "They are compatible.  In fact, they may be identical."
490     else
491         case "$n" in
492         '-n') n='' c='\c' ans='\c' ;;
493         *) n='-n' c='' ans='-n' ;;
494         esac
495         cat <<FOO
496 They are not compatible!  You are probably running ksh on a non-USG system.
497 I'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
498 have echo built in and we may have to run some Bourne shell scripts.  That
499 means I'll have to use $ans to suppress newlines now.  Life is ridiculous.
500
501 FOO
502         rp="Your cursor should be here-->"
503         $echo $n "$rp$c"
504         . myread
505     fi
506     $rm -f foo1 foo2
507     ;;
508 *)
509     : cross your fingers
510     echo=echo
511     ;;
512 esac
513 rmlist="$rmlist loc"
514
515 : get list of predefined functions in a handy place
516 echo " "
517 set /usr/lib/libc.so.[0-9]*
518 eval set \$$#
519 if test -f "$1"; then
520     echo "Your shared C library is in $1."
521     libc="$1"
522 elif test -f /lib/libc.a; then
523     echo "Your C library is in /lib/libc.a.  You're normal."
524     libc=/lib/libc.a
525 else
526     ans=`loc libc.a blurfl/dyick $libpth`
527     if test ! -f "$ans"; then
528         ans=`loc clib blurfl/dyick $libpth`
529     fi
530     if test ! -f "$ans"; then
531         ans=`loc libc blurfl/dyick $libpth`
532     fi
533     if test ! -f "$ans"; then
534         ans=`loc Slibc.a blurfl/dyick /usr/lib/386 /lib/386 $libpth`
535     fi
536     if test ! -f "$ans"; then
537         ans=`loc Mlibc.a blurfl/dyick $libpth`
538     fi
539     if test ! -f "$ans"; then
540         ans=`loc Llibc.a blurfl/dyick $libpth`
541     fi
542     if test -f "$ans"; then
543         echo "Your C library is in $ans, of all places."
544         libc=$ans
545     else
546         if test -f "$libc"; then
547             echo "Your C library is in $libc, like you said before."
548         else
549             cat <<EOM
550  
551 I can't seem to find your C library.  I've looked in the following places:
552
553         $libpth
554
555 None of these seems to contain your C library.  What is the full name
556 EOM
557             dflt=None
558             $echo $n "of your C library? $c"
559             rp='C library full name?'
560             . myread
561             libc="$ans"
562         fi
563     fi
564 fi
565 echo " "
566 $echo $n "Extracting names from $libc for later perusal...$c"
567 nm $libc 2>/dev/null >libc.tmp
568 $sed -n -e 's/^.* [AT]  *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list
569 if $contains '^printf$' libc.list >/dev/null 2>&1; then
570     echo "done"
571 else
572     $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' <libc.tmp >libc.list
573     $contains '^printf$' libc.list >/dev/null 2>&1 || \
574         $sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list
575     $contains '^printf$' libc.list >/dev/null 2>&1 || \
576        $sed -n -e 's/^_//' \
577               -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' <libc.tmp >libc.list
578     if $contains '^printf$' libc.list >/dev/null 2>&1; then
579         echo "done"
580     else
581         echo " "
582         echo "nm didn't seem to work right."
583         echo "Trying ar instead..."
584         if ar t $libc > libc.tmp; then
585             $sed -e 's/\.o$//' < libc.tmp > libc.list
586             echo "Ok."
587         else
588             echo "ar didn't seem to work right."
589             echo "Maybe this is a Cray...trying bld instead..."
590             if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
591                 echo "Ok."
592             else
593                 echo "That didn't work either.  Giving up."
594                 exit 1
595             fi
596         fi
597     fi
598 fi
599
600 inlibc='echo " ";
601 if $contains "^$1\$" libc.list >/dev/null 2>&1;
602 then echo "$1() found"; eval "$2=$define";
603 else echo "$1() not found"; eval "$2=$undef"; fi'
604
605 rmlist="$rmlist libc.tmp libc.list"
606
607 : make some quick guesses about what we are up against
608 echo " "
609 $echo $n "Hmm...  $c"
610 cat /usr/include/signal.h /usr/include/sys/signal.h >foo
611 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
612     echo "Looks kind of like a BSD system, but we'll see..."
613     echo exit 0 >bsd
614     echo exit 1 >usg
615     echo exit 1 >v7
616 elif $contains '^fcntl$' libc.list >/dev/null 2>&1 ; then
617     echo "Looks kind of like a USG system, but we'll see..."
618     echo exit 1 >bsd
619     echo exit 0 >usg
620     echo exit 1 >v7
621 else
622     echo "Looks kind of like a version 7 system, but we'll see..."
623     echo exit 1 >bsd
624     echo exit 1 >usg
625     echo exit 0 >v7
626 fi
627 if $contains '^vmssystem$' libc.list >/dev/null 2>&1 ; then
628     cat <<'EOI'
629 There is, however, a strange, musty smell in the air that reminds me of
630 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
631 EOI
632     echo "exit 0" >eunice
633     eunicefix=unixtovms
634     d_eunice="$define"
635 : it so happens the Eunice I know will not run shell scripts in Unix format
636 else
637     echo " "
638     echo "Congratulations.  You aren't running Eunice."
639     eunicefix=':'
640     d_eunice="$undef"
641     echo "exit 1" >eunice
642 fi
643 if test -f /xenix; then
644     echo "Actually, this looks more like a XENIX system..."
645     echo "exit 0" >xenix
646 else
647     echo " "
648     echo "It's not Xenix..."
649     echo "exit 1" >xenix
650 fi
651 chmod +x xenix
652 $eunicefix xenix
653 if test -f /venix; then
654     echo "Actually, this looks more like a VENIX system..."
655     echo "exit 0" >venix
656 else
657     echo " "
658     if xenix; then
659         : null
660     else
661         echo "Nor is it Venix..."
662     fi
663     echo "exit 1" >venix
664 fi
665 chmod +x bsd usg v7 eunice venix
666 $eunicefix bsd usg v7 eunice venix
667 rm -rf foo
668 rmlist="$rmlist bsd usg v7 eunice venix xenix"
669
670 : see if sh knows # comments
671 echo " "
672 echo "Checking your sh to see if it knows about # comments..."
673 if sh -c '#' >/dev/null 2>&1 ; then
674     echo "Your sh handles # comments correctly."
675     shsharp=true
676     spitshell=cat
677     echo " "
678     echo "Okay, let's see if #! works on this system..."
679     echo "#!/bin/echo hi" > try
680     $eunicefix try
681     chmod +x try
682     try > today
683     if $contains hi today >/dev/null 2>&1; then
684         echo "It does."
685         sharpbang='#!'
686     else
687         echo "#! /bin/echo hi" > try
688         $eunicefix try
689         chmod +x try
690         try > today
691         if test -s today; then
692             echo "It does."
693             sharpbang='#! '
694         else
695             echo "It doesn't."
696             sharpbang=': use '
697         fi
698     fi
699 else
700     echo "Your sh doesn't grok # comments--I will strip them later on."
701     shsharp=false
702     echo "exec grep -v '^#'" >spitshell
703     chmod +x spitshell
704     $eunicefix spitshell
705     spitshell=`pwd`/spitshell
706     echo "I presume that if # doesn't work, #! won't work either!"
707     sharpbang=': use '
708 fi
709
710 : figure out how to guarantee sh startup
711 echo " "
712 echo "Checking out how to guarantee sh startup..."
713 startsh=$sharpbang'/bin/sh'
714 echo "Let's see if '$startsh' works..."
715 cat >try <<EOSS
716 $startsh
717 set abc
718 test "$?abc" != 1
719 EOSS
720
721 chmod +x try
722 $eunicefix try
723 if try; then
724     echo "Yup, it does."
725 else
726     echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
727 fi
728 rm -f try today
729
730 : set up shell script to do ~ expansion
731 cat >filexp <<EOSS
732 $startsh
733 : expand filename
734 case "\$1" in
735  ~/*|~)
736     echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
737     ;;
738  ~*)
739     if $test -f /bin/csh; then
740         /bin/csh -f -c "glob \$1"
741         echo ""
742     else
743         name=\`$expr x\$1 : '..\([^/]*\)'\`
744         dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
745         if $test ! -d "\$dir"; then
746             me=\`basename \$0\`
747             echo "\$me: can't locate home directory for: \$name" >&2
748             exit 1
749         fi
750         case "\$1" in
751         */*)
752             echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
753             ;;
754         *)
755             echo \$dir
756             ;;
757         esac
758     fi
759     ;;
760 *)
761     echo \$1
762     ;;
763 esac
764 EOSS
765 chmod +x filexp
766 $eunicefix filexp
767
768 : determine where public executables go
769 case "$bin" in
770 '')
771     dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
772     ;;
773 *)  dflt="$bin"
774     ;;
775 esac
776 cont=true
777 while $test "$cont" ; do
778     echo " "
779     rp="Where do you want to put the public executables? [$dflt]"
780     $echo $n "$rp $c"
781     . myread
782     bin="$ans"
783     bin=`filexp $bin`
784     if test -d $bin; then
785         cont=''
786     else
787         case "$fastread" in
788         yes) dflt=y;;
789         *) dflt=n;;
790         esac
791         rp="Directory $bin doesn't exist.  Use that name anyway? [$dflt]"
792         $echo $n "$rp $c"
793         . myread
794         dflt=''
795         case "$ans" in
796         y*) cont='';;
797         esac
798     fi
799 done
800
801 : determine where manual pages go
802 $cat <<EOM
803   
804 $package has manual pages that need to be installed in source form.
805 EOM
806 case "$mansrc" in
807 '')
808     dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1 /usr/man/man.L`
809     ;;
810 *)  dflt="$mansrc"
811     ;;
812 esac
813 cont=true
814 while $test "$cont" ; do
815     echo " "
816     rp="Where do the manual pages (source) go? [$dflt]"
817     $echo $n "$rp $c"
818     . myread
819     mansrc=`filexp "$ans"`
820     if $test -d "$mansrc"; then
821         cont=''
822     else
823         if $test "$fastread" = yes; then
824             dflt=y
825         else
826             dflt=n
827         fi
828         rp="Directory $mansrc doesn't exist.  Use that name anyway? [$dflt]"
829         $echo $n "$rp $c"
830         . myread
831         dflt=''
832         case "$ans" in
833         y*) cont='';;
834         esac
835     fi
836 done
837 case "$mansrc" in
838 *l)
839     manext=l
840     ;;
841 *n)
842     manext=n
843     ;;
844 *o)
845     manext=l
846     ;;
847 *p)
848     manext=n
849     ;;
850 *C)
851     manext=C
852     ;;
853 *L)
854     manext=L
855     ;;
856 *)
857     manext=1
858     ;;
859 esac
860
861 : see what memory models we can support
862 case "$models" in
863 '')
864     : We may not use Cppsym or we get a circular dependency through cc.
865     : But this should work regardless of which cc we eventually use.
866     cat >pdp11.c <<'EOP'
867 main() {
868 #ifdef pdp11
869     exit(0);
870 #else
871     exit(1);
872 #endif
873 }
874 EOP
875     cc -o pdp11 pdp11.c >/dev/null 2>&1
876     if pdp11 2>/dev/null; then
877         dflt='unsplit split'
878     else
879         ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
880         case "$ans" in
881         X) dflt='none';;
882         *)  if $test -d /lib/small || $test -d /usr/lib/small; then
883                 dflt='small'
884             else
885                 dflt=''
886             fi
887             if $test -d /lib/medium || $test -d /usr/lib/medium; then
888                 dflt="$dflt medium"
889             fi
890             if $test -d /lib/large || $test -d /usr/lib/large; then
891                 dflt="$dflt large"
892             fi
893             if $test -d /lib/huge || $test -d /usr/lib/huge; then
894                 dflt="$dflt huge"
895             fi
896         esac
897     fi
898     ;;
899 *)  dflt="$models" ;;
900 esac
901 $cat <<EOM
902  
903 Some systems have different model sizes.  On most systems they are called
904 small, medium, large, and huge.  On the PDP11 they are called unsplit and
905 split.  If your system doesn't support different memory models, say "none".
906 If you wish to force everything to one memory model, say "none" here and
907 put the appropriate flags later when it asks you for other cc and ld flags.
908 Venix systems may wish to put "none" and let the compiler figure things out.
909 (In the following question multiple model names should be space separated.)
910
911 EOM
912 rp="Which models are supported? [$dflt]"
913 $echo $n "$rp $c"
914 . myread
915 models="$ans"
916
917 case "$models" in
918 none)
919     small=''
920     medium=''
921     large=''
922     huge=''
923     unsplit=''
924     split=''
925     ;;
926 *split)
927     case "$split" in
928     '') 
929         if $contains '\-i' $mansrc/man1/ld.1 >/dev/null 2>&1 || \
930            $contains '\-i' $mansrc/man1/cc.1 >/dev/null 2>&1; then
931             dflt='-i'
932         else
933             dflt='none'
934         fi
935         ;;
936     *) dflt="$split";;
937     esac
938     rp="What flag indicates separate I and D space? [$dflt]"
939     $echo $n "$rp $c"
940     . myread
941     case "$ans" in
942     none) ans='';;
943     esac
944     split="$ans"
945     unsplit=''
946     ;;
947 *large*|*small*|*medium*|*huge*)
948     case "$models" in
949     *large*)
950         case "$large" in
951         '') dflt='-Ml';;
952         *) dflt="$large";;
953         esac
954         rp="What flag indicates large model? [$dflt]"
955         $echo $n "$rp $c"
956         . myread
957         case "$ans" in
958         none) ans='';
959         esac
960         large="$ans"
961         ;;
962     *) large='';;
963     esac
964     case "$models" in
965     *huge*)
966         case "$huge" in
967         '') dflt='-Mh';;
968         *) dflt="$huge";;
969         esac
970         rp="What flag indicates huge model? [$dflt]"
971         $echo $n "$rp $c"
972         . myread
973         case "$ans" in
974         none) ans='';
975         esac
976         huge="$ans"
977         ;;
978     *) huge="$large";;
979     esac
980     case "$models" in
981     *medium*)
982         case "$medium" in
983         '') dflt='-Mm';;
984         *) dflt="$medium";;
985         esac
986         rp="What flag indicates medium model? [$dflt]"
987         $echo $n "$rp $c"
988         . myread
989         case "$ans" in
990         none) ans='';
991         esac
992         medium="$ans"
993         ;;
994     *) medium="$large";;
995     esac
996     case "$models" in
997     *small*)
998         case "$small" in
999         '') dflt='none';;
1000         *) dflt="$small";;
1001         esac
1002         rp="What flag indicates small model? [$dflt]"
1003         $echo $n "$rp $c"
1004         . myread
1005         case "$ans" in
1006         none) ans='';
1007         esac
1008         small="$ans"
1009         ;;
1010     *) small='';;
1011     esac
1012     ;;
1013 *)
1014     echo "Unrecognized memory models--you may have to edit Makefile.SH"
1015     ;;
1016 esac
1017
1018 : see if we need a special compiler
1019 echo " "
1020 if usg; then
1021     case "$cc" in
1022     '')
1023         case "$Mcc" in
1024         /*) dflt='Mcc'
1025             ;;
1026         *)
1027             case "$large" in
1028             -M*)
1029                 dflt='cc'
1030                 ;;
1031             *)
1032                 if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
1033                     dflt='cc -M'
1034                 else
1035                     dflt='cc'
1036                 fi
1037                 ;;
1038             esac
1039             ;;
1040         esac
1041         ;;
1042     *)  dflt="$cc";;
1043     esac
1044     $cat <<'EOM'
1045   
1046 On some systems the default C compiler will not resolve multiple global
1047 references that happen to have the same name.  On some such systems the
1048 "Mcc" command may be used to force these to be resolved.  On other systems
1049 a "cc -M" command is required.  (Note that the -M flag on other systems
1050 indicates a memory model to use!)  If you have the Gnu C compiler, you
1051 might wish to use that instead.  What command will force resolution on
1052 EOM
1053     $echo $n "this system? [$dflt] $c"
1054     rp="Command to resolve multiple refs? [$dflt]"
1055     . myread
1056     cc="$ans"
1057 else
1058     case "$cc" in
1059     '') dflt=cc;;
1060     *) dflt="$cc";;
1061     esac
1062     rp="Use which C compiler? [$dflt]"
1063     $echo $n "$rp $c"
1064     . myread
1065     cc="$ans"
1066 fi
1067 case "$cc" in
1068 gcc*) cpp=`loc gcc-cpp $cpp $pth`;;
1069 esac
1070
1071 : determine optimize, if desired, or use for debug flag also
1072 case "$optimize" in
1073 ' ') dflt="none"
1074      ;;
1075 '') dflt="-O";
1076     ;;
1077 *)  dflt="$optimize"
1078     ;;
1079 esac
1080 cat <<EOH
1081 Some C compilers have problems with their optimizers, by default, $package
1082 compiles with the -O flag to use the optimizer.  Alternately, you might
1083 want to use the symbolic debugger, which uses the -g flag (on traditional
1084 Unix systems).  Either flag can be specified here.  To use neither flag,
1085 specify the word "none".
1086   
1087 EOH
1088 rp="What optimizer/debugger flag should be used? [$dflt]"
1089 $echo $n "$rp $c"
1090 . myread
1091 optimize="$ans"
1092 case "$optimize" in
1093 'none') optimize=" "
1094      ;;
1095 esac
1096
1097 case "$ccflags" in
1098 '') case "$cc" in
1099     gcc) dflt='-fpcc-struct-return';;
1100     *) dflt='none';;
1101     esac
1102     ;;
1103 *) dflt="$ccflags";;
1104 esac
1105 echo " "
1106 rp="Any additional cc flags? [$dflt]"
1107 $echo $n "$rp $c"
1108 . myread
1109 case "$ans" in
1110 none) ans='';
1111 esac
1112 ccflags="$ans"
1113
1114 case "$ldflags" in
1115 '') if venix; then
1116         dflt='-i -z'
1117     else
1118         dflt='none'
1119     fi
1120     ;;
1121 *) dflt="$ldflags";;
1122 esac
1123 echo " "
1124 rp="Any additional ld flags (NOT including libraries)? [$dflt]"
1125 $echo $n "$rp $c"
1126 . myread
1127 case "$ans" in
1128 none) ans='';
1129 esac
1130 ldflags="$ans"
1131 rmlist="$rmlist pdp11"
1132
1133 case "$libs" in
1134 '') dflt='none';;
1135 *) dflt="$libs";;
1136 esac
1137
1138 $cat <<EOM
1139  
1140 Some versions of Unix support shared libraries, which make
1141 executables smaller but make load time slightly longer.
1142
1143 On some systems, mostly newer Unix System V's, the shared library
1144 is included by putting the option "-lc_s" as the last thing on the
1145 cc command line when linking.  Other systems use shared libraries
1146 by default.  There may be other libraries needed to compile $package
1147 on your machine as well.  If your system needs the "-lc_s" option,
1148 include it here.  Include any other special libraries here as well.
1149 EOM
1150
1151 echo " "
1152 rp="Any additional libraries? [$dflt]"
1153 $echo $n "$rp $c"
1154 . myread
1155 case "$ans" in
1156 none) ans='';
1157 esac
1158 libs="$ans"
1159
1160 : check for ordering of bytes in a long
1161 case "$byteorder" in
1162 '')
1163 cat <<'EOM'
1164   
1165 In the following, larger digits indicate more significance.  A big-endian
1166 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321.  A
1167 little-endian machine like a Vax or an Intel 80?86 chip would be 1234.  Other
1168 machines may have weird orders like 3412.  If the test program works the
1169 default is probably right.  I'm now running the test program...
1170 EOM
1171     $cat >try.c <<'EOCP'
1172 #include <stdio.h>
1173 main()
1174 {
1175     int i;
1176     union {
1177         unsigned long l;
1178         char c[4];
1179     } u;
1180
1181     u.l = 0x04030201;
1182     printf("%c%c%c%c\n", u.c[0]+'0', u.c[1]+'0', u.c[2]+'0', u.c[3]+'0');
1183 }
1184 EOCP
1185     if $cc try.c -o try >/dev/null 2>&1 ; then
1186         dflt=`try`
1187         case "$dflt" in
1188         ????) echo "(The test program ran ok.)";;
1189         *) echo "(The test program didn't run right for some reason.)";;
1190         esac
1191     else
1192         dflt='4321'
1193         echo "(I can't seem to compile the test program.  Guessing big-endian...)"
1194     fi
1195     ;;
1196 *)
1197     echo " "
1198     dflt="$byteorder"
1199     ;;
1200 esac
1201 rp="What is the order of bytes in a long? [$dflt]"
1202 $echo $n "$rp $c"
1203 . myread
1204 byteorder="$ans"
1205 $rm -f try.c try
1206
1207 : see how we invoke the C preprocessor
1208 echo " "
1209 echo "Now, how can we feed standard input to your C preprocessor..."
1210 cat <<'EOT' >testcpp.c
1211 #define ABC abc
1212 #define XYZ xyz
1213 ABC.XYZ
1214 EOT
1215 echo 'Maybe "'"$cc"' -E" will work...'
1216 $cc -E <testcpp.c >testcpp.out 2>&1
1217 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1218     echo "Yup, it does."
1219     cppstdin="$cc -E"
1220     cppminus='';
1221 else
1222     echo 'Nope, maybe "'$cpp'" will work...'
1223     $cpp <testcpp.c >testcpp.out 2>&1
1224     if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1225         echo "Yup, it does."
1226         cppstdin="$cpp"
1227         cppminus='';
1228     else
1229         echo 'No such luck...maybe "'$cpp' -" will work...'
1230         $cpp - <testcpp.c >testcpp.out 2>&1
1231         if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1232             echo "It works!"
1233             cppstdin="$cpp"
1234             cppminus='-';
1235         else
1236             echo 'Nixed again...maybe "'"$cc"' -E -" will work...'
1237             $cc -E - <testcpp.c >testcpp.out 2>&1
1238             if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1239                 echo "Hooray, it works!  I was beginning to wonder."
1240                 cppstdin="$cc -E"
1241                 cppminus='-';
1242             else
1243                 echo 'Nope...maybe "'"$cc"' -P" will work...'
1244                 $cc -P <testcpp.c >testcpp.out 2>&1
1245                 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1246                     echo "Yup, that does."
1247                     cppstdin="$cc -P"
1248                     cppminus='';
1249                 else
1250                     echo 'Nope...maybe "'"$cc"' -P -" will work...'
1251                     $cc -P - <testcpp.c >testcpp.out 2>&1
1252                     if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1253                         echo "Yup, that does."
1254                         cppstdin="$cc -P"
1255                         cppminus='-';
1256                     else
1257                         echo 'Hmm...perhaps you already told me...'
1258                         case "$cppstdin" in
1259                         '') ;;
1260                         *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
1261                         esac
1262                         if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1263                             echo "Hooray, you did!  I was beginning to wonder."
1264                         else
1265                             echo 'Uh-uh.  Time to get fancy...'
1266                             cd ..
1267                             echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
1268                             echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
1269                             chmod 755 cppstdin
1270                             cppstdin=`pwd`/cppstdin
1271                             cppminus='';
1272                             cd UU
1273                             $cppstdin <testcpp.c >testcpp.out 2>&1
1274                             if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1275                                 echo "Eureka!."
1276                             else
1277                                 dflt=blurfl
1278                                 $echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
1279                                 rp='Name a C preprocessor:'
1280                                 . myread
1281                                 cppstdin="$ans"
1282                                 $cppstdin <testcpp.c >testcpp.out 2>&1
1283                                 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
1284                                     echo "OK, that will do."
1285                                 else
1286                                     echo "Sorry, I can't get that to work.  Go find one."
1287                                     exit 1
1288                                 fi
1289                             fi
1290                         fi
1291                     fi
1292                 fi
1293             fi
1294         fi
1295     fi
1296 fi
1297 rm -f testcpp.c testcpp.out
1298
1299 : see if bcmp exists
1300 set bcmp d_bcmp
1301 eval $inlibc
1302
1303 : see if bcopy exists
1304 set bcopy d_bcopy
1305 eval $inlibc
1306
1307 : see if sprintf is declared as int or pointer to char
1308 echo " "
1309 cat >.ucbsprf.c <<'EOF'
1310 main() { char buf[10]; exit((unsigned long)sprintf(buf,"%s","foo") > 10L); }
1311 EOF
1312 if $cc $ccflags .ucbsprf.c -o .ucbsprf >/dev/null 2>&1 && .ucbsprf; then
1313     echo "Your sprintf() returns (int)."
1314     d_charsprf="$undef"
1315 else
1316     echo "Your sprintf() returns (char*)."
1317     d_charsprf="$define"
1318 fi
1319 /bin/rm -f .ucbsprf.c .ucbsprf
1320
1321 : see if vprintf exists
1322 echo " "
1323 if $contains '^vprintf$' libc.list >/dev/null 2>&1; then
1324     echo 'vprintf() found.'
1325     d_vprintf="$define"
1326     cat >.ucbsprf.c <<'EOF'
1327 #include <varargs.h>
1328
1329 main() { xxx("foo"); }
1330
1331 xxx(va_alist)
1332 va_dcl
1333 {
1334     va_list args;
1335     char buf[10];
1336
1337     va_start(args);
1338     exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
1339 }
1340 EOF
1341     if $cc $ccflags .ucbsprf.c -o .ucbsprf >/dev/null 2>&1 && .ucbsprf; then
1342         echo "Your vsprintf() returns (int)."
1343         d_charvspr="$undef"
1344     else
1345         echo "Your vsprintf() returns (char*)."
1346         d_charvspr="$define"
1347     fi
1348     /bin/rm -f .ucbsprf.c .ucbsprf
1349 else
1350     echo 'vprintf() not found.'
1351     d_vprintf="$undef"
1352     d_charvspr="$undef"
1353 fi
1354
1355 : see if crypt exists
1356 echo " "
1357 if $contains '^crypt$' libc.list >/dev/null 2>&1; then
1358     echo 'crypt() found.'
1359     d_crypt="$define"
1360     cryptlib=''
1361 else
1362     cryptlib=`loc Slibcrypt.a "" /lib/386 /lib`
1363     if $test -z "$cryptlib"; then
1364         cryptlib=`loc Mlibcrypt.a "" /lib/386 /lib`
1365     else
1366         cryptlib=-lcrypt
1367     fi
1368     if $test -z "$cryptlib"; then
1369         cryptlib=`loc Llibcrypt.a "" /lib/386 /lib`
1370     else
1371         cryptlib=-lcrypt
1372     fi
1373     if $test -z "$cryptlib"; then
1374         cryptlib=`loc libcrypt.a "" $libpth`
1375     else
1376         cryptlib=-lcrypt
1377     fi
1378     if $test -z "$cryptlib"; then
1379         echo 'crypt() not found.'
1380         d_crypt="$undef"
1381     else
1382         d_crypt="$define"
1383     fi
1384 fi
1385
1386 : see if this is a dirent system
1387 echo " "
1388 if $test -r /usr/include/dirent.h ; then
1389     i_dirent="$define"
1390     echo "dirent.h found."
1391     if $contains 'd_namlen' /usr/include/sys/dirent.h >/dev/null 2>&1; then
1392         d_dirnamlen="$define"
1393     else
1394         d_dirnamlen="$undef"
1395     fi
1396 else
1397     i_dirent="$undef"
1398     d_dirnamlen="$define"
1399     echo "No dirent.h found."
1400 fi
1401
1402 : now see if they want to do setuid emulation
1403 case "$d_dosuid" in
1404 '') dflt=n;;
1405 *undef*) dflt=n;;
1406 *) dflt=y;;
1407 esac
1408 cat <<EOM
1409  
1410 Some sites have disabled setuid #! scripts because of a bug in the kernel
1411 that prevents them from being secure.  If you are on such a system, the
1412 setuid/setgid bits on scripts are currently useless.  It is possible for
1413 $package to detect those bits and emulate setuid/setgid in a secure fashion
1414 until a better solution is devised for the kernel problem.
1415
1416 EOM
1417 rp="Do you want to do setuid/setgid emulation? [$dflt]"
1418 echo $n "$rp $c"
1419 . myread
1420 case "$ans" in
1421 '') $ans="$dflt";;
1422 esac
1423 case "$ans" in
1424 y*)  d_dosuid="$define";;
1425 *) d_dosuid="$undef";;
1426 esac
1427
1428 : see if dup2 exists
1429 set dup2 d_dup2
1430 eval $inlibc
1431
1432 : see if fchmod exists
1433 set fchmod d_fchmod
1434 eval $inlibc
1435
1436 : see if fchown exists
1437 set fchown d_fchown
1438 eval $inlibc
1439
1440 : see if this is an fcntl system
1441 echo " "
1442 if $test -r /usr/include/fcntl.h ; then
1443     d_fcntl="$define"
1444     echo "fcntl.h found."
1445 else
1446     d_fcntl="$undef"
1447     echo "No fcntl.h found, but that's ok."
1448 fi
1449
1450 : see if flock exists
1451 set flock d_flock
1452 eval $inlibc
1453
1454 : see if getgroups exists
1455 set getgroups d_getgrps
1456 eval $inlibc
1457
1458 : see if gethostent exists
1459 set gethostent d_gethent
1460 eval $inlibc
1461
1462 : see if getpgrp exists
1463 set getpgrp d_getpgrp
1464 eval $inlibc
1465
1466 : see if getpriority exists
1467 set getpriority d_getprior
1468 eval $inlibc
1469
1470 : see if htonl exists
1471 set htonl d_htonl
1472 eval $inlibc
1473
1474 : index or strcpy
1475 echo " "
1476 case "$d_index" in
1477 n) dflt=n;;
1478 *) dflt=y;;
1479 esac
1480 if $contains '^index$' libc.list >/dev/null 2>&1 ; then
1481     if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
1482         echo "Your system has both index() and strchr().  Shall I use"
1483         rp="index() rather than strchr()? [$dflt]"
1484         $echo $n "$rp $c"
1485         . myread
1486         case "$ans" in
1487             n*) d_index="$define" ;;
1488             *)  d_index="$undef" ;;
1489         esac
1490     else
1491         d_index="$undef"
1492         echo "index() found."
1493     fi
1494 else
1495     if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
1496         d_index="$define"
1497         echo "strchr() found."
1498     else
1499         echo "No index() or strchr() found!"
1500         d_index="$undef"
1501     fi
1502 fi
1503
1504 : see if ioctl defs are in sgtty/termio or sys/ioctl
1505 echo " "
1506 if $test -r /usr/include/sys/ioctl.h ; then
1507     d_ioctl="$define"
1508     echo "sys/ioctl.h found."
1509 else
1510     d_ioctl="$undef"
1511     echo "sys/ioctl.h not found, assuming ioctl args are defined in sgtty.h."
1512 fi
1513
1514 : see if killpg exists
1515 set killpg d_killpg
1516 eval $inlibc
1517
1518 : see if memcmp exists
1519 set memcmp d_memcmp
1520 eval $inlibc
1521
1522 : see if memcpy exists
1523 set memcpy d_memcpy
1524 eval $inlibc
1525
1526 : see if mkdir exists
1527 set mkdir d_mkdir
1528 eval $inlibc
1529
1530 : see if ndbm is available
1531 echo " "
1532 if $test -r /usr/include/ndbm.h || $test -r /usr/local/include/ndbm.h; then
1533     d_ndbm="$define"
1534     echo "ndbm.h found."
1535 else
1536     d_ndbm="$undef"
1537     echo "ndbm.h not found."
1538 fi
1539
1540 : see if we have the old dbm
1541 echo " "
1542 if $test -r /usr/include/dbm.h ; then
1543     d_odbm="$define"
1544     echo "dbm.h found."
1545 else
1546     d_odbm="$undef"
1547     echo "dbm.h not found."
1548 fi
1549
1550 : see if this is a pwd system
1551 echo " "
1552 if $test -r /usr/include/pwd.h ; then
1553     i_pwd="$define"
1554     echo "pwd.h found."
1555     if $contains 'pw_quota' /usr/include/pwd.h >/dev/null 2>&1; then
1556         d_pwquota="$define"
1557     else
1558         d_pwquota="$undef"
1559     fi
1560     if $contains 'pw_age' /usr/include/pwd.h >/dev/null 2>&1; then
1561         d_pwage="$define"
1562     else
1563         d_pwage="$undef"
1564     fi
1565     if $contains 'pw_change' /usr/include/pwd.h >/dev/null 2>&1; then
1566         d_pwchange="$define"
1567     else
1568         d_pwchange="$undef"
1569     fi
1570     if $contains 'pw_class' /usr/include/pwd.h >/dev/null 2>&1; then
1571         d_pwclass="$define"
1572     else
1573         d_pwclass="$undef"
1574     fi
1575     if $contains 'pw_expire' /usr/include/pwd.h >/dev/null 2>&1; then
1576         d_pwexpire="$define"
1577     else
1578         d_pwexpire="$undef"
1579     fi
1580 else
1581     i_pwd="$undef"
1582     d_pwquota="$undef"
1583     d_pwage="$undef"
1584     d_pwchange="$undef"
1585     d_pwclass="$undef"
1586     d_pwexpire="$undef"
1587     echo "No pwd.h found."
1588 fi
1589
1590 : see if readdir exists
1591 set readdir d_readdir
1592 eval $inlibc
1593
1594 : see if rename exists
1595 set rename d_rename
1596 eval $inlibc
1597
1598 : see if rmdir exists
1599 set rmdir d_rmdir
1600 eval $inlibc
1601
1602 : see if setegid exists
1603 set setegid d_setegid
1604 eval $inlibc
1605
1606 : see if seteuid exists
1607 set seteuid d_seteuid
1608 eval $inlibc
1609
1610 : see if setpgrp exists
1611 set setpgrp d_setpgrp
1612 eval $inlibc
1613
1614 : see if setpriority exists
1615 set setpriority d_setprior
1616 eval $inlibc
1617
1618 : see if setregid exists
1619 set setregid d_setregid
1620 eval $inlibc
1621 set setresgid d_setresgid
1622 eval $inlibc
1623
1624 : see if setreuid exists
1625 set setreuid d_setreuid
1626 eval $inlibc
1627 set setresuid d_setresuid
1628 eval $inlibc
1629
1630 : see if setrgid exists
1631 set setrgid d_setrgid
1632 eval $inlibc
1633
1634 : see if setruid exists
1635 set setruid d_setruid
1636 eval $inlibc
1637
1638 socketlib=''
1639 sockethdr=''
1640 : see whether socket exists
1641 echo " "
1642 if $contains socket libc.list >/dev/null 2>&1; then
1643     echo "Looks like you have Berkeley networking support."
1644     d_socket="$define"
1645     : now check for advanced features
1646     if $contains setsockopt libc.list >/dev/null 2>&1; then
1647         d_oldsock="$undef"
1648     else
1649         echo "...but it uses the old 4.1c interface, rather than 4.2"
1650         d_oldsock="$define"
1651     fi
1652 else
1653     : hpux, for one, puts all the socket stuff in socklib.o
1654     if $contains socklib libc.list >/dev/null 2>&1; then
1655         echo "Looks like you have Berkeley networking support."
1656         d_socket="$define"
1657         : we will have to assume that it supports the 4.2 BSD interface
1658         d_oldsock="$undef"
1659     else
1660         echo "Hmmm...you don't have Berkeley networking in libc.a..."
1661         : look for an optional networking library
1662         if test -f /usr/lib/libnet.a; then
1663             (ar t /usr/lib/libnet.a ||
1664                 nm -g /usr/lib/libnet.a) 2>/dev/null >> libc.list
1665             if $contains socket libc.list >/dev/null 2>&1; then
1666                 echo "but the Wollongong group seems to have hacked it in."
1667                 socketlib="-lnet"
1668                 sockethdr="-I/usr/netinclude"
1669                 d_socket="$define"
1670                 : now check for advanced features
1671                 if $contains setsockopt libc.list >/dev/null 2>&1; then
1672                     d_oldsock="$undef"
1673                 else
1674                     echo "...using the old 4.1c interface, rather than 4.2"
1675                     d_oldsock="$define"
1676                 fi
1677             else
1678                 echo "or even in libnet.a, which is peculiar."
1679                 d_socket="$undef"
1680                 d_oldsock="$undef"
1681             fi
1682         else
1683             echo "or anywhere else I see."
1684             d_socket="$undef"
1685             d_oldsock="$undef"
1686         fi
1687     fi
1688 fi
1689 if $contains socketpair libc.list >/dev/null 2>&1; then
1690     d_sockpair="$define"
1691 else
1692     d_sockpair="$undef"
1693 fi
1694
1695 : see if stat knows about block sizes
1696 echo " "
1697 if $contains 'st_blocks;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then
1698     if $contains 'st_blksize;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then
1699         echo "Your stat knows about block sizes."
1700         d_statblks="$define"
1701     else
1702         echo "Your stat doesn't know about block sizes."
1703         d_statblks="$undef"
1704     fi
1705 else
1706     echo "Your stat doesn't know about block sizes."
1707     d_statblks="$undef"
1708 fi
1709
1710 : see if stdio is really std
1711 echo " "
1712 if $contains 'char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then
1713     if $contains '_cnt;' /usr/include/stdio.h >/dev/null 2>&1 ; then
1714         echo "Your stdio is pretty std."
1715         d_stdstdio="$define"
1716     else
1717         echo "Your stdio isn't very std."
1718         d_stdstdio="$undef"
1719     fi
1720 else
1721     echo "Your stdio isn't very std."
1722     d_stdstdio="$undef"
1723 fi
1724
1725 : check for structure copying
1726 echo " "
1727 echo "Checking to see if your C compiler can copy structs..."
1728 $cat >try.c <<'EOCP'
1729 main()
1730 {
1731         struct blurfl {
1732             int dyick;
1733         } foo, bar;
1734
1735         foo = bar;
1736 }
1737 EOCP
1738 if $cc -c try.c >/dev/null 2>&1 ; then
1739     d_strctcpy="$define"
1740     echo "Yup, it can."
1741 else
1742     d_strctcpy="$undef"
1743     echo "Nope, it can't."
1744 fi
1745 $rm -f try.*
1746
1747 : see if symlink exists
1748 set symlink d_symlink
1749 eval $inlibc
1750
1751 : see if syscall exists
1752 set syscall d_syscall
1753 eval $inlibc
1754
1755 : see if struct tm is defined in sys/time.h
1756 echo " "
1757 if $contains 'struct tm' /usr/include/time.h >/dev/null 2>&1 ; then
1758     echo "You have struct tm defined in <time.h> rather than <sys/time.h>."
1759     d_tminsys="$undef"
1760     if test -f /usr/include/sys/time.h; then
1761         i_systime="$define"
1762     else
1763         i_systime="$undef"
1764     fi
1765 else
1766     echo "You have struct tm defined in <sys/time.h> rather than <time.h>."
1767     d_tminsys="$define"
1768     i_systime="$define"
1769 fi
1770
1771 : see if this is a varargs system
1772 echo " "
1773 if $test -r /usr/include/varargs.h ; then
1774     d_varargs="$define"
1775     echo "varargs.h found."
1776 else
1777     d_varargs="$undef"
1778     echo "No varargs.h found, but that's ok (I hope)."
1779 fi
1780
1781 : see if there is a vfork
1782 set vfork d_vfork
1783 eval $inlibc
1784
1785 : see if signal is declared as pointer to function returning int or void
1786 echo " "
1787 if $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 ; then
1788     echo "You have void (*signal())() instead of int."
1789     d_voidsig="$define"
1790 else
1791     echo "You have int (*signal())() instead of void."
1792     d_voidsig="$undef"
1793 fi
1794
1795 : check for void type
1796 echo " "
1797 $cat <<EOM
1798 Checking to see how well your C compiler groks the void type...
1799
1800   Support flag bits are:
1801     1: basic void declarations.
1802     2: arrays of pointers to functions returning void.
1803     4: operations between pointers to and addresses of void functions.
1804
1805 EOM
1806 case "$voidflags" in
1807 '')
1808     $cat >try.c <<'EOCP'
1809 #if TRY & 1
1810 void main() {
1811 #else
1812 main() {
1813 #endif
1814         extern void moo();      /* function returning void */
1815         void (*goo)();          /* ptr to func returning void */
1816 #if TRY & 2
1817         void (*foo[10])();
1818 #endif
1819
1820 #if TRY & 4
1821         if(goo == moo) {
1822                 exit(0);
1823         }
1824 #endif
1825         exit(0);
1826 }
1827 EOCP
1828     if $cc -S -DTRY=$defvoidused try.c >.out 2>&1 ; then
1829         voidflags=$defvoidused
1830         echo "It appears to support void."
1831         if $contains warning .out >/dev/null 2>&1; then
1832             echo "However, you might get some warnings that look like this:"
1833             $cat .out
1834         fi
1835     else
1836         echo "Hmm, your compiler has some difficulty with void.  Checking further..."
1837         if $cc -S -DTRY=1 try.c >/dev/null 2>&1 ; then
1838             echo "It supports 1..."
1839             if $cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then
1840                 voidflags=3
1841                 echo "And it supports 2 but not 4."
1842             else
1843                 echo "It doesn't support 2..."
1844                 if $cc -S -DTRY=5 try.c >/dev/null 2>&1 ; then
1845                     voidflags=5
1846                     echo "But it supports 4."
1847                 else
1848                     voidflags=1
1849                     echo "And it doesn't support 4."
1850                 fi
1851             fi
1852         else
1853             echo "There is no support at all for void."
1854             voidflags=0
1855         fi
1856     fi
1857 esac
1858 dflt="$voidflags";
1859 rp="Your void support flags add up to what? [$dflt]"
1860 $echo $n "$rp $c"
1861 . myread
1862 voidflags="$ans"
1863 $rm -f try.* .out
1864
1865 : see what type gids are declared as in the kernel
1866 case "$gidtype" in
1867 '')
1868     if $contains 'gid_t;' /usr/include/sys/types.h >/dev/null 2>&1 ; then
1869         dflt='gid_t';
1870     else
1871         set `grep 'groups\[NGROUPS\];' /usr/include/sys/user.h 2>/dev/null` unsigned short
1872         case $1 in
1873         unsigned) dflt="$1 $2" ;;
1874         *) dflt="$1" ;;
1875         esac
1876     fi
1877     ;;
1878 *)  dflt="$gidtype"
1879     ;;
1880 esac
1881 cont=true
1882 echo " "
1883 rp="What type are the group ids are returned by getgroups()? [$dflt]"
1884 $echo $n "$rp $c"
1885 . myread
1886 gidtype="$ans"
1887
1888 : see if this is an fcntl system
1889 echo " "
1890 if $test -r /usr/include/fcntl.h ; then
1891     i_fcntl="$define"
1892     echo "fcntl.h found."
1893 else
1894     i_fcntl="$undef"
1895     echo "No fcntl.h found, but that's ok."
1896 fi
1897
1898 : see if this is an grp system
1899 echo " "
1900 if $test -r /usr/include/grp.h ; then
1901     i_grp="$define"
1902     echo "grp.h found."
1903 else
1904     i_grp="$undef"
1905     echo "No grp.h found."
1906 fi
1907
1908 : see if this is a netinet/in.h system
1909 echo " "
1910 if $test -r /usr/include/netinet/in.h ; then
1911     i_niin="$define"
1912     echo "netinet/in.h found."
1913 else
1914     i_niin="$undef"
1915     echo "No netinet/in.h found."
1916 fi
1917
1918 : see if this is a sys/dir.h system
1919 echo " "
1920 if $test -r /usr/include/sys/dir.h ; then
1921     i_sysdir="$define"
1922     echo "sysdir.h found."
1923 else
1924     i_sysdir="$undef"
1925     echo "No sysdir.h found."
1926 fi
1927
1928 : see if ioctl defs are in sgtty/termio or sys/ioctl
1929 echo " "
1930 if $test -r /usr/include/sys/ioctl.h ; then
1931     i_sysioctl="$define"
1932     echo "sys/ioctl.h found."
1933 else
1934     i_sysioctl="$undef"
1935     echo "sys/ioctl.h not found, assuming ioctl args are defined in sgtty.h."
1936 fi
1937
1938 : see if this is a varargs system
1939 echo " "
1940 if $test -r /usr/include/varargs.h ; then
1941     i_varargs="$define"
1942     echo "varargs.h found."
1943 else
1944     i_varargs="$undef"
1945     echo "No varargs.h found, but that's ok (I hope)."
1946 fi
1947
1948 : see if this is a vfork system
1949 echo " "
1950 if $test -r /usr/include/vfork.h ; then
1951     i_vfork="$define"
1952     echo "vfork.h found."
1953 else
1954     i_vfork="$undef"
1955     echo "No vfork.h found."
1956 fi
1957
1958 : check for length of integer
1959 echo " "
1960 case "$intsize" in
1961 '')
1962     echo "Checking to see how big your integers are..."
1963     $cat >try.c <<'EOCP'
1964 #include <stdio.h>
1965 main()
1966 {
1967     printf("%d\n", sizeof(int));
1968 }
1969 EOCP
1970     if $cc try.c -o try >/dev/null 2>&1 ; then
1971         dflt=`try`
1972     else
1973         dflt='4'
1974         echo "(I can't seem to compile the test program.  Guessing...)"
1975     fi
1976     ;;
1977 *)
1978     dflt="$intsize"
1979     ;;
1980 esac
1981 rp="What is the size of an integer (in bytes)? [$dflt]"
1982 $echo $n "$rp $c"
1983 . myread
1984 intsize="$ans"
1985 $rm -f try.c try
1986
1987 : determine where private executables go
1988 case "$privlib" in
1989 '')
1990     dflt=/usr/lib/$package
1991     test -d /usr/local/lib && dflt=/usr/local/lib/$package
1992     ;;
1993 *)  dflt="$privlib"
1994     ;;
1995 esac
1996 $cat <<EOM
1997
1998 The $package package has some auxiliary files that should be put in a library
1999 that is accessible by everyone.  Where do you want to put these "private"
2000 EOM
2001 $echo $n "but accessible files? [$dflt] $c"
2002 rp="Put private files where? [$dflt]"
2003 . myread
2004 privlib="$ans"
2005
2006 : check for size of random number generator
2007 echo " "
2008 case "$randbits" in
2009 '')
2010     echo "Checking to see how many bits your rand function produces..."
2011     $cat >try.c <<'EOCP'
2012 #include <stdio.h>
2013 main()
2014 {
2015     register int i;
2016     register unsigned long tmp;
2017     register unsigned long max = 0L;
2018
2019     for (i=1000; i; i--) {
2020         tmp = (unsigned long)rand();
2021         if (tmp > max) max = tmp;
2022     }
2023     for (i=0; max; i++)
2024         max /= 2;
2025     printf("%d\n",i);
2026 }
2027 EOCP
2028     if $cc try.c -o try >/dev/null 2>&1 ; then
2029         dflt=`try`
2030     else
2031         dflt='?'
2032         echo "(I can't seem to compile the test program...)"
2033     fi
2034     ;;
2035 *)
2036     dflt="$randbits"
2037     ;;
2038 esac
2039 rp="How many bits does your rand() function produce? [$dflt]"
2040 $echo $n "$rp $c"
2041 . myread
2042 randbits="$ans"
2043 $rm -f try.c try
2044
2045 : generate list of signal names
2046 echo " "
2047 case "$sig_name" in
2048 '')
2049     echo "Generating a list of signal names..."
2050     set X `kill -l 2>/dev/null`
2051     shift
2052     case $# in
2053     0)  echo 'kill -l' >/tmp/foo$$
2054         set X `/bin/csh -f </tmp/foo$$`
2055         shift
2056         case $# in
2057         0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
2058             ;;
2059         esac
2060         ;;
2061     esac
2062     sig_name="ZERO $*"
2063     ;;
2064 esac
2065 echo "Signals are: $sig_name"
2066
2067 : see what type of char stdio uses.
2068 echo " "
2069 if $contains 'unsigned.*char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then
2070     echo "Your stdio uses unsigned chars."
2071     stdchar="unsigned char"
2072 else
2073     echo "Your stdio uses signed chars."
2074     stdchar="char"
2075 fi
2076
2077 : see what type uids are declared as in the kernel
2078 case "$uidtype" in
2079 '')
2080     if $contains 'uid_t;' /usr/include/sys/types.h >/dev/null 2>&1 ; then
2081         dflt='uid_t';
2082     else
2083         set `grep '_ruid;' /usr/include/sys/user.h 2>/dev/null` unsigned short
2084         case $1 in
2085         unsigned) dflt="$1 $2" ;;
2086         *) dflt="$1" ;;
2087         esac
2088     fi
2089     ;;
2090 *)  dflt="$uidtype"
2091     ;;
2092 esac
2093 cont=true
2094 echo " "
2095 rp="What type are user ids returned by getuid(), etc.? [$dflt]"
2096 $echo $n "$rp $c"
2097 . myread
2098 uidtype="$ans"
2099
2100 : preserve RCS keywords in files with variable substitution, grrr
2101 Log='$Log'
2102 Header='$Header'
2103
2104
2105 : see if we should include -ldbm
2106 echo " "
2107 if $test -r /usr/lib/libdbm.a || $test -r /usr/local/lib/libdbm.a ; then
2108     echo "-ldbm found."
2109     libdbm='-ldbm'
2110 else
2111     ans=`loc libdbm.a x $libpth`
2112     case "$ans" in
2113     x)
2114         echo "No dbm library found."
2115         libdbm=''
2116         ;;
2117     *)
2118         echo "DBM library found in $ans."
2119         libdbm="$ans"
2120         ;;
2121     esac
2122 fi
2123
2124 : see if we should include -lndir
2125 echo " "
2126 if $test -r /usr/lib/libndir.a || $test -r /usr/local/lib/libndir.a ; then
2127     echo "New directory library found."
2128     libndir='-lndir'
2129 else
2130     ans=`loc libndir.a x $libpth`
2131     case "$ans" in
2132     x)
2133         echo "No ndir library found."
2134         libndir=''
2135         ;;
2136     *)
2137         echo "New directory library found in $ans."
2138         libndir="$ans"
2139         ;;
2140     esac
2141 fi
2142 case "$libndir" in
2143 '') ;;
2144 *)
2145     case "$d_readdir" in
2146     $define)
2147         echo "Since you have readdir in the C library, I'll ignore $libndir"
2148         libndir=''
2149         ;;
2150     esac
2151     ;;
2152 esac
2153
2154 : see if we should include -lnm
2155 echo " "
2156 if $test -r /usr/lib/libnm.a || $test -r /usr/local/lib/libnm.a ; then
2157     echo "New math library found."
2158     libnm='-lnm'
2159 else
2160     ans=`loc libnm.a x $libpth`
2161     case "$ans" in
2162     x)
2163         echo "No nm library found--the normal math library will have to do."
2164         libnm=''
2165         ;;
2166     *)
2167         echo "New math library found in $ans."
2168         libnm="$ans"
2169         ;;
2170     esac
2171 fi
2172
2173 : determine which malloc to compile in
2174 echo " "
2175 case "$usemymalloc" in
2176 '')
2177     if bsd || v7; then
2178         dflt='y'
2179     else
2180         dflt='n'
2181     fi
2182     ;;
2183 *)  dflt="$usemymalloc"
2184     ;;
2185 esac
2186 rp="Do you wish to attempt to use the malloc that comes with $package? [$dflt]"
2187 $echo $n "$rp $c"
2188 . myread
2189 case "$ans" in
2190 '') ans=$dflt;;
2191 esac
2192 usemymalloc="$ans"
2193 case "$ans" in
2194 y*) mallocsrc='malloc.c'; mallocobj='malloc.o';;
2195 *) mallocsrc=''; mallocobj='';;
2196 esac
2197
2198 echo " "
2199 echo "End of configuration questions."
2200 echo " "
2201
2202 : create config.sh file
2203 echo " "
2204 if test -d ../UU; then
2205     cd ..
2206 fi
2207 echo "Creating config.sh..."
2208 $spitshell <<EOT >config.sh
2209 $startsh
2210 # config.sh
2211 # This file was produced by running the Configure script.
2212
2213 d_eunice='$d_eunice'
2214 eunicefix='$eunicefix'
2215 define='$define'
2216 loclist='$loclist'
2217 expr='$expr'
2218 sed='$sed'
2219 echo='$echo'
2220 cat='$cat'
2221 rm='$rm'
2222 mv='$mv'
2223 cp='$cp'
2224 tail='$tail'
2225 tr='$tr'
2226 mkdir='$mkdir'
2227 sort='$sort'
2228 uniq='$uniq'
2229 grep='$grep'
2230 trylist='$trylist'
2231 test='$test'
2232 inews='$inews'
2233 egrep='$egrep'
2234 more='$more'
2235 pg='$pg'
2236 Mcc='$Mcc'
2237 vi='$vi'
2238 mailx='$mailx'
2239 mail='$mail'
2240 cpp='$cpp'
2241 perl='$perl'
2242 emacs='$emacs'
2243 ls='$ls'
2244 rmail='$rmail'
2245 sendmail='$sendmail'
2246 shar='$shar'
2247 smail='$smail'
2248 tbl='$tbl'
2249 troff='$troff'
2250 nroff='$nroff'
2251 uname='$uname'
2252 uuname='$uuname'
2253 line='$line'
2254 chgrp='$chgrp'
2255 chmod='$chmod'
2256 lint='$lint'
2257 sleep='$sleep'
2258 pr='$pr'
2259 tar='$tar'
2260 ln='$ln'
2261 lpr='$lpr'
2262 lp='$lp'
2263 touch='$touch'
2264 make='$make'
2265 date='$date'
2266 Log='$Log'
2267 Header='$Header'
2268 bin='$bin'
2269 byteorder='$byteorder'
2270 contains='$contains'
2271 cppstdin='$cppstdin'
2272 cppminus='$cppminus'
2273 d_bcmp='$d_bcmp'
2274 d_bcopy='$d_bcopy'
2275 d_charsprf='$d_charsprf'
2276 d_crypt='$d_crypt'
2277 cryptlib='$cryptlib'
2278 d_dosuid='$d_dosuid'
2279 d_dup2='$d_dup2'
2280 d_fchmod='$d_fchmod'
2281 d_fchown='$d_fchown'
2282 d_fcntl='$d_fcntl'
2283 d_flock='$d_flock'
2284 d_getgrps='$d_getgrps'
2285 d_gethent='$d_gethent'
2286 d_getpgrp='$d_getpgrp'
2287 d_getprior='$d_getprior'
2288 d_htonl='$d_htonl'
2289 d_index='$d_index'
2290 d_ioctl='$d_ioctl'
2291 d_killpg='$d_killpg'
2292 d_memcmp='$d_memcmp'
2293 d_memcpy='$d_memcpy'
2294 d_mkdir='$d_mkdir'
2295 d_ndbm='$d_ndbm'
2296 d_odbm='$d_odbm'
2297 d_readdir='$d_readdir'
2298 d_rename='$d_rename'
2299 d_rmdir='$d_rmdir'
2300 d_setegid='$d_setegid'
2301 d_seteuid='$d_seteuid'
2302 d_setpgrp='$d_setpgrp'
2303 d_setprior='$d_setprior'
2304 d_setregid='$d_setregid'
2305 d_setresgid='$d_setresgid'
2306 d_setreuid='$d_setreuid'
2307 d_setresuid='$d_setresuid'
2308 d_setrgid='$d_setrgid'
2309 d_setruid='$d_setruid'
2310 d_socket='$d_socket'
2311 d_sockpair='$d_sockpair'
2312 d_oldsock='$d_oldsock'
2313 socketlib='$socketlib'
2314 sockethdr='$sockethdr'
2315 d_statblks='$d_statblks'
2316 d_stdstdio='$d_stdstdio'
2317 d_strctcpy='$d_strctcpy'
2318 d_symlink='$d_symlink'
2319 d_syscall='$d_syscall'
2320 d_tminsys='$d_tminsys'
2321 i_systime='$i_systime'
2322 d_varargs='$d_varargs'
2323 d_vfork='$d_vfork'
2324 d_voidsig='$d_voidsig'
2325 d_vprintf='$d_vprintf'
2326 d_charvspr='$d_charvspr'
2327 gidtype='$gidtype'
2328 i_dirent='$i_dirent'
2329 d_dirnamlen='$d_dirnamlen'
2330 i_fcntl='$i_fcntl'
2331 i_grp='$i_grp'
2332 i_niin='$i_niin'
2333 i_pwd='$i_pwd'
2334 d_pwquota='$d_pwquota'
2335 d_pwage='$d_pwage'
2336 i_sysdir='$i_sysdir'
2337 i_sysioctl='$i_sysioctl'
2338 i_varargs='$i_varargs'
2339 i_vfork='$i_vfork'
2340 intsize='$intsize'
2341 libc='$libc'
2342 libdbm='$libdbm'
2343 libndir='$libndir'
2344 libnm='$libnm'
2345 mallocsrc='$mallocsrc'
2346 mallocobj='$mallocobj'
2347 usemymalloc='$usemymalloc'
2348 mansrc='$mansrc'
2349 manext='$manext'
2350 models='$models'
2351 split='$split'
2352 small='$small'
2353 medium='$medium'
2354 large='$large'
2355 huge='$huge'
2356 optimize='$optimize'
2357 ccflags='$ccflags'
2358 ldflags='$ldflags'
2359 cc='$cc'
2360 libs='$libs'
2361 n='$n'
2362 c='$c'
2363 package='$package'
2364 randbits='$randbits'
2365 sig_name='$sig_name'
2366 spitshell='$spitshell'
2367 shsharp='$shsharp'
2368 sharpbang='$sharpbang'
2369 startsh='$startsh'
2370 stdchar='$stdchar'
2371 uidtype='$uidtype'
2372 voidflags='$voidflags'
2373 defvoidused='$defvoidused'
2374 lib='$lib'
2375 privlib='$privlib'
2376 CONFIG=true
2377 EOT
2378
2379 CONFIG=true
2380
2381 echo " "
2382 dflt=''
2383 fastread=''
2384 echo "If you didn't make any mistakes, then just type a carriage return here."
2385 rp="If you need to edit config.sh, do it as a shell escape here:"
2386 $echo $n "$rp $c"
2387 . UU/myread
2388 case "$ans" in
2389 '') ;;
2390 *) : in case they cannot read
2391     eval $ans;;
2392 esac
2393 . ./config.sh
2394
2395 echo " "
2396 echo "Doing variable substitutions on .SH files..."
2397 set x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
2398 shift
2399 case $# in
2400 0) set x *.SH; shift;;
2401 esac
2402 if test ! -f $1; then
2403     shift
2404 fi
2405 for file in $*; do
2406     case "$file" in
2407     */*)
2408         dir=`$expr X$file : 'X\(.*\)/'`
2409         file=`$expr X$file : 'X.*/\(.*\)'`
2410         (cd $dir && . $file)
2411         ;;
2412     *)
2413         . $file
2414         ;;
2415     esac
2416 done
2417 if test -f config.h.SH; then
2418     if test ! -f config.h; then
2419         : oops, they left it out of MANIFEST, probably, so do it anyway.
2420         . config.h.SH
2421     fi
2422 fi
2423
2424 if $contains '^depend:' Makefile >/dev/null 2>&1; then
2425     dflt=n
2426     $cat <<EOM
2427
2428 Now you need to generate make dependencies by running "make depend".
2429 You might prefer to run it in background: "make depend > makedepend.out &"
2430 It can take a while, so you might not want to run it right now.
2431
2432 EOM
2433     rp="Run make depend now? [$dflt]"
2434     $echo $n "$rp $c"
2435     . UU/myread
2436     case "$ans" in
2437     y*) make depend && echo "Now you must run a make."
2438         ;;
2439     *)  echo "You must run 'make depend' then 'make'."
2440         ;;
2441     esac
2442 elif test -f Makefile; then
2443     echo " "
2444     echo "Now you must run a make."
2445 else
2446     echo "Done."
2447 fi
2448
2449 $rm -f kit*isdone
2450 : the following is currently useless
2451 cd UU && $rm -f $rmlist
2452 : since this removes it all anyway
2453 cd .. && $rm -rf UU
2454 : end of Configure