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