summaryrefslogtreecommitdiff
path: root/mcon/U/Oldconfig.U
blob: ca189475d479e8850f4970116509f1fd59f96a45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
?RCS: $Id$
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: Oldconfig.U,v $
?RCS: Revision 3.0.1.10  1997/02/28  15:06:39  ram
?RCS: patch61: added support for src.U
?RCS: patch61: new OSNAME define
?RCS: patch61: can now sense new OSes
?RCS:
?RCS: Revision 3.0.1.9  1995/07/25  13:40:51  ram
?RCS: patch56: now knows about OS/2 platforms
?RCS:
?RCS: Revision 3.0.1.8  1995/05/12  12:04:18  ram
?RCS: patch54: config.sh reload logic now knows about new -K switch
?RCS: patch54: cleaned up and extended osvers for DEC OSF/1 (ADO)
?RCS: patch54: added MachTen detection (ADO)
?RCS:
?RCS: Revision 3.0.1.7  1995/02/15  14:13:41  ram
?RCS: patch51: adapted osvers computation for AIX (ADO)
?RCS:
?RCS: Revision 3.0.1.6  1995/01/30  14:27:15  ram
?RCS: patch49: unit Options.U now exports file optdef.sh, not a variable
?RCS: patch49: update code for myuname changed (WED)
?RCS:
?RCS: Revision 3.0.1.5  1995/01/11  15:15:36  ram
?RCS: patch45: added quotes around the INITPROG variable (ADO)
?RCS: patch45: allows variable overriding after config file loading
?RCS:
?RCS: Revision 3.0.1.4  1994/10/29  15:57:05  ram
?RCS: patch36: added ?F: line for metalint file checking
?RCS: patch36: merged with the version used for perl5's Configure (ADO)
?RCS:
?RCS: Revision 3.0.1.3  1994/05/06  14:24:17  ram
?RCS: patch23: added support for osf1 hints
?RCS: patch23: new support for solaris and i386 systems (ADO)
?RCS:
?RCS: Revision 3.0.1.2  1994/01/24  14:05:02  ram
?RCS: patch16: added post-processing on myuname for Xenix targets
?RCS: patch16: message proposing config.sh defaults made consistent
?RCS:
?RCS: Revision 3.0.1.1  1993/09/13  15:56:32  ram
?RCS: patch10: force use of config.sh when -d option is used (WAD)
?RCS: patch10: complain about non-existent hint files (WAD)
?RCS: patch10: added Options dependency for fastread variable
?RCS:
?RCS: Revision 3.0  1993/08/18  12:05:12  ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?X:
?X: This unit tries to remember what we did last time we ran Configure, mostly
?X: for the sake of setting defaults.
?X:
?MAKE:Oldconfig hint myuname osname osvers: Instruct Myread Checkcc \
	Mksymlinks Loc Options Tr src trnl ln uname sh awk sed test cat grep \
	rm lns tr n c contains targetarch
?MAKE:	-pick wipe $@ %<
?S:myuname:
?S:	The output of 'uname -a' if available, otherwise the hostname. On Xenix,
?S:	pseudo variables assignments in the output are stripped, thank you. The
?S:	whole thing is then lower-cased.
?S:.
?S:hint:
?S:	Gives the type of hints used for previous answers. May be one of
?S:	"default", "recommended" or "previous".
?S:.
?S:osname:
?S:	This variable contains the operating system name (e.g. sunos,
?S:	solaris, hpux, etc.).  It can be useful later on for setting
?S:	defaults.  Any spaces are replaced with underscores.  It is set
?S:	to a null string if we can't figure it out.
?S:.
?S:osvers:
?S:	This variable contains the operating system version (e.g.
?S:	4.1.3, 5.2, etc.).  It is primarily used for helping select
?S:	an appropriate hints file, but might be useful elsewhere for
?S:	setting defaults.  It is set to '' if we can't figure it out.
?S:	We try to be flexible about how much of the version number
?S:	to keep, e.g. if 4.1.1, 4.1.2, and 4.1.3 are essentially the
?S:	same for this package, hints files might just be os_4.0 or
?S:	os_4.1, etc., not keeping separate files for each little release.
?S:.
?C:OSNAME:
?C:	This symbol contains the name of the operating system, as determined
?C:	by Configure.  You shouldn't rely on it too much; the specific
?C:	feature tests from Configure are generally more reliable.
?C:.
?C:OSVERS:
?C:	This symbol contains the version of the operating system, as determined
?C:	by Configure.  You shouldn't rely on it too much; the specific
?C:	feature tests from Configure are generally more reliable.
?C:.
?H:#define OSNAME "$osname"		/**/
?H:#define OSVERS "$osvers"		/**/
?H:.
?F:!config.sh
?T:tmp tmp_n tmp_c tmp_sh file
?T:xxxxfile xxxfile xxfile xfile hintfile newmyuname
?T:tans _ isesix INITPROG DJGPP has_uname
?T:saved_osname saved_osvers saved_libswanted
?D:osname=''
?LINT:change n c sh
?LINT:extern hostarch libswanted libs
?LINT:change hostarch libswanted libs
: Determine the name of the machine
myuname=`$uname -a 2>/dev/null`
$test -z "$myuname" && myuname=`hostname 2>/dev/null`
?X: Special mention for Xenix, whose 'uname -a' gives us output like this:
?X:  sysname=XENIX
?X:  nodename=whatever
?X:  release=2.3.2 .. etc...
?X: Therefore, we strip all this variable assignment junk and remove all the
?X: new lines to keep the myuname variable sane... --RAM
myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
	./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
?X: Save the value we just computed to reset myuname after we get done here.
newmyuname="$myuname"
has_uname=
$test -f "$uname" && has_uname=y

: Guessing of the OS name -- half the following guesses are probably wrong...
: If you have better tests or hints, please send them to the metaconfig
: authors and to <MAINTLOC>
$test -f /irix && osname=irix
$test -f /xenix && osname=sco_xenix
$test -f /dynix && osname=dynix
$test -f /dnix && osname=dnix
$test -f /lynx.os && osname=lynxos
$test -f /unicos && osname=unicos && osvers=`$uname -r`
$test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
$test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
$test -f /bin/mips && /bin/mips && osname=mips
$test -d /NextApps && set X `hostinfo | $grep 'NeXT Mach.*:' | \
	$sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
$test -d /usr/apollo/bin && osname=apollo
$test -f /etc/saf/_sactab && osname=svr4
$test -d /usr/include/minix && osname=minix
$test -f /system/gnu_library/bin/ar.pm && osname=vos
if $test -d /MachTen -o -d /MachTen_Folder; then
?X:		MachTen uname -a output looks like
?X:		xxx 4 0.0 Macintosh
?X:		MachTen /sbin/version output looks like
?X:		MachTen 4.0 Mon Aug 28 10:18:00 1995
?X:		MachTen 3.x had the 'version' command in /usr/etc/version.
	osname=machten
	if $test -x /sbin/version; then
		osvers=`/sbin/version | $awk '{print $2}' |
		$sed -e 's/[A-Za-z]$//'`
	elif $test -x /usr/etc/version; then
		osvers=`/usr/etc/version | $awk '{print $2}' |
		$sed -e 's/[A-Za-z]$//'`
	else
		osvers="$2.$3"
	fi
fi
$test -f /sys/posix.dll &&
	$test -f /usr/bin/what &&
	set X `/usr/bin/what /sys/posix.dll` &&
	$test "$3" = UWIN &&
	osname=uwin &&
	osvers="$5"
?X: If we have uname, we already computed a suitable uname -a output, correctly
?X: formatted for Xenix, and it lies in $myuname.
if $test "X$has_uname" != X; then
	set X $myuname
	shift
	case "$5" in
	fps*) osname=fps ;;
	mips*)
		case "$4" in
		umips) osname=umips ;;
		*) osname=mips ;;
		esac;;
	[23]100) osname=mips ;;
	next*) osname=next ;;
?X: Interactive Unix.
	i386*)
		tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
		if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
			osname='sco'
			osvers=$tmp
		elif $test -f /etc/kconfig; then
			osname=isc
			if $test "$lns" = "$ln -s"; then
				osvers=4
			elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
				osvers=3
			elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1
			then
				osvers=2
			fi
		fi
		tmp=''
		;;
?X: MS-DOS djgpp uname -a output looks like:
?X: ms-dos xxx 6 22 pc
?X:  $1 is the "dos flavor" (need not be "ms-dos").
?X:  $2 is the node name
?X:  $3 and $4 are version/subversion
?X:  $5 is always "pc", but that might not be unique to DJGPP.
?X: (e.g. Solaris_x86 has $5 = i86pc, which doesn't actually conflict,
?X: but it's close enough that I can easily imagine other vendors also
?X: using variants of pc* in $5.)
?X:  The "DJGPP" environment variable is always set when djgpp is active.
	pc*)
		if $test -n "$DJGPP"; then
			osname=dos
			osvers=djgpp
		fi
		;;
	esac
	case "$1" in
	aix) osname=aix
?X: aix 4.1 uname -a output looks like
?X:		AIX  foo  1 4 000123456789
?X: where $4 is the major release number and $3 is the (minor) version.
?X: More detail on the version is available with the oslevel command.
?X: in 3.2.x, it output a string (see case statements below).  In 4.1,
?X: it puts out something like  4.1.1.0
		tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
		case "$tmp" in
		'not found') osvers="$4"."$3" ;;
		'<3240'|'<>3240') osvers=3.2.0 ;;
		'=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
		'=3250'|'>3250') osvers=3.2.5 ;;
		*) osvers=$tmp;;
		esac
		;;
	bsd386) osname=bsd386
		osvers=`$uname -r`
		;;
	cygwin*) osname=cygwin
		osvers=`echo "$3" | sed -e 's/\(.*\)(.*/\1/'`
		;;
	mingw*) osname=mingw
		osvers=`echo "$3" | sed -e 's/\(.*\)(.*/\1/'`
		;;
	*dc.osx) osname=dcosx
		osvers="$3"
		;;
	dnix) osname=dnix
		osvers="$3"
		;;
	domainos) osname=apollo
		osvers="$3"
		;;
	dgux) osname=dgux 
		osvers="$3"
		;;
?X:		uname -a returns
?X:		DYNIX/ptx xxx 4.0 V4.1.2 i386
	dynixptx*) osname=dynixptx
		osvers=`echo "$4"|sed 's/^v//'`
		;;
	freebsd) osname=freebsd 
		osvers="$3" ;;
	genix) osname=genix ;;
?X: HP-UX uname -a gives something like
?X: HP-UX foobar B.10.20 A 9000/735 2016483812 two-user license
?X: Preserve the full 10.20 string instead of the previous plain '10'.
?X:  Thanks to Graham Barr.    --AD 6/30/1998
	hp*) osname=hpux 
		osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
		;;
	irix*) osname=irix
		case "$3" in
		4*) osvers=4 ;;
		5*) osvers=5 ;;
		*)	osvers="$3" ;;
		esac
		;;
	linux) osname=linux
		case "$3" in
		*)	osvers="$3" ;;
		esac
		;;
	MiNT) osname=mint
		;;
	netbsd*) osname=netbsd
		osvers="$3"
		;;
	news-os) osvers="$3"
		case "$3" in
		4*) osname=newsos4 ;;
		*) osname=newsos ;;
		esac
		;;
	next*) osname=next ;;
	nonstop-ux) osname=nonstopux ;;
	openbsd) osname=openbsd
				osvers="$3"
				;;
	POSIX-BC | posix-bc ) osname=posix-bc
		osvers="$3"
		;;
	powerux | power_ux | powermax_os | powermaxos | \
	powerunix | power_unix) osname=powerux
		osvers="$3"
		;;
	qnx) osname=qnx
		osvers="$4"
		;;
	solaris) osname=solaris
		case "$3" in
		5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
		*)	osvers="$3" ;;
		esac
		;;
	sunos) osname=sunos
		case "$3" in
		5*) osname=solaris
			osvers=`echo $3 | $sed 's/^5/2/g'` ;;
		*)	osvers="$3" ;;
		esac
		;;
	titanos) osname=titanos
		case "$3" in
		1*) osvers=1 ;;
		2*) osvers=2 ;;
		3*) osvers=3 ;;
		4*) osvers=4 ;;
		*)	osvers="$3" ;;
		esac
		;;
	ultrix) osname=ultrix
		osvers="$3"
		;;
	osf1|mls+)	case "$5" in
		alpha)
?X: DEC OSF/1 myuname -a output looks like:  osf1 xxxx t3.2 123.4 alpha
?X: where the version number can be something like [xvt]n.n
			osname=dec_osf
?X: sizer knows the minor minor version: the letter
			osvers=`sizer -v | awk '{print $3}' | \
				./tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
			case "$osvers" in
			[1-9].[0-9]*) ;;
			*) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
			esac
			;;
		hp*)	osname=hp_osf1	;;
		mips)	osname=mips_osf1 ;;
?X:	hp and mips were unsupported Technology Releases -- ADO, 24/10/94
		esac
		;;
	unixware) osname=svr5
		osvers="$4"
		;;
	uts)	osname=uts
		osvers="$3"
		;;
	vos) osvers="$3"
		;;
	$2) case "$osname" in
		*isc*) ;;
		*freebsd*) ;;
		svr*)
			: svr4.x or possibly later
			case "svr$3" in	
			${osname}*)
				osname=svr$3
				osvers=$4
				;;
			esac
			case "$osname" in
			svr4.0)
				: Check for ESIX
				if $test -f /stand/boot ; then
					eval `$grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
					if $test -n "$INITPROG" -a -f "$INITPROG"; then
						isesix=`strings -a $INITPROG | \
							$grep 'ESIX SYSTEM V/386 Release 4.0'`
						if $test -n "$isesix"; then
							osname=esix4
						fi
					fi
				fi
				;;
			esac
			;;
		*)	if $test -f /etc/systemid; then
				osname=sco
				set `echo $3 | $sed 's/\./ /g'` $4
				if $test -f $src/hints/sco_$1_$2_$3.sh; then
					osvers=$1.$2.$3
				elif $test -f $src/hints/sco_$1_$2.sh; then
					osvers=$1.$2
				elif $test -f $src/hints/sco_$1.sh; then
					osvers=$1
				fi
			else
				case "$osname" in
				'') : Still unknown.  Probably a generic Sys V.
					osname="sysv"
					osvers="$3"
					;;
				esac
			fi
			;;
		esac
		;;
	*)	case "$osname" in
		'') : Still unknown.  Probably a generic BSD.
			osname="$1"
			osvers="$3"
			;;
		esac
		;;
	esac
else
?X: Try to identify sony's NEWS-OS (BSD unix)
	if $test -f /vmunix -a -f $src/hints/news_os.sh; then
		(what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
		if $contains news-os UU/kernel.what >/dev/null 2>&1; then
			osname=news_os
		fi
		$rm -f UU/kernel.what
?X: Maybe it's OS/2 or DOS or something similar
	elif $test -d c:/.; then
		set X $myuname
		osname=os2
		osvers="$5"
	fi
fi

: Try to determine whether config.sh was made on this system
case "$config_sh" in
'')
?X: indentation wrong on purpose--RAM
dflt=n
case "$knowitall" in
'')
	if test -f ../config.sh; then
		if $contains myuname= ../config.sh >/dev/null 2>&1; then
			eval "`$grep myuname= ../config.sh`"
		fi
		if test "X$myuname" = "X$newmyuname"; then
			dflt=y
		fi
	fi
	;;
*) dflt=y;;
esac

?X: Before loading a previous config.sh, save the variables we've
?X: just computed above so that we can propagate these new values.
saved_osname="$osname"
saved_osvers="$osvers"
saved_libswanted="$libswanted"
tmp_n="$n"
tmp_c="$c"
tmp_sh="$sh"

: Get old answers from config file if it was generated on the same system
hint=default
if $test -f ../config.sh; then
	echo " "
	rp="I see a config.sh file.  Shall I use it to set the defaults?"
	. ./myread
	case "$ans" in
	n*|N*) echo "OK, I'll ignore it."
		mv ../config.sh ../config.sh.old
		myuname="$newmyuname"
		;;
	*)  echo "Fetching default answers from your old config.sh file..." >&4
		. ../config.sh
		cp ../config.sh .
		hint=previous
		case "$dflt" in
		n)
			echo " "
			rp="Do you want further invocations to use these defaults?"
			. ./myread
			case "$ans" in
			y*|Y*) myuname="$newmyuname";;
			esac
			;;
		esac
		;;
	esac
fi
?X: remember, case indentation is wrong--RAM
;;
*)
	echo " "
	echo "Fetching default answers from $config_sh..." >&4
	cd ..
?X: preserve symbolic links, if any
	cp $config_sh config.sh 2>/dev/null
	chmod +w config.sh
	. ./config.sh
	cd UU
	cp ../config.sh .
	hint=previous
	;;
esac
?X: Older versions did not always set $sh.
case "$sh" in
'') sh="$tmp_sh" ;;
esac
$test "$override" && . ./optdef.sh

: Restore computed paths
for file in $loclist $trylist; do
	eval $file="\$_$file"
done

?X: Restore saved variables
osname="$saved_osname"
osvers="$saved_osvers"
n="$tmp_n"
c="$tmp_c"

?X: Reset libs when libswanted changed since last time
case "$libswanted" in
"$saved_libswanted") ;;
*) libs='';;
esac
libswanted="$saved_libswanted"

. ./checkcc
?X: Cross-compiling support
case "$targetarch" in
'') ;;
*)  hostarch=$osname
	osname=`echo $targetarch|sed 's,^[^-]*-,,'`
	osvers=''
	;;
esac

@if {test -d ../hints}
: Offer them some hints based on their OS
cd ..
?X: Since we are now at the root of the source tree, we must use $src
?X: to access the sources and not $rsrc. See src.U for details...
if $test ! -f config.sh; then
	$cat <<EOM

First time through, eh?  I have some defaults handy for some systems
that need some extra help getting the Configure answers right:

EOM
	(cd $src/hints; ls -C *.sh) | $sed 's/\.sh/   /g' >&4
	dflt=''

	: Now look for a hint file osname_osvers, unless one has been
	: specified already.
	case "$hintfile" in
	''|' ')
		file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
		: Also try without trailing minor version numbers.
		xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
		xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
		xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
		xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
		case "$file" in
		'') dflt=none ;;
		*)  case "$osvers" in
			'') dflt=$file
				;;
			*)  if $test -f $src/hints/$file.sh ; then
					dflt=$file
				elif $test -f $src/hints/$xfile.sh ; then
					dflt=$xfile
				elif $test -f $src/hints/$xxfile.sh ; then
					dflt=$xxfile
				elif $test -f $src/hints/$xxxfile.sh ; then
					dflt=$xxxfile
				elif $test -f $src/hints/$xxxxfile.sh ; then
					dflt=$xxxxfile
				elif $test -f "$src/hints/${osname}.sh" ; then
					dflt="${osname}"
				else
					dflt=none
				fi
				;;
			esac
			;;
		esac
		if $test -f Policy.sh ; then
			case "$dflt" in
			*Policy*) ;;
			none) dflt="Policy" ;;
			*) dflt="Policy $dflt" ;;
			esac
		fi
		;;
	*)
		dflt=`echo $hintfile | $sed 's/\.sh$//'`
		;;
	esac

	if $test -f Policy.sh ; then
		$cat <<EOM

There's also a Policy hint file available, which should make the
site-specific (policy) questions easier to answer.
EOM

	fi

	$cat <<EOM

You may give one or more space-separated answers, or "none" if appropriate.
A well-behaved OS will have no hints, so answering "none" or just "Policy"
is a good thing.  DO NOT give a wrong version or a wrong OS.

EOM

	rp="Which of these apply, if any?"
	. UU/myread
	tans=$ans
	for file in $tans; do
		if $test X$file = XPolicy -a -f Policy.sh; then
			. Policy.sh
			$cat Policy.sh >> UU/config.sh
		elif $test -f $src/hints/$file.sh; then
			. $src/hints/$file.sh
			$cat $src/hints/$file.sh >> UU/config.sh
		elif $test X"$tans" = X -o X"$tans" = Xnone ; then
			: nothing
		else
			: Give one chance to correct a possible typo.
			echo "$file.sh does not exist"
			dflt=$file
			rp="hint to use instead?"
			. UU/myread
			for file in $ans; do
				if $test -f "$src/hints/$file.sh"; then
					. $src/hints/$file.sh
					$cat $src/hints/$file.sh >> UU/config.sh
				elif $test X$ans = X -o X$ans = Xnone ; then
					: nothing
				else
					echo "$file.sh does not exist -- ignored."
				fi
			done
		fi
	done

	hint=recommended
	: Remember our hint file for later.
	if $test -f "$src/hints/$file.sh" ; then
		hintfile="$file"
	else
		hintfile=''
	fi
fi
cd UU
?X: From here on, we must use $rsrc instead of $src

@end
: Process their -A options
. ./posthint.sh

@if osname || osvers
: Ask them to confirm the OS name
cat << EOM

Configure uses the operating system name and version to set some defaults.
The default value is probably right if the name rings a bell. Otherwise,
since spelling matters for me, either accept the default or answer "none"
to leave it blank.

EOM
@end
@if osname
case "$osname" in
	''|' ')
		case "$hintfile" in
		''|' '|none) dflt=none ;;
		*)  dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
		esac
		;;
	*) dflt="$osname" ;;
esac
rp="Operating system name?"
. ./myread
case "$ans" in
none)  osname='' ;;
*) osname=`echo "$ans" | $sed -e 's/[ 	][	]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
esac
@end
@if osvers
@if osname
echo " "
@end
case "$osvers" in
	''|' ')
		case "$hintfile" in
		''|' '|none) dflt=none ;;
		*)	dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
			dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
			case "$dflt" in
			''|' ') dflt=none ;;
			esac
			;;
		esac
		;;
	*) dflt="$osvers" ;;
esac
rp="Operating system version?"
. ./myread
case "$ans" in
none)  osvers='' ;;
*) osvers="$ans" ;;
esac

@end