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