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