This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Spelling - megapatch
[metaconfig.git] / U / modified / Oldconfig.U
CommitLineData
959f3c4c
JH
1?RCS: $Id: Oldconfig.U,v 3.0.1.10 1997/02/28 15:06:39 ram Exp $
2?RCS:
3?RCS: Copyright (c) 1991-1993, Raphael Manfredi
d01e9330 4?RCS:
65a32477 5?RCS: You may redistribute only under the terms of the Artistic License,
959f3c4c
JH
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
65a32477 8?RCS: that same Artistic License; a copy of which may be found at the root
959f3c4c
JH
9?RCS: of the source tree for dist 3.0.
10?RCS:
11?RCS: $Log: Oldconfig.U,v $
12?RCS: Revision 3.0.1.10 1997/02/28 15:06:39 ram
13?RCS: patch61: added support for src.U
14?RCS: patch61: new OSNAME define
15?RCS: patch61: can now sense new OSes
16?RCS:
17?RCS: Revision 3.0.1.9 1995/07/25 13:40:51 ram
18?RCS: patch56: now knows about OS/2 platforms
19?RCS:
20?RCS: Revision 3.0.1.8 1995/05/12 12:04:18 ram
21?RCS: patch54: config.sh reload logic now knows about new -K switch
22?RCS: patch54: cleaned up and extended osvers for DEC OSF/1 (ADO)
23?RCS: patch54: added MachTen detection (ADO)
24?RCS:
25?RCS: Revision 3.0.1.7 1995/02/15 14:13:41 ram
26?RCS: patch51: adapted osvers computation for AIX (ADO)
27?RCS:
28?RCS: Revision 3.0.1.6 1995/01/30 14:27:15 ram
29?RCS: patch49: unit Options.U now exports file optdef.sh, not a variable
30?RCS: patch49: update code for myuname changed (WED)
31?RCS:
32?RCS: Revision 3.0.1.5 1995/01/11 15:15:36 ram
33?RCS: patch45: added quotes around the INITPROG variable (ADO)
34?RCS: patch45: allows variable overriding after config file loading
35?RCS:
36?RCS: Revision 3.0.1.4 1994/10/29 15:57:05 ram
37?RCS: patch36: added ?F: line for metalint file checking
38?RCS: patch36: merged with the version used for perl5's Configure (ADO)
39?RCS:
40?RCS: Revision 3.0.1.3 1994/05/06 14:24:17 ram
41?RCS: patch23: added support for osf1 hints
42?RCS: patch23: new support for solaris and i386 systems (ADO)
43?RCS:
44?RCS: Revision 3.0.1.2 1994/01/24 14:05:02 ram
45?RCS: patch16: added post-processing on myuname for Xenix targets
46?RCS: patch16: message proposing config.sh defaults made consistent
47?RCS:
48?RCS: Revision 3.0.1.1 1993/09/13 15:56:32 ram
49?RCS: patch10: force use of config.sh when -d option is used (WAD)
50?RCS: patch10: complain about non-existent hint files (WAD)
51?RCS: patch10: added Options dependency for fastread variable
52?RCS:
53?RCS: Revision 3.0 1993/08/18 12:05:12 ram
54?RCS: Baseline for dist 3.0 netwide release.
55?RCS:
56?X:
57?X: This unit tries to remember what we did last time we ran Configure, mostly
58?X: for the sake of setting defaults.
59?X:
68f55076 60?MAKE:Oldconfig hint myuname osname osvers: Instruct Myread uname \
0f00356b 61 Checkcc Mksymlinks run \
959f3c4c
JH
62 sh awk sed test cat rm lns tr n c contains Loc Options Tr src trnl ln
63?MAKE: -pick wipe $@ %<
64?S:myuname:
08c552f3
AD
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.
959f3c4c
JH
68?S:.
69?S:hint:
70?S: Gives the type of hints used for previous answers. May be one of
71?S: "default", "recommended" or "previous".
72?S:.
73?S:osname:
74?S: This variable contains the operating system name (e.g. sunos,
75?S: solaris, hpux, etc.). It can be useful later on for setting
76?S: defaults. Any spaces are replaced with underscores. It is set
77?S: to a null string if we can't figure it out.
78?S:.
79?S:osvers:
80?S: This variable contains the operating system version (e.g.
81?S: 4.1.3, 5.2, etc.). It is primarily used for helping select
82?S: an appropriate hints file, but might be useful elsewhere for
83?S: setting defaults. It is set to '' if we can't figure it out.
84?S: We try to be flexible about how much of the version number
85?S: to keep, e.g. if 4.1.1, 4.1.2, and 4.1.3 are essentially the
86?S: same for this package, hints files might just be os_4.0 or
87?S: os_4.1, etc., not keeping separate files for each little release.
88?S:.
89?C:OSNAME:
90?C: This symbol contains the name of the operating system, as determined
91?C: by Configure. You shouldn't rely on it too much; the specific
92?C: feature tests from Configure are generally more reliable.
93?C:.
dd6f1bc3
JH
94?C:OSVERS:
95?C: This symbol contains the version of the operating system, as determined
96?C: by Configure. You shouldn't rely on it too much; the specific
97?C: feature tests from Configure are generally more reliable.
98?C:.
959f3c4c 99?H:#define OSNAME "$osname" /**/
dd6f1bc3 100?H:#define OSVERS "$osvers" /**/
959f3c4c
JH
101?H:.
102?F:!config.sh
103?T:tmp tmp_n tmp_c tmp_sh file
104?T:xxxxfile xxxfile xxfile xfile hintfile newmyuname
105?T:tans _ isesix INITPROG DJGPP
106?D:osname=''
107?LINT:change n c sh
0f00356b
JH
108?LINT:extern targetarch
109?LINT:extern hostarch
110?LINT:change hostarch
111?LINT:use run
1056f0f3 112?LINT:extern is_os2
959f3c4c
JH
113: Try to determine whether config.sh was made on this system
114case "$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!
508a21cd
JH
120?X: Now not using a subshell but instead $test.
121myuname=`$uname -a 2>/dev/null`
122$test -z "$myuname" && myuname=`hostname 2>/dev/null`
08c552f3 123# Downcase everything to avoid ambiguity.
65a32477 124# Remove slashes and single quotes so we can use parts of this in
08c552f3
AD
125# directory and file names.
126# Remove newlines so myuname is sane to use elsewhere.
959f3c4c
JH
127# tr '[A-Z]' '[a-z]' would not work in EBCDIC
128# because the A-Z/a-z are not consecutive.
08c552f3 129myuname=`echo $myuname | $sed -e "s,['/],,g" | \
959f3c4c
JH
130 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
131?X: Save the value we just computed to reset myuname after we get done here.
132newmyuname="$myuname"
133dflt=n
134case "$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;;
146esac
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.
151hint=default
152cd ..
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...
155if 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
aac52537
AD
160 n*|N*) echo "OK, I'll ignore it."
161 mv config.sh config.sh.old
162 myuname="$newmyuname"
163 ;;
959f3c4c
JH
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
180fi
14054727 181. ./UU/checkcc
959f3c4c
JH
182if test ! -f config.sh; then
183 $cat <<EOM
184
185First time through, eh? I have some defaults handy for some systems
186that need some extra help getting the Configure answers right:
187
188EOM
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`
73f6f260 200 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
959f3c4c
JH
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
ea7a0c8f 208 $test -f /system/gnu_library/bin/ar.pm && osname=vos
959f3c4c
JH
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
edd6115f
JH
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
08c552f3
AD
234?X: If we have uname, we already computed a suitable uname -a output,
235?X: and it lies in $myuname.
959f3c4c
JH
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,
65a32477 274?X: but it's close enough that I can easily imagine other vendors also
959f3c4c
JH
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
d01e9330 288?X: AIX foo 1 4 000123456789
959f3c4c
JH
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
461356af
MB
295 # oslevel can fail with:
296 # oslevel: Unable to acquire lock.
297 *not\ found) osvers="$4"."$3" ;;
959f3c4c
JH
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 ;;
edd6115f
JH
304 bsd386) osname=bsd386
305 osvers=`$uname -r`
306 ;;
307 cygwin*) osname=cygwin
308 osvers="$3"
309 ;;
959f3c4c
JH
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 ;;
d01e9330
RSG
319 dgux) osname=dgux
320 osvers="$3"
321 ;;
322 dragonfly) osname=dragonfly
959f3c4c
JH
323 osvers="$3"
324 ;;
325?X: uname -a returns
326?X: DYNIX/ptx xxx 4.0 V4.1.2 i386
327 dynixptx*) osname=dynixptx
328 osvers=`echo "$4"|sed 's/^v//'`
329 ;;
d01e9330 330 freebsd) osname=freebsd
959f3c4c 331 osvers="$3" ;;
1fde2680 332 genix) osname=genix ;;
32643781
AD
333?X: GNU/Hurd uname -a gives something like:
334?X: GNU foo 0.3 GNU-Mach 1.4/Hurd-0.3 i386-AT386 GNU
335?X: GNU gnu 0.3 GNUmach-1.2/Hurd-0.3 i386-AT386 GNU
336?X: Note the hostname on the second one, which will fool Configure
337?X: into using the SysV case!
1fde2680
BD
338 gnu) osname=gnu
339 osvers="$3" ;;
959f3c4c
JH
340?X: HP-UX uname -a gives something like
341?X: HP-UX foobar B.10.20 A 9000/735 2016483812 two-user license
342?X: Preserve the full 10.20 string instead of the previous plain '10'.
343?X: Thanks to Graham Barr. --AD 6/30/1998
d01e9330 344 hp*) osname=hpux
959f3c4c
JH
345 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
346 ;;
1fde2680 347 irix*) osname=irix
959f3c4c
JH
348 case "$3" in
349 4*) osvers=4 ;;
350 5*) osvers=5 ;;
351 *) osvers="$3" ;;
352 esac
353 ;;
1fde2680 354 linux) osname=linux
959f3c4c
JH
355 case "$3" in
356 *) osvers="$3" ;;
357 esac
358 ;;
1fde2680 359 MiNT) osname=mint
959f3c4c
JH
360 ;;
361 netbsd*) osname=netbsd
362 osvers="$3"
363 ;;
364 news-os) osvers="$3"
365 case "$3" in
366 4*) osname=newsos4 ;;
367 *) osname=newsos ;;
368 esac
369 ;;
edd6115f 370 next*) osname=next ;;
9f872204 371 nonstop-ux) osname=nonstopux ;;
b0f4b628
JH
372 openbsd) osname=openbsd
373 osvers="$3"
374 ;;
1056f0f3
JH
375 os2) osname=os2
376 osvers="$4"
377 ;;
edd6115f
JH
378 POSIX-BC | posix-bc ) osname=posix-bc
379 osvers="$3"
959f3c4c 380 ;;
959f3c4c
JH
381 powerux | power_ux | powermax_os | powermaxos | \
382 powerunix | power_unix) osname=powerux
383 osvers="$3"
384 ;;
edd6115f
JH
385 qnx) osname=qnx
386 osvers="$4"
387 ;;
959f3c4c
JH
388 solaris) osname=solaris
389 case "$3" in
390 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
391 *) osvers="$3" ;;
392 esac
393 ;;
394 sunos) osname=sunos
395 case "$3" in
396 5*) osname=solaris
397 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
398 *) osvers="$3" ;;
399 esac
400 ;;
401 titanos) osname=titanos
402 case "$3" in
403 1*) osvers=1 ;;
404 2*) osvers=2 ;;
405 3*) osvers=3 ;;
406 4*) osvers=4 ;;
407 *) osvers="$3" ;;
408 esac
409 ;;
410 ultrix) osname=ultrix
411 osvers="$3"
412 ;;
413 osf1|mls+) case "$5" in
414 alpha)
415?X: DEC OSF/1 myuname -a output looks like: osf1 xxxx t3.2 123.4 alpha
416?X: where the version number can be something like [xvt]n.n
417 osname=dec_osf
5d7a094e 418?X: sizer knows the minor minor version: the letter
8320b5cb 419 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
5d7a094e
JH
420 case "$osvers" in
421 [1-9].[0-9]*) ;;
422 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
423 esac
959f3c4c
JH
424 ;;
425 hp*) osname=hp_osf1 ;;
426 mips) osname=mips_osf1 ;;
427?X: hp and mips were unsupported Technology Releases -- ADO, 24/10/94
428 esac
429 ;;
6e46fa65 430 # UnixWare 7.1.2 is known as Open UNIX 8
a5f24678 431 openunix|unixware) osname=svr5
4ac3c55c
A
432 osvers="$4"
433 ;;
9dbcc431 434 uts) osname=uts
959f3c4c
JH
435 osvers="$3"
436 ;;
9dbcc431
JH
437 vos) osvers="$3"
438 ;;
959f3c4c
JH
439 $2) case "$osname" in
440 *isc*) ;;
441 *freebsd*) ;;
442 svr*)
443 : svr4.x or possibly later
d01e9330 444 case "svr$3" in
959f3c4c
JH
445 ${osname}*)
446 osname=svr$3
447 osvers=$4
448 ;;
449 esac
450 case "$osname" in
451 svr4.0)
452 : Check for ESIX
453 if test -f /stand/boot ; then
454 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
455 if test -n "$INITPROG" -a -f "$INITPROG"; then
456 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
457 if test -n "$isesix"; then
458 osname=esix4
459 fi
460 fi
461 fi
462 ;;
463 esac
464 ;;
465 *) if test -f /etc/systemid; then
466 osname=sco
467 set `echo $3 | $sed 's/\./ /g'` $4
468 if $test -f $src/hints/sco_$1_$2_$3.sh; then
469 osvers=$1.$2.$3
470 elif $test -f $src/hints/sco_$1_$2.sh; then
471 osvers=$1.$2
472 elif $test -f $src/hints/sco_$1.sh; then
473 osvers=$1
474 fi
475 else
476 case "$osname" in
477 '') : Still unknown. Probably a generic Sys V.
478 osname="sysv"
479 osvers="$3"
480 ;;
481 esac
482 fi
483 ;;
484 esac
485 ;;
486 *) case "$osname" in
487 '') : Still unknown. Probably a generic BSD.
488 osname="$1"
489 osvers="$3"
490 ;;
491 esac
492 ;;
493 esac
494 else
495?X: Try to identify sony's NEWS-OS (BSD unix)
496 if test -f /vmunix -a -f $src/hints/news_os.sh; then
497 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
498 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
499 osname=news_os
500 fi
501 $rm -f UU/kernel.what
502?X: Maybe it's OS/2 or DOS or something similar
1056f0f3 503 elif test -d c:/. -o -n "$is_os2" ; then
959f3c4c
JH
504 set X $myuname
505 osname=os2
506 osvers="$5"
507 fi
508 fi
d01e9330 509
0f00356b
JH
510 case "$targetarch" in
511 '') ;;
512 *) hostarch=$osname
513 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
514 osvers=''
515 ;;
516 esac
517
959f3c4c
JH
518 : Now look for a hint file osname_osvers, unless one has been
519 : specified already.
520 case "$hintfile" in
521 ''|' ')
70ffff07 522 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
959f3c4c 523 : Also try without trailing minor version numbers.
70ffff07
DD
524 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
525 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
526 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
527 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
959f3c4c
JH
528 case "$file" in
529 '') dflt=none ;;
530 *) case "$osvers" in
531 '') dflt=$file
532 ;;
533 *) if $test -f $src/hints/$file.sh ; then
534 dflt=$file
535 elif $test -f $src/hints/$xfile.sh ; then
536 dflt=$xfile
537 elif $test -f $src/hints/$xxfile.sh ; then
538 dflt=$xxfile
539 elif $test -f $src/hints/$xxxfile.sh ; then
540 dflt=$xxxfile
541 elif $test -f $src/hints/$xxxxfile.sh ; then
542 dflt=$xxxxfile
543 elif $test -f "$src/hints/${osname}.sh" ; then
544 dflt="${osname}"
545 else
546 dflt=none
547 fi
548 ;;
549 esac
550 ;;
551 esac
552 if $test -f Policy.sh ; then
553 case "$dflt" in
554 *Policy*) ;;
555 none) dflt="Policy" ;;
556 *) dflt="Policy $dflt" ;;
557 esac
558 fi
559 ;;
560 *)
561 dflt=`echo $hintfile | $sed 's/\.sh$//'`
562 ;;
563 esac
564
565 if $test -f Policy.sh ; then
566 $cat <<EOM
567
568There's also a Policy hint file available, which should make the
569site-specific (policy) questions easier to answer.
570EOM
571
572 fi
573
574 $cat <<EOM
575
576You may give one or more space-separated answers, or "none" if appropriate.
dda48488
DD
577If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
578previous run of Configure, you may specify it as well as or instead of
579OS-specific hints. If hints are provided for your OS, you should use them:
580although Perl can probably be built without hints on many platforms, using
581hints often improve performance and may enable features that Configure can't
582set up on its own. If there are no hints that match your OS, specify "none";
583DO NOT give a wrong version or a wrong OS.
959f3c4c
JH
584
585EOM
586
587 rp="Which of these apply, if any?"
588 . UU/myread
589 tans=$ans
590 for file in $tans; do
591 if $test X$file = XPolicy -a -f Policy.sh; then
592 . Policy.sh
593 $cat Policy.sh >> UU/config.sh
594 elif $test -f $src/hints/$file.sh; then
595 . $src/hints/$file.sh
596 $cat $src/hints/$file.sh >> UU/config.sh
0f00356b 597 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
959f3c4c
JH
598 : nothing
599 else
600 : Give one chance to correct a possible typo.
601 echo "$file.sh does not exist"
602 dflt=$file
603 rp="hint to use instead?"
604 . UU/myread
605 for file in $ans; do
606 if $test -f "$src/hints/$file.sh"; then
607 . $src/hints/$file.sh
608 $cat $src/hints/$file.sh >> UU/config.sh
609 elif $test X$ans = X -o X$ans = Xnone ; then
610 : nothing
611 else
612 echo "$file.sh does not exist -- ignored."
613 fi
614 done
615 fi
616 done
617
618 hint=recommended
619 : Remember our hint file for later.
620 if $test -f "$src/hints/$file.sh" ; then
621 hintfile="$file"
622 else
623 hintfile=''
624 fi
625fi
626cd UU
627?X: From here on, we must use $rsrc instead of $src
628@else
629: Get old answers, if there is a config file out there
630hint=default
631hintfile=''
632if test -f ../config.sh; then
633 echo " "
634 rp="I see a config.sh file. Shall I use it to set the defaults?"
635 . ./myread
636 case "$ans" in
637 n*|N*) echo "OK, I'll ignore it.";;
638 *) echo "Fetching default answers from your old config.sh file..." >&4
639 tmp_n="$n"
640 tmp_c="$c"
641 . ../config.sh
642 cp ../config.sh .
643 n="$tmp_n"
644 c="$tmp_c"
645 hint=previous
646 ;;
647 esac
648fi
649@end
650?X: remember, indentation is wrong--RAM
651;;
652*)
653 echo " "
654 echo "Fetching default answers from $config_sh..." >&4
655 tmp_n="$n"
656 tmp_c="$c"
657 cd ..
658?X: preserve symbolic links, if any
659 cp $config_sh config.sh 2>/dev/null
660 chmod +w config.sh
661 . ./config.sh
662 cd UU
663 cp ../config.sh .
664 n="$tmp_n"
665 c="$tmp_c"
666 hint=previous
667 ;;
668esac
669test "$override" && . ./optdef.sh
959f3c4c
JH
670
671: Restore computed paths
672for file in $loclist $trylist; do
673 eval $file="\$_$file"
674done
675
676@if osname || osvers
677cat << EOM
678
679Configure uses the operating system name and version to set some defaults.
680The default value is probably right if the name rings a bell. Otherwise,
681since spelling matters for me, either accept the default or answer "none"
682to leave it blank.
683
684EOM
685@end
686@if osname
687case "$osname" in
688 ''|' ')
689 case "$hintfile" in
690 ''|' '|none) dflt=none ;;
691 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
692 esac
693 ;;
694 *) dflt="$osname" ;;
695esac
696rp="Operating system name?"
697. ./myread
698case "$ans" in
699none) osname='' ;;
700*) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
701esac
702@end
703@if osvers
704@if osname
705echo " "
706@end
707case "$osvers" in
708 ''|' ')
709 case "$hintfile" in
710 ''|' '|none) dflt=none ;;
711 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
712 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
713 case "$dflt" in
714 ''|' ') dflt=none ;;
715 esac
716 ;;
717 esac
718 ;;
719 *) dflt="$osvers" ;;
720esac
721rp="Operating system version?"
722. ./myread
723case "$ans" in
724none) osvers='' ;;
725*) osvers="$ans" ;;
726esac
727
728@end
c71449a6
JH
729
730. ./posthint.sh
731