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