8d5a95ac70b923cb705f46532e8cc5ec9e00e4bf
[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 2.0 88/06/05 00:07:37 root Exp $
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'
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 Log=''
70 Header=''
71 bin=''
72 cc=''
73 contains=''
74 cppstdin=''
75 cppminus=''
76 d_bcopy=''
77 d_charsprf=''
78 d_crypt=''
79 d_fchmod=''
80 d_fchown=''
81 d_getgrps=''
82 d_index=''
83 d_killpg=''
84 d_memcpy=''
85 d_rename=''
86 d_setegid=''
87 d_seteuid=''
88 d_setrgid=''
89 d_setruid=''
90 d_statblks=''
91 d_stdstdio=''
92 d_strcspn=''
93 d_strctcpy=''
94 d_symlink=''
95 d_tminsys=''
96 d_vfork=''
97 d_voidsig=''
98 gidtype=''
99 libc=''
100 libnm=''
101 mallocsrc=''
102 mallocobj=''
103 usemymalloc=''
104 mansrc=''
105 manext=''
106 models=''
107 split=''
108 small=''
109 medium=''
110 large=''
111 huge=''
112 ccflags=''
113 ldflags=''
114 n=''
115 c=''
116 package=''
117 spitshell=''
118 shsharp=''
119 sharpbang=''
120 startsh=''
121 stdchar=''
122 uidtype=''
123 voidflags=''
124 defvoidused=''
125 privlib=''
126 CONFIG=''
127
128 : set package name
129 package=perl
130
131 echo " "
132 echo "Beginning of configuration questions for $package kit."
133 : Eunice requires " " instead of "", can you believe it
134 echo " "
135
136 define='define'
137 undef='/*undef'
138 libpth='/usr/lib /usr/local/lib /lib'
139 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
140 rmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
141 trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
142
143 : We must find out about Eunice early
144 eunicefix=':'
145 if test -f /etc/unixtovms; then
146     eunicefix=/etc/unixtovms
147 fi
148 if test -f /etc/unixtovms.exe; then
149     eunicefix=/etc/unixtovms.exe
150 fi
151
152 attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
153 attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
154 attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
155 attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
156 attrlist="$attrlist $mc68k __STDC__"
157 pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib /lib"
158 d_newshome="../../NeWS"
159 defvoidused=7
160
161 : some greps do not return status, grrr.
162 echo "grimblepritz" >grimble
163 if grep blurfldyick grimble >/dev/null 2>&1 ; then
164     contains=contains
165 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
166     contains=grep
167 else
168     contains=contains
169 fi
170 rm -f grimble
171 : the following should work in any shell
172 case "$contains" in
173 contains*)
174     echo " "
175     echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
176     cat >contains <<'EOSS'
177 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
178 EOSS
179 chmod +x contains
180 esac
181
182 : first determine how to suppress newline on echo command
183 echo "Checking echo to see how to suppress newlines..."
184 (echo "hi there\c" ; echo " ") >.echotmp
185 if $contains c .echotmp >/dev/null 2>&1 ; then
186     echo "...using -n."
187     n='-n'
188     c=''
189 else
190     cat <<'EOM'
191 ...using \c
192 EOM
193     n=''
194     c='\c'
195 fi
196 echo $n "Type carriage return to continue.  Your cursor should be here-->$c"
197 read ans
198 rm -f .echotmp
199
200 : now set up to do reads with possible shell escape and default assignment
201 cat <<EOSC >myread
202 case "\$fastread" in
203 yes) ans=''; echo " " ;;
204 *) ans='!';;
205 esac
206 while expr "X\$ans" : "X!" >/dev/null; do
207     read ans
208     case "\$ans" in
209     !)
210         sh
211         echo " "
212         echo $n "\$rp $c"
213         ;;
214     !*)
215         set \`expr "X\$ans" : "X!\(.*\)\$"\`
216         sh -c "\$*"
217         echo " "
218         echo $n "\$rp $c"
219         ;;
220     esac
221 done
222 rp='Your answer:'
223 case "\$ans" in
224 '') ans="\$dflt";;
225 esac
226 EOSC
227
228 : general instructions
229 cat <<EOH
230  
231 This installation shell script will examine your system and ask you questions
232 to determine how the $package package should be installed.  If you get stuck
233 on a question, you may use a ! shell escape to start a subshell or execute
234 a command.  Many of the questions will have default answers in square
235 brackets--typing carriage return will give you the default.
236
237 On some of the questions which ask for file or directory names you are
238 allowed to use the ~name construct to specify the login directory belonging
239 to "name", even if you don't have a shell which knows about that.  Questions
240 where this is allowed will be marked "(~name ok)".
241
242 EOH
243 rp="[Type carriage return to continue]"
244 echo $n "$rp $c"
245 . myread
246 cat <<EOH
247
248 Much effort has been expended to ensure that this shell script will run
249 on any Unix system.  If despite that it blows up on you, your best bet is
250 to edit Configure and run it again. Also, let me (lwall@jpl-devvax.jpl.nasa.gov)
251 know how I blew it.  If you can't run Configure for some reason, you'll have
252 to generate a config.sh file by hand.
253
254 This installation script affects things in two ways: 1) it may do direct
255 variable substitutions on some of the files included in this kit, and
256 2) it builds a config.h file for inclusion in C programs.  You may edit
257 any of these files as the need arises after running this script.
258
259 If you make a mistake on a question, there is no easy way to back up to it
260 currently.  The easiest thing to do is to edit config.sh and rerun all the
261 SH files.  Configure will offer to let you do this before it runs the SH files.
262
263 EOH
264 rp="[Type carriage return to continue]"
265 echo $n "$rp $c"
266 . myread
267
268 : get old answers, if there is a config file out there
269 if test -f ../config.sh; then
270     echo " "
271     dflt=y
272     rp="I see a config.sh file.  Did Configure make it on THIS system? [$dflt]"
273     echo $n "$rp $c"
274     . myread
275     case "$ans" in
276     n*) echo "OK, I'll ignore it.";;
277     *)  echo "Fetching default answers from your old config.sh file..."
278         tmp="$n"
279         ans="$c"
280         . ../config.sh
281         n="$tmp"
282         c="$ans"
283         ;;
284     esac
285 fi
286
287 : find out where common programs are
288 echo " "
289 echo "Locating common programs..."
290 cat <<EOSC >loc
291 $startsh
292 case \$# in
293 0) exit 1;;
294 esac
295 thing=\$1
296 shift
297 dflt=\$1
298 shift
299 for dir in \$*; do
300     case "\$thing" in
301     .)
302         if test -d \$dir/\$thing; then
303             echo \$dir
304             exit 0
305         fi
306         ;;
307     *)
308         if test -f \$dir/\$thing; then
309             echo \$dir/\$thing
310             exit 0
311         elif test -f \$dir/\$thing.exe; then
312             : on Eunice apparently
313             echo \$dir/\$thing
314             exit 0
315         fi
316         ;;
317     esac
318 done
319 echo \$dflt
320 exit 1
321 EOSC
322 chmod +x loc
323 $eunicefix loc
324 loclist="
325 expr
326 sed
327 echo
328 cat
329 rm
330 mv
331 cp
332 tr
333 mkdir
334 sort
335 uniq
336 grep
337 "
338 trylist="
339 test
340 egrep
341 Mcc
342 cpp
343 "
344 for file in $loclist; do
345     xxx=`loc $file $file $pth`
346     eval $file=$xxx
347     eval _$file=$xxx
348     case "$xxx" in
349     /*)
350         echo $file is in $xxx.
351         ;;
352     *)
353         echo "I don't know where $file is.  I hope it's in everyone's PATH."
354         ;;
355     esac
356 done
357 echo " "
358 echo "Don't worry if any of the following aren't found..."
359 ans=offhand
360 for file in $trylist; do
361     xxx=`loc $file $file $pth`
362     eval $file=$xxx
363     eval _$file=$xxx
364     case "$xxx" in
365     /*)
366         echo $file is in $xxx.
367         ;;
368     *)
369         echo "I don't see $file out there, $ans."
370         ans=either
371         ;;
372     esac
373 done
374 case "$egrep" in
375 egrep)
376     echo "Substituting grep for egrep."
377     egrep=$grep
378     ;;
379 esac
380 case "$test" in
381 test)
382     echo "Hopefully test is built into your sh."
383     ;;
384 /bin/test)
385     echo " "
386     dflt=n
387     rp="Is your "'"'"test"'"'" built into sh? [$dflt] (OK to guess)"
388     echo $n "$rp $c"
389     . myread
390     case "$ans" in
391     y*) test=test ;;
392     esac
393     ;;
394 *)
395     test=test
396     ;;
397 esac
398 case "$echo" in
399 echo)
400     echo "Hopefully echo is built into your sh."
401     ;;
402 /bin/echo)
403     echo " "
404     echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
405     $echo $n "hi there$c" >foo1
406     echo $n "hi there$c" >foo2
407     if cmp foo1 foo2 >/dev/null 2>&1; then
408         echo "They are compatible.  In fact, they may be identical."
409     else
410         case "$n" in
411         '-n') n='' c='\c' ans='\c' ;;
412         *) n='-n' c='' ans='-n' ;;
413         esac
414         cat <<FOO
415 They are not compatible!  You are probably running ksh on a non-USG system.
416 I'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
417 have echo built in and we may have to run some Bourne shell scripts.  That
418 means I'll have to use $ans to suppress newlines now.  Life is ridiculous.
419
420 FOO
421         rp="Your cursor should be here-->"
422         $echo $n "$rp$c"
423         . myread
424     fi
425     $rm -f foo1 foo2
426     ;;
427 *)
428     : cross your fingers
429     echo=echo
430     ;;
431 esac
432 rmlist="$rmlist loc"
433
434 : get list of predefined functions in a handy place
435 echo " "
436 if test -f /lib/libc.a; then
437     echo "Your C library is in /lib/libc.a.  You're normal."
438     libc=/lib/libc.a
439 else
440     ans=`loc libc.a blurfl/dyick $libpth`
441     if test ! -f $ans; then
442         ans=`loc clib blurfl/dyick $libpth`
443     fi
444     if test ! -f $ans; then
445         ans=`loc libc blurfl/dyick $libpth`
446     fi
447     if test -f $ans; then
448         echo "Your C library is in $ans, of all places."
449         libc=$ans
450     else
451         if test -f "$libc"; then
452             echo "Your C library is in $libc, like you said before."
453         else
454             cat <<EOM
455  
456 I can't seem to find your C library.  I've looked in the following places:
457
458         $libpth
459
460 None of these seems to contain your C library.  What is the full name
461 EOM
462             dflt=None
463             $echo $n "of your C library? $c"
464             rp='C library full name?'
465             . myread
466             libc="$ans"
467         fi
468     fi
469 fi
470 echo " "
471 $echo $n "Extracting names from $libc for later perusal...$c"
472 nm $libc 2>/dev/null | sed -n -e 's/^.* T _//p' -e 's/^.* T //p' > libc.list
473 if $contains '^printf$' libc.list >/dev/null 2>&1; then
474     echo "done"
475 else
476     nm $libc 2>/dev/null | sed -n -e 's/^.* D _//p' -e 's/^.* D //p' > libc.list
477     if $contains '^printf$' libc.list >/dev/null 2>&1; then
478         echo "done"
479     else
480         echo " "
481         echo "nm didn't seem to work right."
482         echo "Trying ar instead..."
483         if ar t $libc | sed -e 's/\.o$//' > libc.list; then
484             echo "Ok."
485         else
486             echo "That didn't work either.  Giving up."
487             exit 1
488         fi
489     fi
490 fi
491 rmlist="$rmlist libc.list"
492
493 : make some quick guesses about what we are up against
494 echo " "
495 $echo $n "Hmm...  $c"
496 if $contains SIGTSTP /usr/include/signal.h >/dev/null 2>&1 ; then
497     echo "Looks kind of like a BSD system, but we'll see..."
498     echo exit 0 >bsd
499     echo exit 1 >usg
500     echo exit 1 >v7
501 elif $contains '^fcntl$' libc.list >/dev/null 2>&1 ; then
502     echo "Looks kind of like a USG system, but we'll see..."
503     echo exit 1 >bsd
504     echo exit 0 >usg
505     echo exit 1 >v7
506 else
507     echo "Looks kind of like a version 7 system, but we'll see..."
508     echo exit 1 >bsd
509     echo exit 1 >usg
510     echo exit 0 >v7
511 fi
512 if $contains '^vmssystem$' libc.list >/dev/null 2>&1 ; then
513     cat <<'EOI'
514 There is, however, a strange, musty smell in the air that reminds me of
515 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
516 EOI
517     echo "exit 0" >eunice
518     eunicefix=unixtovms
519     d_eunice="$define"
520 : it so happens the Eunice I know will not run shell scripts in Unix format
521 else
522     echo " "
523     echo "Congratulations.  You aren't running Eunice."
524     eunicefix=':'
525     d_eunice="$undef"
526     echo "exit 1" >eunice
527 fi
528 if test -f /xenix; then
529     echo "Actually, this looks more like a XENIX system..."
530     echo "exit 0" >xenix
531 else
532     echo " "
533     echo "It's not Xenix..."
534     echo "exit 1" >xenix
535 fi
536 chmod +x xenix
537 $eunicefix xenix
538 if test -f /venix; then
539     echo "Actually, this looks more like a VENIX system..."
540     echo "exit 0" >venix
541 else
542     echo " "
543     if xenix; then
544         : null
545     else
546         echo "Nor is it Venix..."
547     fi
548     echo "exit 1" >venix
549 fi
550 chmod +x bsd usg v7 eunice venix
551 $eunicefix bsd usg v7 eunice venix
552 rmlist="$rmlist bsd usg v7 eunice venix xenix"
553
554 : see if sh knows # comments
555 echo " "
556 echo "Checking your sh to see if it knows about # comments..."
557 if sh -c '#' >/dev/null 2>&1 ; then
558     echo "Your sh handles # comments correctly."
559     shsharp=true
560     spitshell=cat
561     echo " "
562     echo "Okay, let's see if #! works on this system..."
563     echo "#!/bin/echo hi" > try
564     $eunicefix try
565     chmod +x try
566     try > today
567     if $contains hi today >/dev/null 2>&1; then
568         echo "It does."
569         sharpbang='#!'
570     else
571         echo "#! /bin/echo hi" > try
572         $eunicefix try
573         chmod +x try
574         try > today
575         if test -s today; then
576             echo "It does."
577             sharpbang='#! '
578         else
579             echo "It doesn't."
580             sharpbang=': use '
581         fi
582     fi
583 else
584     echo "Your sh doesn't grok # comments--I will strip them later on."
585     shsharp=false
586     echo "exec grep -v '^#'" >spitshell
587     chmod +x spitshell
588     $eunicefix spitshell
589     spitshell=`pwd`/spitshell
590     echo "I presume that if # doesn't work, #! won't work either!"
591     sharpbang=': use '
592 fi
593
594 : figure out how to guarantee sh startup
595 echo " "
596 echo "Checking out how to guarantee sh startup..."
597 startsh=$sharpbang'/bin/sh'
598 echo "Let's see if '$startsh' works..."
599 cat >try <<EOSS
600 $startsh
601 set abc
602 test "$?abc" != 1
603 EOSS
604
605 chmod +x try
606 $eunicefix try
607 if try; then
608     echo "Yup, it does."
609 else
610     echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
611 fi
612 rm -f try today
613
614 : see how we invoke the C preprocessor
615 echo " "
616 echo "Now, how can we feed standard input to your C preprocessor..."
617 cat <<'EOT' >testcpp.c
618 #define ABC abc
619 #define XYZ xyz
620 ABC.XYZ
621 EOT
622 echo 'Maybe "'$cpp'" will work...'
623 $cpp <testcpp.c >testcpp.out 2>&1
624 if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
625     echo "Yup, it does."
626     cppstdin="$cpp"
627     cppminus='';
628 else
629     echo 'Nope, maybe "'$cpp' -" will work...'
630     $cpp - <testcpp.c >testcpp.out 2>&1
631     if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
632         echo "Yup, it does."
633         cppstdin="$cpp"
634         cppminus='-';
635     else
636         echo 'No such luck...maybe "cc -E" will work...'
637         cc -E <testcpp.c >testcpp.out 2>&1
638         if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
639             echo "It works!"
640             cppstdin='cc -E'
641             cppminus='';
642         else
643             echo 'Nixed again...maybe "cc -E -" will work...'
644             cc -E - <testcpp.c >testcpp.out 2>&1
645             if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
646                 echo "Hooray, it works!  I was beginning to wonder."
647                 cppstdin='cc -E'
648                 cppminus='-';
649             else
650                 echo 'Nope...maybe "cc -P" will work...'
651                 cc -P <testcpp.c >testcpp.out 2>&1
652                 if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
653                     echo "Yup, that does."
654                     cppstdin='cc -P'
655                     cppminus='';
656                 else
657                     echo 'Nope...maybe "cc -P -" will work...'
658                     cc -P - <testcpp.c >testcpp.out 2>&1
659                     if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
660                         echo "Yup, that does."
661                         cppstdin='cc -P'
662                         cppminus='-';
663                     else
664                         echo 'Hmm...perhaps you already told me...'
665                         case "$cppstdin" in
666                         '') ;;
667                         *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
668                         esac
669                         if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
670                             echo "Hooray, you did!  I was beginning to wonder."
671                         else
672                             echo 'Uh-uh.  Time to get fancy...'
673                             echo 'Trying (cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)'
674                             cppstdin='(cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)'
675                             cppminus='';
676                             $cppstdin <testcpp.c >testcpp.out 2>&1
677                             if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
678                                 echo "Eureka!."
679                             else
680                                 dflt=blurfl
681                                 $echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
682                                 rp='Name a C preprocessor:'
683                                 . myread
684                                 cppstdin="$ans"
685                                 $cppstdin <testcpp.c >testcpp.out 2>&1
686                                 if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
687                                     echo "OK, that will do."
688                                 else
689                                     echo "Sorry, I can't get that to work.  Go find one."
690                                     exit 1
691                                 fi
692                             fi
693                         fi
694                     fi
695                 fi
696             fi
697         fi
698     fi
699 fi
700 rm -f testcpp.c testcpp.out
701
702 : see if bcopy exists
703 echo " "
704 if $contains '^bcopy$' libc.list >/dev/null 2>&1; then
705     echo 'bcopy() found.'
706     d_bcopy="$define"
707 else
708     echo 'bcopy() not found.'
709     d_bcopy="$undef"
710 fi
711
712 : see if sprintf is declared as int or pointer to char
713 echo " "
714 cat >.ucbsprf.c <<'EOF'
715 main() { char buf[10]; exit((unsigned long)sprintf(buf,"%s","foo") > 10L); }
716 EOF
717 if cc .ucbsprf.c -o .ucbsprf >/dev/null 2>&1 && .ucbsprf; then
718     echo "Your sprintf() returns (int)."
719     d_charsprf="$undef"
720 else
721     echo "Your sprintf() returns (char*)."
722     d_charsprf="$define"
723 fi
724 /bin/rm -f .ucbsprf.c .ucbsprf
725
726 : see if crypt exists
727 echo " "
728 if $contains '^crypt$' libc.list >/dev/null 2>&1; then
729     echo 'crypt() found.'
730     d_crypt="$define"
731 else
732     echo 'crypt() not found.'
733     d_crypt="$undef"
734 fi
735
736 : see if fchmod exists
737 echo " "
738 if $contains '^fchmod$' libc.list >/dev/null 2>&1; then
739     echo 'fchmod() found.'
740     d_fchmod="$define"
741 else
742     echo 'fchmod() not found.'
743     d_fchmod="$undef"
744 fi
745
746 : see if fchown exists
747 echo " "
748 if $contains '^fchown$' libc.list >/dev/null 2>&1; then
749     echo 'fchown() found.'
750     d_fchown="$define"
751 else
752     echo 'fchown() not found.'
753     d_fchown="$undef"
754 fi
755
756 : see if getgroups exists
757 echo " "
758 if $contains '^getgroups$' libc.list >/dev/null 2>&1; then
759     echo 'getgroups() found.'
760     d_getgrps="$define"
761 else
762     echo 'getgroups() not found.'
763     d_getgrps="$undef"
764 fi
765
766 : index or strcpy
767 echo " "
768 case "$d_index" in
769 n) dflt=n;;
770 *) dflt=y;;
771 esac
772 if $contains '^index$' libc.list >/dev/null 2>&1 ; then
773     if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
774         echo "Your system has both index() and strchr().  Shall I use"
775         rp="index() rather than strchr()? [$dflt]"
776         $echo $n "$rp $c"
777         . myread
778         case "$ans" in
779             n*) d_index="$define" ;;
780             *)  d_index="$undef" ;;
781         esac
782     else
783         d_index="$undef"
784         echo "index() found."
785     fi
786 else
787     if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
788         d_index="$define"
789         echo "strchr() found."
790     else
791         echo "No index() or strchr() found!"
792         d_index="$undef"
793     fi
794 fi
795
796 : see if killpg exists
797 echo " "
798 if $contains '^killpg$' libc.list >/dev/null 2>&1; then
799     echo 'killpg() found.'
800     d_killpg="$define"
801 else
802     echo 'killpg() not found.'
803     d_killpg="$undef"
804 fi
805
806 : see if memcpy exists
807 echo " "
808 if $contains '^memcpy$' libc.list >/dev/null 2>&1; then
809     echo 'memcpy() found.'
810     d_memcpy="$define"
811 else
812     echo 'memcpy() not found.'
813     d_memcpy="$undef"
814 fi
815
816 : see if rename exists
817 echo " "
818 if $contains '^rename$' libc.list >/dev/null 2>&1; then
819     echo 'rename() found.'
820     d_rename="$define"
821 else
822     echo 'rename() not found.'
823     d_rename="$undef"
824 fi
825
826 : see if setegid exists
827 echo " "
828 if $contains '^setegid$' libc.list >/dev/null 2>&1; then
829     echo 'setegid() found.'
830     d_setegid="$define"
831 else
832     echo 'setegid() not found.'
833     d_setegid="$undef"
834 fi
835
836 : see if seteuid exists
837 echo " "
838 if $contains '^seteuid$' libc.list >/dev/null 2>&1; then
839     echo 'seteuid() found.'
840     d_seteuid="$define"
841 else
842     echo 'seteuid() not found.'
843     d_seteuid="$undef"
844 fi
845
846 : see if setrgid exists
847 echo " "
848 if $contains '^setrgid$' libc.list >/dev/null 2>&1; then
849     echo 'setrgid() found.'
850     d_setrgid="$define"
851 else
852     echo 'setrgid() not found.'
853     d_setrgid="$undef"
854 fi
855
856 : see if setruid exists
857 echo " "
858 if $contains '^setruid$' libc.list >/dev/null 2>&1; then
859     echo 'setruid() found.'
860     d_setruid="$define"
861 else
862     echo 'setruid() not found.'
863     d_setruid="$undef"
864 fi
865
866 : see if stat knows about block sizes
867 echo " "
868 if $contains 'st_blocks;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then
869     if $contains 'st_blksize;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then
870         echo "Your stat knows about block sizes."
871         d_statblks="$define"
872     else
873         echo "Your stat doesn't know about block sizes."
874         d_statblks="$undef"
875     fi
876 else
877     echo "Your stat doesn't know about block sizes."
878     d_statblks="$undef"
879 fi
880
881 : see if stdio is really std
882 echo " "
883 if $contains 'char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then
884     if $contains '_cnt;' /usr/include/stdio.h >/dev/null 2>&1 ; then
885         echo "Your stdio is pretty std."
886         d_stdstdio="$define"
887     else
888         echo "Your stdio isn't very std."
889         d_stdstdio="$undef"
890     fi
891 else
892     echo "Your stdio isn't very std."
893     d_stdstdio="$undef"
894 fi
895
896 : see if strcspn exists
897 echo " "
898 if $contains '^strcspn$' libc.list >/dev/null 2>&1; then
899     echo 'strcspn() found.'
900     d_strcspn="$define"
901 else
902     echo 'strcspn() not found.'
903     d_strcspn="$undef"
904 fi
905
906 : check for structure copying
907 echo " "
908 echo "Checking to see if your C compiler can copy structs..."
909 $cat >try.c <<'EOCP'
910 main()
911 {
912         struct blurfl {
913             int dyick;
914         } foo, bar;
915
916         foo = bar;
917 }
918 EOCP
919 if cc -c try.c >/dev/null 2>&1 ; then
920     d_strctcpy="$define"
921     echo "Yup, it can."
922 else
923     d_strctcpy="$undef"
924     echo "Nope, it can't."
925 fi
926 $rm -f try.*
927
928 : see if symlink exists
929 echo " "
930 if $contains '^symlink$' libc.list >/dev/null 2>&1; then
931     echo 'symlink() found.'
932     d_symlink="$define"
933 else
934     echo 'symlink() not found.'
935     d_symlink="$undef"
936 fi
937
938 : see if struct tm is defined in sys/time.h
939 echo " "
940 if $contains 'struct tm' /usr/include/time.h >/dev/null 2>&1 ; then
941     echo "You have struct tm defined in <time.h> rather than <sys/time.h>."
942     d_tminsys="$undef"
943 else
944     echo "You have struct tm defined in <sys/time.h> rather than <time.h>."
945     d_tminsys="$define"
946 fi
947
948 : see if there is a vfork
949 echo " "
950 if $contains '^vfork$' libc.list >/dev/null 2>&1 ; then
951     echo "vfork() found."
952     d_vfork="$undef"
953 else
954     echo "No vfork() found--will use fork() instead."
955     d_vfork="$define"
956 fi
957
958 : see if signal is declared as pointer to function returning int or void
959 echo " "
960 if $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 ; then
961     echo "You have void (*signal())() instead of int."
962     d_voidsig="$define"
963 else
964     echo "You have int (*signal())() instead of void."
965     d_voidsig="$undef"
966 fi
967
968 : check for void type
969 echo " "
970 $cat <<EOM
971 Checking to see how well your C compiler groks the void type...
972
973   Support flag bits are:
974     1: basic void declarations.
975     2: arrays of pointers to functions returning void.
976     4: operations between pointers to and addresses of void functions.
977
978 EOM
979 case "$voidflags" in
980 '')
981     $cat >try.c <<'EOCP'
982 #if TRY & 1
983 void main() {
984 #else
985 main() {
986 #endif
987         extern void *moo();
988         void *(*goo)();
989 #if TRY & 2
990         void (*foo[10])();
991 #endif
992
993 #if TRY & 4
994         if(*goo == moo) {
995                 exit(0);
996         }
997 #endif
998         exit(0);
999 }
1000 EOCP
1001     if cc -S -DTRY=7 try.c >.out 2>&1 ; then
1002         voidflags=7
1003         echo "It appears to support void fully."
1004         if $contains warning .out >/dev/null 2>&1; then
1005             echo "However, you might get some warnings that look like this:"
1006             $cat .out
1007         fi
1008     else
1009         echo "Hmm, you compiler has some difficulty with void.  Checking further..."
1010         if cc -S -DTRY=1 try.c >/dev/null 2>&1 ; then
1011             echo "It supports 1..."
1012             if cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then
1013                 voidflags=3
1014                 echo "And it supports 2 but not 4."
1015             else
1016                 echo "It doesn't support 2..."
1017                 if cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then
1018                     voidflags=5
1019                     echo "But it supports 4."
1020                 else
1021                     voidflags=1
1022                     echo "And it doesn't support 4."
1023                 fi
1024             fi
1025         else
1026             echo "There is no support at all for void."
1027             voidflags=0
1028         fi
1029     fi
1030 esac
1031 dflt="$voidflags";
1032 rp="Your void support flags add up to what? [$dflt]"
1033 $echo $n "$rp $c"
1034 . myread
1035 voidflags="$ans"
1036 $rm -f try.* .out
1037
1038 : see what type gids are declared as in the kernel
1039 case "$gidtype" in
1040 '')
1041     if $contains 'gid_t;' /usr/include/sys/types.h >/dev/null 2>&1 ; then
1042         dflt='gid_t';
1043     else
1044         set `grep 'groups\[NGROUPS\];' /usr/include/sys/user.h 2>/dev/null` unsigned short
1045         case $1 in
1046         unsigned) dflt="$1 $2" ;;
1047         *) dflt="$1" ;;
1048         esac
1049     fi
1050     ;;
1051 *)  dflt="$gidtype"
1052     ;;
1053 esac
1054 cont=true
1055 echo " "
1056 rp="What type are group ids on this system declared as? [$dflt]"
1057 $echo $n "$rp $c"
1058 . myread
1059 gidtype="$ans"
1060
1061 : set up shell script to do ~ expansion
1062 cat >filexp <<EOSS
1063 $startsh
1064 : expand filename
1065 case "\$1" in
1066  ~/*|~)
1067     echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
1068     ;;
1069  ~*)
1070     if $test -f /bin/csh; then
1071         /bin/csh -f -c "glob \$1"
1072         echo ""
1073     else
1074         name=\`$expr x\$1 : '..\([^/]*\)'\`
1075         dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
1076         if $test ! -d "\$dir"; then
1077             me=\`basename \$0\`
1078             echo "\$me: can't locate home directory for: \$name" >&2
1079             exit 1
1080         fi
1081         case "\$1" in
1082         */*)
1083             echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
1084             ;;
1085         *)
1086             echo \$dir
1087             ;;
1088         esac
1089     fi
1090     ;;
1091 *)
1092     echo \$1
1093     ;;
1094 esac
1095 EOSS
1096 chmod +x filexp
1097 $eunicefix filexp
1098
1099 : determine where private executables go
1100 case "$privlib" in
1101 '')
1102     dflt=/usr/lib/perl
1103     test -d /usr/local/lib && dflt=/usr/local/lib/perl
1104     ;;
1105 *)  dflt="$privlib"
1106     ;;
1107 esac
1108 $cat <<EOM
1109
1110 The perl package has some perl subroutine libraries that should be put in
1111 a directory that is accessible by everyone.  Where do you want to put these
1112 EOM
1113 $echo $n "libraries? [$dflt] $c"
1114 rp="Put perl libraries where? [$dflt]"
1115 . myread
1116 privlib=`filexp $ans`
1117
1118 : see what type of char stdio uses.
1119 echo " "
1120 if $contains 'unsigned.*char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then
1121     echo "Your stdio uses unsigned chars."
1122     stdchar="unsigned char"
1123 else
1124     echo "Your stdio uses signed chars."
1125     stdchar="char"
1126 fi
1127
1128 : see what type uids are declared as in the kernel
1129 case "$uidtype" in
1130 '')
1131     if $contains 'uid_t;' /usr/include/sys/types.h >/dev/null 2>&1 ; then
1132         dflt='uid_t';
1133     else
1134         set `grep '_ruid;' /usr/include/sys/user.h 2>/dev/null` unsigned short
1135         case $1 in
1136         unsigned) dflt="$1 $2" ;;
1137         *) dflt="$1" ;;
1138         esac
1139     fi
1140     ;;
1141 *)  dflt="$uidtype"
1142     ;;
1143 esac
1144 cont=true
1145 echo " "
1146 rp="What type are user ids on this system declared as? [$dflt]"
1147 $echo $n "$rp $c"
1148 . myread
1149 uidtype="$ans"
1150
1151 : preserve RCS keywords in files with variable substitution, grrr
1152 Log='$Log'
1153 Header='$Header'
1154
1155 : determine where public executables go
1156 case "$bin" in
1157 '')
1158     dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
1159     ;;
1160 *)  dflt="$bin"
1161     ;;
1162 esac
1163 cont=true
1164 while $test "$cont" ; do
1165     echo " "
1166     rp="Where do you want to put the public executables? [$dflt]"
1167     $echo $n "$rp $c"
1168     . myread
1169     bin="$ans"
1170     bin=`filexp $bin`
1171     if test -d $bin; then
1172         cont=''
1173     else
1174         dflt=n
1175         rp="Directory $bin doesn't exist.  Use that name anyway? [$dflt]"
1176         $echo $n "$rp $c"
1177         . myread
1178         dflt=''
1179         case "$ans" in
1180         y*) cont='';;
1181         esac
1182     fi
1183 done
1184
1185 : determine where manual pages go
1186 case "$mansrc" in
1187 '')
1188     dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1`
1189     ;;
1190 *)  dflt="$mansrc"
1191     ;;
1192 esac
1193 cont=true
1194 while $test "$cont" ; do
1195     echo " "
1196     rp="Where do the manual pages (source) go? [$dflt]"
1197     $echo $n "$rp $c"
1198     . myread
1199     mansrc=`filexp "$ans"`
1200     if test -d $mansrc; then
1201         cont=''
1202     else
1203         dflt=n
1204         rp="Directory $mansrc doesn't exist.  Use that name anyway? [$dflt]"
1205         $echo $n "$rp $c"
1206         . myread
1207         dflt=''
1208         case "$ans" in
1209         y*) cont='';;
1210         esac
1211     fi
1212 done
1213 case "$mansrc" in
1214 *l)
1215     manext=l
1216     ;;
1217 *n)
1218     manext=n
1219     ;;
1220 *C)
1221     manext=C
1222     ;;
1223 *)
1224     manext=1
1225     ;;
1226 esac
1227
1228 : get C preprocessor symbols handy
1229 echo " "
1230 echo $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know
1231 $cat <<EOSS >Cppsym
1232 $startsh
1233 case "\$1" in
1234 -l) list=true
1235     shift
1236     ;;
1237 esac
1238 unknown=''
1239 case "\$list\$#" in
1240 1|2)
1241     for sym do
1242         if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
1243             exit 0
1244         elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
1245                 :
1246         else
1247             unknown="\$unknown \$sym"
1248         fi
1249     done
1250     set X \$unknown
1251     shift
1252     ;;
1253 esac
1254 case \$# in
1255 0) exit 1;;
1256 esac
1257 echo \$* | $tr '[ - ]' '[\012-\012]' | $sed -e 's/\(.*\)/\\
1258 #ifdef \1\\
1259 exit 0; _ _ _ _\1\\      \1\\
1260 #endif\\
1261 /' >/tmp/Cppsym\$\$
1262 echo exit 1 >>/tmp/Cppsym\$\$
1263 $cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
1264 case "\$list" in
1265 true) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
1266 *)
1267     sh /tmp/Cppsym2\$\$
1268     status=\$?
1269     ;;
1270 esac
1271 $rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
1272 exit \$status
1273 EOSS
1274 chmod +x Cppsym
1275 $eunicefix Cppsym
1276 echo "Your C preprocessor defines the following symbols:"
1277 Cppsym -l $attrlist >Cppsym.true
1278 cat Cppsym.true
1279 rmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
1280
1281 : see what memory models we can support
1282 case "$models" in
1283 '')
1284     if Cppsym pdp11; then
1285         dflt='unsplit split'
1286     else
1287         ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
1288         case "$ans" in
1289         X) dflt='none';;
1290         *)  if $test -d /lib/small || $test -d /usr/lib/small; then
1291                 dflt='small'
1292             else
1293                 dflt=''
1294             fi
1295             if $test -d /lib/medium || $test -d /usr/lib/medium; then
1296                 dflt="$dflt medium"
1297             fi
1298             if $test -d /lib/large || $test -d /usr/lib/large; then
1299                 dflt="$dflt large"
1300             fi
1301             if $test -d /lib/huge || $test -d /usr/lib/huge; then
1302                 dflt="$dflt huge"
1303             fi
1304         esac
1305     fi
1306     ;;
1307 *)  dflt="$models" ;;
1308 esac
1309 $cat <<EOM
1310  
1311 Some systems have different model sizes.  On most systems they are called
1312 small, medium, large, and huge.  On the PDP11 they are called unsplit and
1313 split.  If your system doesn't support different memory models, say "none".
1314 If you wish to force everything to one memory model, say "none" here and
1315 put the appropriate flags later when it asks you for other cc and ld flags.
1316 Venix systems may wish to put "none" and let the compiler figure things out.
1317 (In the following question multiple model names should be space separated.)
1318
1319 EOM
1320 rp="Which models are supported? [$dflt]"
1321 $echo $n "$rp $c"
1322 . myread
1323 models="$ans"
1324
1325 case "$models" in
1326 none)
1327     small=''
1328     medium=''
1329     large=''
1330     huge=''
1331     unsplit=''
1332     split=''
1333     ;;
1334 *split)
1335     case "$split" in
1336     '') 
1337         if $contains '-i' $mansrc/ld.1 >/dev/null 2>&1 || \
1338            $contains '-i' $mansrc/cc.1 >/dev/null 2>&1; then
1339             dflt='-i'
1340         else
1341             dflt='none'
1342         fi
1343         ;;
1344     *) dflt="$split";;
1345     esac
1346     rp="What flag indicates separate I and D space? [$dflt]"
1347     $echo $n "$rp $c"
1348     . myread
1349     case "$ans" in
1350     none) ans='';;
1351     esac
1352     split="$ans"
1353     unsplit=''
1354     ;;
1355 *large*|*small*|*medium*|*huge*)
1356     case "$model" in
1357     *large*)
1358         case "$large" in
1359         '') dflt='-Ml';;
1360         *) dflt="$large";;
1361         esac
1362         rp="What flag indicates large model? [$dflt]"
1363         $echo $n "$rp $c"
1364         . myread
1365         case "$ans" in
1366         none) ans='';
1367         esac
1368         large="$ans"
1369         ;;
1370     *) large='';;
1371     esac
1372     case "$model" in
1373     *huge*)
1374         case "$huge" in
1375         '') dflt='-Mh';;
1376         *) dflt="$huge";;
1377         esac
1378         rp="What flag indicates huge model? [$dflt]"
1379         $echo $n "$rp $c"
1380         . myread
1381         case "$ans" in
1382         none) ans='';
1383         esac
1384         huge="$ans"
1385         ;;
1386     *) huge="$large";;
1387     esac
1388     case "$model" in
1389     *medium*)
1390         case "$medium" in
1391         '') dflt='-Mm';;
1392         *) dflt="$medium";;
1393         esac
1394         rp="What flag indicates medium model? [$dflt]"
1395         $echo $n "$rp $c"
1396         . myread
1397         case "$ans" in
1398         none) ans='';
1399         esac
1400         medium="$ans"
1401         ;;
1402     *) medium="$large";;
1403     esac
1404     case "$model" in
1405     *small*)
1406         case "$small" in
1407         '') dflt='none';;
1408         *) dflt="$small";;
1409         esac
1410         rp="What flag indicates small model? [$dflt]"
1411         $echo $n "$rp $c"
1412         . myread
1413         case "$ans" in
1414         none) ans='';
1415         esac
1416         small="$ans"
1417         ;;
1418     *) small='';;
1419     esac
1420     ;;
1421 *)
1422     echo "Unrecognized memory models--you may have to edit Makefile.SH"
1423     ;;
1424 esac
1425
1426 case "$ccflags" in
1427 '') dflt='none';;
1428 *) dflt="$ccflags";;
1429 esac
1430 echo " "
1431 rp="Any additional cc flags? [$dflt]"
1432 $echo $n "$rp $c"
1433 . myread
1434 case "$ans" in
1435 none) ans='';
1436 esac
1437 ccflags="$ans"
1438
1439 case "$ldflags" in
1440 '') if venix; then
1441         dflt='-i -z'
1442     else
1443         dflt='none'
1444     fi
1445     ;;
1446 *) dflt="$ldflags";;
1447 esac
1448 echo " "
1449 rp="Any additional ld flags? [$dflt]"
1450 $echo $n "$rp $c"
1451 . myread
1452 case "$ans" in
1453 none) ans='';
1454 esac
1455 ldflags="$ans"
1456
1457 : see if we need a special compiler
1458 echo " "
1459 if usg; then
1460     case "$cc" in
1461     '')
1462         case "$Mcc" in
1463         /*) dflt='Mcc'
1464             ;;
1465         *)
1466             case "$large" in
1467             -M*)
1468                 dflt='cc'
1469                 ;;
1470             *)
1471                 if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
1472                     dflt='cc -M'
1473                 else
1474                     dflt='cc'
1475                 fi
1476                 ;;
1477             esac
1478             ;;
1479         esac
1480         ;;
1481     *)  dflt="$cc";;
1482     esac
1483     $cat <<'EOM'
1484  
1485 On some systems the default C compiler will not resolve multiple global
1486 references that happen to have the same name.  On some such systems the
1487 "Mcc" command may be used to force these to be resolved.  On other systems
1488 a "cc -M" command is required.  (Note that the -M flag on other systems
1489 indicates a memory model to use!)  What command will force resolution on
1490 EOM
1491     $echo $n "this system? [$dflt] $c"
1492     rp="Command to resolve multiple refs? [$dflt]"
1493     . myread
1494     cc="$ans"
1495 else
1496     echo "Not a USG system--assuming cc can resolve multiple definitions."
1497     cc=cc
1498 fi
1499
1500 : see if we should include -lnm
1501 echo " "
1502 if $test -r /usr/lib/libnm.a || $test -r /usr/local/lib/libnm.a ; then
1503     echo "New math library found."
1504     libnm='-lnm'
1505 else
1506     ans=`loc libnm.a x $libpth`
1507     case "$ans" in
1508     x)
1509         echo "No nm library found--the normal math library will have to do."
1510         libnm=''
1511         ;;
1512     *)
1513         echo "New math library found in $ans."
1514         libnm="$ans"
1515         ;;
1516     esac
1517 fi
1518
1519 : determine which malloc to compile in
1520 echo " "
1521 case "$usemymalloc" in
1522 '')
1523     if bsd || v7; then
1524         dflt='y'
1525     else
1526         dflt='n'
1527     fi
1528     ;;
1529 *)  dflt="$usemymalloc"
1530     ;;
1531 esac
1532 rp="Do you wish to attempt to use the malloc that comes with $package? [$dflt]"
1533 $echo $n "$rp $c"
1534 . myread
1535 case "$ans" in
1536 '') ans=$dflt;;
1537 esac
1538 usemymalloc="$ans"
1539 case "$ans" in
1540 y*) mallocsrc='malloc.c'; mallocobj='malloc.o';;
1541 *) mallocsrc=''; mallocobj='';;
1542 esac
1543
1544 echo " "
1545 echo "End of configuration questions."
1546 echo " "
1547
1548 : create config.sh file
1549 echo " "
1550 if test -d ../UU; then
1551     cd ..
1552 fi
1553 echo "Creating config.sh..."
1554 $spitshell <<EOT >config.sh
1555 $startsh
1556 # config.sh
1557 # This file was produced by running the Configure script.
1558
1559 d_eunice='$d_eunice'
1560 eunicefix='$eunicefix'
1561 define='$define'
1562 loclist='$loclist'
1563 expr='$expr'
1564 sed='$sed'
1565 echo='$echo'
1566 cat='$cat'
1567 rm='$rm'
1568 mv='$mv'
1569 cp='$cp'
1570 tail='$tail'
1571 tr='$tr'
1572 mkdir='$mkdir'
1573 sort='$sort'
1574 uniq='$uniq'
1575 grep='$grep'
1576 trylist='$trylist'
1577 test='$test'
1578 inews='$inews'
1579 egrep='$egrep'
1580 more='$more'
1581 pg='$pg'
1582 Mcc='$Mcc'
1583 vi='$vi'
1584 mailx='$mailx'
1585 mail='$mail'
1586 cpp='$cpp'
1587 Log='$Log'
1588 Header='$Header'
1589 bin='$bin'
1590 cc='$cc'
1591 contains='$contains'
1592 cppstdin='$cppstdin'
1593 cppminus='$cppminus'
1594 d_bcopy='$d_bcopy'
1595 d_charsprf='$d_charsprf'
1596 d_crypt='$d_crypt'
1597 d_fchmod='$d_fchmod'
1598 d_fchown='$d_fchown'
1599 d_getgrps='$d_getgrps'
1600 d_index='$d_index'
1601 d_killpg='$d_killpg'
1602 d_memcpy='$d_memcpy'
1603 d_rename='$d_rename'
1604 d_setegid='$d_setegid'
1605 d_seteuid='$d_seteuid'
1606 d_setrgid='$d_setrgid'
1607 d_setruid='$d_setruid'
1608 d_statblks='$d_statblks'
1609 d_stdstdio='$d_stdstdio'
1610 d_strcspn='$d_strcspn'
1611 d_strctcpy='$d_strctcpy'
1612 d_symlink='$d_symlink'
1613 d_tminsys='$d_tminsys'
1614 d_vfork='$d_vfork'
1615 d_voidsig='$d_voidsig'
1616 gidtype='$gidtype'
1617 libc='$libc'
1618 libnm='$libnm'
1619 mallocsrc='$mallocsrc'
1620 mallocobj='$mallocobj'
1621 usemymalloc='$usemymalloc'
1622 mansrc='$mansrc'
1623 manext='$manext'
1624 models='$models'
1625 split='$split'
1626 small='$small'
1627 medium='$medium'
1628 large='$large'
1629 huge='$huge'
1630 ccflags='$ccflags'
1631 ldflags='$ldflags'
1632 n='$n'
1633 c='$c'
1634 package='$package'
1635 spitshell='$spitshell'
1636 shsharp='$shsharp'
1637 sharpbang='$sharpbang'
1638 startsh='$startsh'
1639 stdchar='$stdchar'
1640 uidtype='$uidtype'
1641 voidflags='$voidflags'
1642 defvoidused='$defvoidused'
1643 privlib='$privlib'
1644 CONFIG=true
1645 EOT
1646  
1647 CONFIG=true
1648
1649 echo " "
1650 dflt=''
1651 fastread=''
1652 echo "If you didn't make any mistakes, then just type a carriage return here."
1653 rp="If you need to edit config.sh, do it as a shell escape here:"
1654 $echo $n "$rp $c"
1655 . UU/myread
1656 case "$ans" in
1657 '') ;;
1658 *) : in case they cannot read
1659     eval $ans;;
1660 esac
1661 . ./config.sh
1662
1663 echo " "
1664 echo "Doing variable substitutions on .SH files..."
1665 set x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
1666 shift
1667 case $# in
1668 0) set x *.SH; shift;;
1669 esac
1670 if test ! -f $1; then
1671     shift
1672 fi
1673 for file in $*; do
1674     case "$file" in
1675     */*)
1676         dir=`$expr X$file : 'X\(.*\)/'`
1677         file=`$expr X$file : 'X.*/\(.*\)'`
1678         (cd $dir && . $file)
1679         ;;
1680     *)
1681         . $file
1682         ;;
1683     esac
1684 done
1685 if test -f config.h.SH; then
1686     if test ! -f config.h; then
1687         : oops, they left it out of MANIFEST, probably, so do it anyway.
1688         . config.h.SH
1689     fi
1690 fi
1691
1692 if $contains '^depend:' Makefile >/dev/null 2>&1; then
1693     dflt=n
1694     $cat <<EOM
1695
1696 Now you need to generate make dependencies by running "make depend".
1697 You might prefer to run it in background: "make depend > makedepend.out &"
1698 It can take a while, so you might not want to run it right now.
1699
1700 EOM
1701     rp="Run make depend now? [$dflt]"
1702     $echo $n "$rp $c"
1703     . UU/myread
1704     case "$ans" in
1705     y*) make depend
1706         echo "Now you must run a make."
1707         ;;
1708     *)  echo "You must run 'make depend' then 'make'."
1709         ;;
1710     esac
1711 elif test -f Makefile; then
1712     echo " "
1713     echo "Now you must run a make."
1714 else
1715     echo "Done."
1716 fi
1717
1718 $rm -f kit*isdone
1719 cd UU && $rm -f $rmlist
1720 : end of Configure