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