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