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