summaryrefslogtreecommitdiff
path: root/mcon/U/Config_sh.U
blob: 45f7fc8949d16ff810dc1e344abffbd187605b71 (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
?RCS: $Id: Config_sh.U 1 2006-08-24 12:32:52Z rmanfredi $
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS: 
?RCS: You may redistribute only under the terms of the Artistic Licence,
?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 Licence; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: Config_sh.U,v $
?RCS: Revision 3.0.1.3  1997/02/28  14:57:53  ram
?RCS: patch61: added support for src.U
?RCS:
?RCS: Revision 3.0.1.2  1995/01/11  14:53:31  ram
?RCS: patch45: moved path stripping from d_portable.U to end of Configure
?RCS:
?RCS: Revision 3.0.1.1  1994/10/29  15:50:37  ram
?RCS: patch36: added ?F: line for metalint file checking
?RCS:
?RCS: Revision 3.0  1993/08/18  12:04:48  ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?X: 
?X: This unit ends up producing the config.sh script, which contains all the
?X: definitions figured out by Configure.  The add.Config_sh command knows
?X: which variables need to be remembered.  It also adds the EOT (ends the
?X: here document redirection with variable substitution).
?X: 
?MAKE:Config_sh: cf_time cf_by test spitshell startsh myuname Myread \
	End Obsol_sh Loc +d_portable package src cat sed
?MAKE:	-pick add.Config_sh $@ %<
?MAKE:	-pick add $@ ./Obsol_sh
?MAKE:	-pick close.Config_sh $@ %<
?F:!config.over !config.arch
?T:file sfile xsed
?LINT:unclosed EOT
: back to where it started
if test -d ../UU; then
	cd ..
fi

: configuration may be unconditionally patched via a 'config.arch' file
if $test -f config.arch; then
	echo "I see a config.arch file, loading it." >&4
	. ./config.arch
fi

: configuration may be patched via a 'config.over' file
if $test -f config.over; then
	echo " "
	dflt=y
	rp='I see a config.over file.  Do you wish to load it?'
	. UU/myread
	case "$ans" in
	n*) echo "OK, I'll ignore it.";;
	*)	. ./config.over
		echo "Configuration override changes have been loaded."
		;;
	esac
fi

@if d_portable
: in case they want portability, strip down executable paths
?X:
?X: Strip down paths in located executables. For each file, e.g. vi, there
?X: is a $vi variable whose value is for instance '/usr/bin/vi'. By resetting
?X: $vi to 'vi', we rely on the PATH variable to locate the executable...
?X: In order to allow vi='/usr/bin/nvi' which will strip down to vi='nvi',
?X: we can't just say 'eval $file="\$file"', we have to recourse to sed.
?X: We don't use basename since it is less portable than sed.
?X:
case "$d_portable" in
"$define")
	echo " "
	echo "Stripping down executable paths..." >&4
	xsed=$sed
	for file in $loclist $trylist; do
		eval sfile="\$$file"
		sfile=`echo $sfile | $xsed -e 's,.*/\(.*\),\1,'`
		eval $file="$sfile"
	done
	;;
esac

@end
: create config.sh file
echo " "
echo "Creating config.sh..." >&4
$spitshell <<EOT >config.sh
$startsh
#
# This file was produced by running the Configure script. It holds all the
# definitions figured out by Configure. Should you modify one of these values,
# do not forget to propagate your changes by running "Configure -der". You may
# instead choose to run each of the .SH files by yourself, or "Configure -S".
#

# Package name      : $package
# Source directory  : $src
# Configuration time: $cf_time
# Configured by     : $cf_by
# Target system     : $myuname

EOT
?X: Command line options are saved by the Options.U unit in the
?X: temporary file UU/cmdline.opt
$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
$spitshell <<EOT >>config.sh