Commit | Line | Data |
---|---|---|
959f3c4c JH |
1 | ?RCS: $Id: Oldconfig.U,v 3.0.1.10 1997/02/28 15:06:39 ram Exp $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1993, Raphael Manfredi | |
4 | ?RCS: | |
5 | ?RCS: You may redistribute only under the terms of the Artistic Licence, | |
6 | ?RCS: as specified in the README file that comes with the distribution. | |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
8 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
9 | ?RCS: of the source tree for dist 3.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: Oldconfig.U,v $ | |
12 | ?RCS: Revision 3.0.1.10 1997/02/28 15:06:39 ram | |
13 | ?RCS: patch61: added support for src.U | |
14 | ?RCS: patch61: new OSNAME define | |
15 | ?RCS: patch61: can now sense new OSes | |
16 | ?RCS: | |
17 | ?RCS: Revision 3.0.1.9 1995/07/25 13:40:51 ram | |
18 | ?RCS: patch56: now knows about OS/2 platforms | |
19 | ?RCS: | |
20 | ?RCS: Revision 3.0.1.8 1995/05/12 12:04:18 ram | |
21 | ?RCS: patch54: config.sh reload logic now knows about new -K switch | |
22 | ?RCS: patch54: cleaned up and extended osvers for DEC OSF/1 (ADO) | |
23 | ?RCS: patch54: added MachTen detection (ADO) | |
24 | ?RCS: | |
25 | ?RCS: Revision 3.0.1.7 1995/02/15 14:13:41 ram | |
26 | ?RCS: patch51: adapted osvers computation for AIX (ADO) | |
27 | ?RCS: | |
28 | ?RCS: Revision 3.0.1.6 1995/01/30 14:27:15 ram | |
29 | ?RCS: patch49: unit Options.U now exports file optdef.sh, not a variable | |
30 | ?RCS: patch49: update code for myuname changed (WED) | |
31 | ?RCS: | |
32 | ?RCS: Revision 3.0.1.5 1995/01/11 15:15:36 ram | |
33 | ?RCS: patch45: added quotes around the INITPROG variable (ADO) | |
34 | ?RCS: patch45: allows variable overriding after config file loading | |
35 | ?RCS: | |
36 | ?RCS: Revision 3.0.1.4 1994/10/29 15:57:05 ram | |
37 | ?RCS: patch36: added ?F: line for metalint file checking | |
38 | ?RCS: patch36: merged with the version used for perl5's Configure (ADO) | |
39 | ?RCS: | |
40 | ?RCS: Revision 3.0.1.3 1994/05/06 14:24:17 ram | |
41 | ?RCS: patch23: added support for osf1 hints | |
42 | ?RCS: patch23: new support for solaris and i386 systems (ADO) | |
43 | ?RCS: | |
44 | ?RCS: Revision 3.0.1.2 1994/01/24 14:05:02 ram | |
45 | ?RCS: patch16: added post-processing on myuname for Xenix targets | |
46 | ?RCS: patch16: message proposing config.sh defaults made consistent | |
47 | ?RCS: | |
48 | ?RCS: Revision 3.0.1.1 1993/09/13 15:56:32 ram | |
49 | ?RCS: patch10: force use of config.sh when -d option is used (WAD) | |
50 | ?RCS: patch10: complain about non-existent hint files (WAD) | |
51 | ?RCS: patch10: added Options dependency for fastread variable | |
52 | ?RCS: | |
53 | ?RCS: Revision 3.0 1993/08/18 12:05:12 ram | |
54 | ?RCS: Baseline for dist 3.0 netwide release. | |
55 | ?RCS: | |
56 | ?X: | |
57 | ?X: This unit tries to remember what we did last time we ran Configure, mostly | |
58 | ?X: for the sake of setting defaults. | |
59 | ?X: | |
14054727 | 60 | ?MAKE:Oldconfig hint myuname osname osvers: Instruct Myread uname Checkcc \ |
959f3c4c JH |
61 | sh awk sed test cat rm lns tr n c contains Loc Options Tr src trnl ln |
62 | ?MAKE: -pick wipe $@ %< | |
63 | ?S:myuname: | |
64 | ?S: The output of 'uname -a' if available, otherwise the hostname. On Xenix, | |
65 | ?S: pseudo variables assignments in the output are stripped, thank you. The | |
66 | ?S: whole thing is then lower-cased. | |
67 | ?S:. | |
68 | ?S:hint: | |
69 | ?S: Gives the type of hints used for previous answers. May be one of | |
70 | ?S: "default", "recommended" or "previous". | |
71 | ?S:. | |
72 | ?S:osname: | |
73 | ?S: This variable contains the operating system name (e.g. sunos, | |
74 | ?S: solaris, hpux, etc.). It can be useful later on for setting | |
75 | ?S: defaults. Any spaces are replaced with underscores. It is set | |
76 | ?S: to a null string if we can't figure it out. | |
77 | ?S:. | |
78 | ?S:osvers: | |
79 | ?S: This variable contains the operating system version (e.g. | |
80 | ?S: 4.1.3, 5.2, etc.). It is primarily used for helping select | |
81 | ?S: an appropriate hints file, but might be useful elsewhere for | |
82 | ?S: setting defaults. It is set to '' if we can't figure it out. | |
83 | ?S: We try to be flexible about how much of the version number | |
84 | ?S: to keep, e.g. if 4.1.1, 4.1.2, and 4.1.3 are essentially the | |
85 | ?S: same for this package, hints files might just be os_4.0 or | |
86 | ?S: os_4.1, etc., not keeping separate files for each little release. | |
87 | ?S:. | |
88 | ?C:OSNAME: | |
89 | ?C: This symbol contains the name of the operating system, as determined | |
90 | ?C: by Configure. You shouldn't rely on it too much; the specific | |
91 | ?C: feature tests from Configure are generally more reliable. | |
92 | ?C:. | |
93 | ?H:#define OSNAME "$osname" /**/ | |
94 | ?H:. | |
95 | ?F:!config.sh | |
96 | ?T:tmp tmp_n tmp_c tmp_sh file | |
97 | ?T:xxxxfile xxxfile xxfile xfile hintfile newmyuname | |
98 | ?T:tans _ isesix INITPROG DJGPP | |
99 | ?D:osname='' | |
100 | ?LINT:change n c sh | |
101 | : Try to determine whether config.sh was made on this system | |
102 | case "$config_sh" in | |
103 | '') | |
104 | ?X: indentation wrong on purpose--RAM | |
105 | ?X: Leave a white space between first two '(' for ksh. The sub-shell is needed | |
106 | ?X: on some machines to avoid the error message when uname is not found; e.g. | |
107 | ?X: old SUN-OS 3.2 would not execute hostname in (uname -a || hostname). Sigh! | |
508a21cd JH |
108 | ?X: Now not using a subshell but instead $test. |
109 | myuname=`$uname -a 2>/dev/null` | |
110 | $test -z "$myuname" && myuname=`hostname 2>/dev/null` | |
959f3c4c JH |
111 | ?X: Special mention for Xenix, whose 'uname -a' gives us output like this: |
112 | ?X: sysname=XENIX | |
113 | ?X: nodename=whatever | |
114 | ?X: release=2.3.2 .. etc... | |
115 | ?X: Therefore, we strip all this variable assignment junk and remove all the | |
116 | ?X: new lines to keep the myuname variable sane... --RAM | |
117 | # tr '[A-Z]' '[a-z]' would not work in EBCDIC | |
118 | # because the A-Z/a-z are not consecutive. | |
119 | myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ | |
120 | ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '` | |
121 | ?X: Save the value we just computed to reset myuname after we get done here. | |
122 | newmyuname="$myuname" | |
123 | dflt=n | |
124 | case "$knowitall" in | |
125 | '') | |
126 | if test -f ../config.sh; then | |
127 | if $contains myuname= ../config.sh >/dev/null 2>&1; then | |
128 | eval "`grep myuname= ../config.sh`" | |
129 | fi | |
130 | if test "X$myuname" = "X$newmyuname"; then | |
131 | dflt=y | |
132 | fi | |
133 | fi | |
134 | ;; | |
135 | *) dflt=y;; | |
136 | esac | |
137 | ||
138 | @if {test -d ../hints} | |
139 | : Get old answers from old config file if Configure was run on the | |
140 | : same system, otherwise use the hints. | |
141 | hint=default | |
142 | cd .. | |
143 | ?X: Since we are now at the root of the source tree, we must use $src | |
144 | ?X: to access the sources and not $rsrc. See src.U for details... | |
145 | if test -f config.sh; then | |
146 | echo " " | |
147 | rp="I see a config.sh file. Shall I use it to set the defaults?" | |
148 | . UU/myread | |
149 | case "$ans" in | |
150 | n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;; | |
151 | *) echo "Fetching default answers from your old config.sh file..." >&4 | |
152 | tmp_n="$n" | |
153 | tmp_c="$c" | |
154 | tmp_sh="$sh" | |
155 | . ./config.sh | |
156 | cp config.sh UU | |
157 | n="$tmp_n" | |
158 | c="$tmp_c" | |
159 | : Older versions did not always set $sh. Catch re-use of such | |
160 | : an old config.sh. | |
161 | case "$sh" in | |
162 | '') sh="$tmp_sh" ;; | |
163 | esac | |
164 | hint=previous | |
165 | ;; | |
166 | esac | |
167 | fi | |
14054727 | 168 | . ./UU/checkcc |
959f3c4c JH |
169 | if test ! -f config.sh; then |
170 | $cat <<EOM | |
171 | ||
172 | First time through, eh? I have some defaults handy for some systems | |
173 | that need some extra help getting the Configure answers right: | |
174 | ||
175 | EOM | |
176 | (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4 | |
177 | dflt='' | |
178 | : Half the following guesses are probably wrong... If you have better | |
179 | : tests or hints, please send them to <MAINTLOC> | |
180 | : The metaconfig authors would also appreciate a copy... | |
181 | $test -f /irix && osname=irix | |
182 | $test -f /xenix && osname=sco_xenix | |
183 | $test -f /dynix && osname=dynix | |
184 | $test -f /dnix && osname=dnix | |
185 | $test -f /lynx.os && osname=lynxos | |
186 | $test -f /unicos && osname=unicos && osvers=`$uname -r` | |
73f6f260 | 187 | $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r` |
959f3c4c JH |
188 | $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` |
189 | $test -f /bin/mips && /bin/mips && osname=mips | |
190 | $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ | |
191 | $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 | |
192 | $test -d /usr/apollo/bin && osname=apollo | |
193 | $test -f /etc/saf/_sactab && osname=svr4 | |
194 | $test -d /usr/include/minix && osname=minix | |
195 | if $test -d /MachTen -o -d /MachTen_Folder; then | |
196 | ?X: MachTen uname -a output looks like | |
197 | ?X: xxx 4 0.0 Macintosh | |
198 | ?X: MachTen /sbin/version output looks like | |
199 | ?X: MachTen 4.0 Mon Aug 28 10:18:00 1995 | |
200 | ?X: MachTen 3.x had the 'version' command in /usr/etc/version. | |
201 | osname=machten | |
202 | if $test -x /sbin/version; then | |
203 | osvers=`/sbin/version | $awk '{print $2}' | | |
204 | $sed -e 's/[A-Za-z]$//'` | |
205 | elif $test -x /usr/etc/version; then | |
206 | osvers=`/usr/etc/version | $awk '{print $2}' | | |
207 | $sed -e 's/[A-Za-z]$//'` | |
208 | else | |
209 | osvers="$2.$3" | |
210 | fi | |
211 | fi | |
edd6115f JH |
212 | |
213 | $test -f /sys/posix.dll && | |
214 | $test -f /usr/bin/what && | |
215 | set X `/usr/bin/what /sys/posix.dll` && | |
216 | $test "$3" = UWIN && | |
217 | osname=uwin && | |
218 | osvers="$5" | |
219 | ||
959f3c4c JH |
220 | ?X: If we have uname, we already computed a suitable uname -a output, correctly |
221 | ?X: formatted for Xenix, and it lies in $myuname. | |
222 | if $test -f $uname; then | |
223 | set X $myuname | |
224 | shift | |
225 | ||
226 | case "$5" in | |
227 | fps*) osname=fps ;; | |
228 | mips*) | |
229 | case "$4" in | |
230 | umips) osname=umips ;; | |
231 | *) osname=mips ;; | |
232 | esac;; | |
233 | [23]100) osname=mips ;; | |
234 | next*) osname=next ;; | |
235 | ?X: Interactive Unix. | |
236 | i386*) | |
237 | tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'` | |
238 | if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then | |
239 | osname='sco' | |
240 | osvers=$tmp | |
241 | elif $test -f /etc/kconfig; then | |
242 | osname=isc | |
243 | if test "$lns" = "$ln -s"; then | |
244 | osvers=4 | |
245 | elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then | |
246 | osvers=3 | |
247 | elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then | |
248 | osvers=2 | |
249 | fi | |
250 | fi | |
251 | tmp='' | |
252 | ;; | |
253 | ?X: MS-DOS djgpp uname -a output looks like: | |
254 | ?X: ms-dos xxx 6 22 pc | |
255 | ?X: $1 is the "dos flavor" (need not be "ms-dos"). | |
256 | ?X: $2 is the node name | |
257 | ?X: $3 and $4 are version/subversion | |
258 | ?X: $5 is always "pc", but that might not be unique to DJGPP. | |
259 | ?X: (e.g. Solaris_x86 has $5 = i86pc, which doesn't actually conflict, | |
260 | ?X: but it's close enought that I can easily imagine other vendors also | |
261 | ?X: using variants of pc* in $5.) | |
262 | ?X: The "DJGPP" environment variable is always set when djgpp is active. | |
263 | pc*) | |
264 | if test -n "$DJGPP"; then | |
265 | osname=dos | |
266 | osvers=djgpp | |
267 | fi | |
268 | ;; | |
269 | esac | |
270 | ||
271 | case "$1" in | |
272 | aix) osname=aix | |
273 | ?X: aix 4.1 uname -a output looks like | |
274 | ?X: AIX foo 1 4 000123456789 | |
275 | ?X: where $4 is the major release number and $3 is the (minor) version. | |
276 | ?X: More detail on the version is available with the oslevel command. | |
277 | ?X: in 3.2.x, it output a string (see case statements below). In 4.1, | |
278 | ?X: it puts out something like 4.1.1.0 | |
279 | tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` | |
280 | case "$tmp" in | |
281 | 'not found') osvers="$4"."$3" ;; | |
282 | '<3240'|'<>3240') osvers=3.2.0 ;; | |
283 | '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; | |
284 | '=3250'|'>3250') osvers=3.2.5 ;; | |
285 | *) osvers=$tmp;; | |
286 | esac | |
287 | ;; | |
edd6115f JH |
288 | bsd386) osname=bsd386 |
289 | osvers=`$uname -r` | |
290 | ;; | |
291 | cygwin*) osname=cygwin | |
292 | osvers="$3" | |
293 | ;; | |
959f3c4c JH |
294 | *dc.osx) osname=dcosx |
295 | osvers="$3" | |
296 | ;; | |
297 | dnix) osname=dnix | |
298 | osvers="$3" | |
299 | ;; | |
300 | domainos) osname=apollo | |
301 | osvers="$3" | |
302 | ;; | |
303 | dgux) osname=dgux | |
304 | osvers="$3" | |
305 | ;; | |
306 | ?X: uname -a returns | |
307 | ?X: DYNIX/ptx xxx 4.0 V4.1.2 i386 | |
308 | dynixptx*) osname=dynixptx | |
309 | osvers=`echo "$4"|sed 's/^v//'` | |
310 | ;; | |
311 | freebsd) osname=freebsd | |
312 | osvers="$3" ;; | |
313 | genix) osname=genix ;; | |
314 | ?X: HP-UX uname -a gives something like | |
315 | ?X: HP-UX foobar B.10.20 A 9000/735 2016483812 two-user license | |
316 | ?X: Preserve the full 10.20 string instead of the previous plain '10'. | |
317 | ?X: Thanks to Graham Barr. --AD 6/30/1998 | |
318 | hp*) osname=hpux | |
319 | osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'` | |
320 | ;; | |
321 | irix*) osname=irix | |
322 | case "$3" in | |
323 | 4*) osvers=4 ;; | |
324 | 5*) osvers=5 ;; | |
325 | *) osvers="$3" ;; | |
326 | esac | |
327 | ;; | |
328 | linux) osname=linux | |
329 | case "$3" in | |
330 | *) osvers="$3" ;; | |
331 | esac | |
332 | ;; | |
333 | MiNT) osname=mint | |
334 | ;; | |
335 | netbsd*) osname=netbsd | |
336 | osvers="$3" | |
337 | ;; | |
338 | news-os) osvers="$3" | |
339 | case "$3" in | |
340 | 4*) osname=newsos4 ;; | |
341 | *) osname=newsos ;; | |
342 | esac | |
343 | ;; | |
edd6115f JH |
344 | next*) osname=next ;; |
345 | POSIX-BC | posix-bc ) osname=posix-bc | |
346 | osvers="$3" | |
959f3c4c | 347 | ;; |
959f3c4c JH |
348 | powerux | power_ux | powermax_os | powermaxos | \ |
349 | powerunix | power_unix) osname=powerux | |
350 | osvers="$3" | |
351 | ;; | |
edd6115f JH |
352 | qnx) osname=qnx |
353 | osvers="$4" | |
354 | ;; | |
959f3c4c JH |
355 | solaris) osname=solaris |
356 | case "$3" in | |
357 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
358 | *) osvers="$3" ;; | |
359 | esac | |
360 | ;; | |
361 | sunos) osname=sunos | |
362 | case "$3" in | |
363 | 5*) osname=solaris | |
364 | osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
365 | *) osvers="$3" ;; | |
366 | esac | |
367 | ;; | |
368 | titanos) osname=titanos | |
369 | case "$3" in | |
370 | 1*) osvers=1 ;; | |
371 | 2*) osvers=2 ;; | |
372 | 3*) osvers=3 ;; | |
373 | 4*) osvers=4 ;; | |
374 | *) osvers="$3" ;; | |
375 | esac | |
376 | ;; | |
377 | ultrix) osname=ultrix | |
378 | osvers="$3" | |
379 | ;; | |
380 | osf1|mls+) case "$5" in | |
381 | alpha) | |
382 | ?X: DEC OSF/1 myuname -a output looks like: osf1 xxxx t3.2 123.4 alpha | |
383 | ?X: where the version number can be something like [xvt]n.n | |
384 | osname=dec_osf | |
385 | osvers=`echo "$3" | sed 's/^[xvt]//'` | |
386 | ;; | |
387 | hp*) osname=hp_osf1 ;; | |
388 | mips) osname=mips_osf1 ;; | |
389 | ?X: hp and mips were unsupported Technology Releases -- ADO, 24/10/94 | |
390 | esac | |
391 | ;; | |
4ac3c55c A |
392 | unixware) osname=svr5 |
393 | osvers="$4" | |
394 | ;; | |
395 | uts) osname=uts | |
959f3c4c JH |
396 | osvers="$3" |
397 | ;; | |
959f3c4c JH |
398 | $2) case "$osname" in |
399 | *isc*) ;; | |
400 | *freebsd*) ;; | |
401 | svr*) | |
402 | : svr4.x or possibly later | |
403 | case "svr$3" in | |
404 | ${osname}*) | |
405 | osname=svr$3 | |
406 | osvers=$4 | |
407 | ;; | |
408 | esac | |
409 | case "$osname" in | |
410 | svr4.0) | |
411 | : Check for ESIX | |
412 | if test -f /stand/boot ; then | |
413 | eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` | |
414 | if test -n "$INITPROG" -a -f "$INITPROG"; then | |
415 | isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` | |
416 | if test -n "$isesix"; then | |
417 | osname=esix4 | |
418 | fi | |
419 | fi | |
420 | fi | |
421 | ;; | |
422 | esac | |
423 | ;; | |
424 | *) if test -f /etc/systemid; then | |
425 | osname=sco | |
426 | set `echo $3 | $sed 's/\./ /g'` $4 | |
427 | if $test -f $src/hints/sco_$1_$2_$3.sh; then | |
428 | osvers=$1.$2.$3 | |
429 | elif $test -f $src/hints/sco_$1_$2.sh; then | |
430 | osvers=$1.$2 | |
431 | elif $test -f $src/hints/sco_$1.sh; then | |
432 | osvers=$1 | |
433 | fi | |
434 | else | |
435 | case "$osname" in | |
436 | '') : Still unknown. Probably a generic Sys V. | |
437 | osname="sysv" | |
438 | osvers="$3" | |
439 | ;; | |
440 | esac | |
441 | fi | |
442 | ;; | |
443 | esac | |
444 | ;; | |
445 | *) case "$osname" in | |
446 | '') : Still unknown. Probably a generic BSD. | |
447 | osname="$1" | |
448 | osvers="$3" | |
449 | ;; | |
450 | esac | |
451 | ;; | |
452 | esac | |
453 | else | |
454 | ?X: Try to identify sony's NEWS-OS (BSD unix) | |
455 | if test -f /vmunix -a -f $src/hints/news_os.sh; then | |
456 | (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1 | |
457 | if $contains news-os UU/kernel.what >/dev/null 2>&1; then | |
458 | osname=news_os | |
459 | fi | |
460 | $rm -f UU/kernel.what | |
461 | ?X: Maybe it's OS/2 or DOS or something similar | |
462 | elif test -d c:/.; then | |
463 | set X $myuname | |
464 | osname=os2 | |
465 | osvers="$5" | |
466 | fi | |
467 | fi | |
468 | ||
469 | : Now look for a hint file osname_osvers, unless one has been | |
470 | : specified already. | |
471 | case "$hintfile" in | |
472 | ''|' ') | |
70ffff07 | 473 | file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'` |
959f3c4c | 474 | : Also try without trailing minor version numbers. |
70ffff07 DD |
475 | xfile=`echo $file | $sed -e 's%_[^_]*$%%'` |
476 | xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'` | |
477 | xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'` | |
478 | xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'` | |
959f3c4c JH |
479 | case "$file" in |
480 | '') dflt=none ;; | |
481 | *) case "$osvers" in | |
482 | '') dflt=$file | |
483 | ;; | |
484 | *) if $test -f $src/hints/$file.sh ; then | |
485 | dflt=$file | |
486 | elif $test -f $src/hints/$xfile.sh ; then | |
487 | dflt=$xfile | |
488 | elif $test -f $src/hints/$xxfile.sh ; then | |
489 | dflt=$xxfile | |
490 | elif $test -f $src/hints/$xxxfile.sh ; then | |
491 | dflt=$xxxfile | |
492 | elif $test -f $src/hints/$xxxxfile.sh ; then | |
493 | dflt=$xxxxfile | |
494 | elif $test -f "$src/hints/${osname}.sh" ; then | |
495 | dflt="${osname}" | |
496 | else | |
497 | dflt=none | |
498 | fi | |
499 | ;; | |
500 | esac | |
501 | ;; | |
502 | esac | |
503 | if $test -f Policy.sh ; then | |
504 | case "$dflt" in | |
505 | *Policy*) ;; | |
506 | none) dflt="Policy" ;; | |
507 | *) dflt="Policy $dflt" ;; | |
508 | esac | |
509 | fi | |
510 | ;; | |
511 | *) | |
512 | dflt=`echo $hintfile | $sed 's/\.sh$//'` | |
513 | ;; | |
514 | esac | |
515 | ||
516 | if $test -f Policy.sh ; then | |
517 | $cat <<EOM | |
518 | ||
519 | There's also a Policy hint file available, which should make the | |
520 | site-specific (policy) questions easier to answer. | |
521 | EOM | |
522 | ||
523 | fi | |
524 | ||
525 | $cat <<EOM | |
526 | ||
527 | You may give one or more space-separated answers, or "none" if appropriate. | |
528 | A well-behaved OS will have no hints, so answering "none" or just "Policy" | |
86a2f2c4 | 529 | is a good thing. DO NOT give a wrong version or a wrong OS. |
959f3c4c JH |
530 | |
531 | EOM | |
532 | ||
533 | rp="Which of these apply, if any?" | |
534 | . UU/myread | |
535 | tans=$ans | |
536 | for file in $tans; do | |
537 | if $test X$file = XPolicy -a -f Policy.sh; then | |
538 | . Policy.sh | |
539 | $cat Policy.sh >> UU/config.sh | |
540 | elif $test -f $src/hints/$file.sh; then | |
541 | . $src/hints/$file.sh | |
542 | $cat $src/hints/$file.sh >> UU/config.sh | |
543 | elif $test X$tans = X -o X$tans = Xnone ; then | |
544 | : nothing | |
545 | else | |
546 | : Give one chance to correct a possible typo. | |
547 | echo "$file.sh does not exist" | |
548 | dflt=$file | |
549 | rp="hint to use instead?" | |
550 | . UU/myread | |
551 | for file in $ans; do | |
552 | if $test -f "$src/hints/$file.sh"; then | |
553 | . $src/hints/$file.sh | |
554 | $cat $src/hints/$file.sh >> UU/config.sh | |
555 | elif $test X$ans = X -o X$ans = Xnone ; then | |
556 | : nothing | |
557 | else | |
558 | echo "$file.sh does not exist -- ignored." | |
559 | fi | |
560 | done | |
561 | fi | |
562 | done | |
563 | ||
564 | hint=recommended | |
565 | : Remember our hint file for later. | |
566 | if $test -f "$src/hints/$file.sh" ; then | |
567 | hintfile="$file" | |
568 | else | |
569 | hintfile='' | |
570 | fi | |
571 | fi | |
572 | cd UU | |
573 | ?X: From here on, we must use $rsrc instead of $src | |
574 | @else | |
575 | : Get old answers, if there is a config file out there | |
576 | hint=default | |
577 | hintfile='' | |
578 | if test -f ../config.sh; then | |
579 | echo " " | |
580 | rp="I see a config.sh file. Shall I use it to set the defaults?" | |
581 | . ./myread | |
582 | case "$ans" in | |
583 | n*|N*) echo "OK, I'll ignore it.";; | |
584 | *) echo "Fetching default answers from your old config.sh file..." >&4 | |
585 | tmp_n="$n" | |
586 | tmp_c="$c" | |
587 | . ../config.sh | |
588 | cp ../config.sh . | |
589 | n="$tmp_n" | |
590 | c="$tmp_c" | |
591 | hint=previous | |
592 | ;; | |
593 | esac | |
594 | fi | |
595 | @end | |
596 | ?X: remember, indentation is wrong--RAM | |
597 | ;; | |
598 | *) | |
599 | echo " " | |
600 | echo "Fetching default answers from $config_sh..." >&4 | |
601 | tmp_n="$n" | |
602 | tmp_c="$c" | |
603 | cd .. | |
604 | ?X: preserve symbolic links, if any | |
605 | cp $config_sh config.sh 2>/dev/null | |
606 | chmod +w config.sh | |
607 | . ./config.sh | |
608 | cd UU | |
609 | cp ../config.sh . | |
610 | n="$tmp_n" | |
611 | c="$tmp_c" | |
612 | hint=previous | |
613 | ;; | |
614 | esac | |
615 | test "$override" && . ./optdef.sh | |
616 | myuname="$newmyuname" | |
617 | ||
618 | : Restore computed paths | |
619 | for file in $loclist $trylist; do | |
620 | eval $file="\$_$file" | |
621 | done | |
622 | ||
623 | @if osname || osvers | |
624 | cat << EOM | |
625 | ||
626 | Configure uses the operating system name and version to set some defaults. | |
627 | The default value is probably right if the name rings a bell. Otherwise, | |
628 | since spelling matters for me, either accept the default or answer "none" | |
629 | to leave it blank. | |
630 | ||
631 | EOM | |
632 | @end | |
633 | @if osname | |
634 | case "$osname" in | |
635 | ''|' ') | |
636 | case "$hintfile" in | |
637 | ''|' '|none) dflt=none ;; | |
638 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; | |
639 | esac | |
640 | ;; | |
641 | *) dflt="$osname" ;; | |
642 | esac | |
643 | rp="Operating system name?" | |
644 | . ./myread | |
645 | case "$ans" in | |
646 | none) osname='' ;; | |
647 | *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; | |
648 | esac | |
649 | @end | |
650 | @if osvers | |
651 | @if osname | |
652 | echo " " | |
653 | @end | |
654 | case "$osvers" in | |
655 | ''|' ') | |
656 | case "$hintfile" in | |
657 | ''|' '|none) dflt=none ;; | |
658 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'` | |
659 | dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'` | |
660 | case "$dflt" in | |
661 | ''|' ') dflt=none ;; | |
662 | esac | |
663 | ;; | |
664 | esac | |
665 | ;; | |
666 | *) dflt="$osvers" ;; | |
667 | esac | |
668 | rp="Operating system version?" | |
669 | . ./myread | |
670 | case "$ans" in | |
671 | none) osvers='' ;; | |
672 | *) osvers="$ans" ;; | |
673 | esac | |
674 | ||
675 | @end | |
c71449a6 JH |
676 | |
677 | . ./posthint.sh | |
678 |