1 ?RCS: $Id: Config_sh.U 1 2006-08-24 12:32:52Z rmanfredi $
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
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 Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: $Log: Config_sh.U,v $
12 ?RCS: Revision 3.0.1.3 1997/02/28 14:57:53 ram
13 ?RCS: patch61: added support for src.U
15 ?RCS: Revision 3.0.1.2 1995/01/11 14:53:31 ram
16 ?RCS: patch45: moved path stripping from d_portable.U to end of Configure
18 ?RCS: Revision 3.0.1.1 1994/10/29 15:50:37 ram
19 ?RCS: patch36: added ?F: line for metalint file checking
21 ?RCS: Revision 3.0 1993/08/18 12:04:48 ram
22 ?RCS: Baseline for dist 3.0 netwide release.
25 ?X: This unit ends up producing the config.sh script, which contains all the
26 ?X: definitions figured out by Configure. The add.Config_sh command knows
27 ?X: which variables need to be remembered. It also adds the EOT (ends the
28 ?X: here document redirection with variable substitution).
30 ?MAKE:Config_sh: cf_time cf_by test spitshell startsh myuname Myread \
31 End Obsol_sh Loc +d_portable package src cat
32 ?MAKE: -pick add.Config_sh $@ %<
33 ?MAKE: -pick add $@ ./Obsol_sh
34 ?MAKE: -pick close.Config_sh $@ %<
35 ?F:!config.over !config.arch
38 : back to where it started
39 if test -d ../UU; then
43 : configuration may be unconditionally patched via a 'config.arch' file
44 if $test -f config.arch; then
45 echo "I see a config.arch file, loading it." >&4
49 : configuration may be patched via a 'config.over' file
50 if $test -f config.over; then
53 rp='I see a config.over file. Do you wish to load it?'
56 n*) echo "OK, I'll ignore it.";;
58 echo "Configuration override changes have been loaded."
64 : in case they want portability, strip down executable paths
66 ?X: Strip down paths in located executables. For each file, e.g. vi, there
67 ?X: is a $vi variable whose value is for instance '/usr/bin/vi'. By resetting
68 ?X: $vi to 'vi', we rely on the PATH variable to locate the executable...
73 echo "Stripping down executable paths..." >&4
75 ?X: Previously, we used to do eval $file="\$file" but in order
76 ?X: to handle things like sh Configure -Dmake=gmake, we can't do
77 ?X: that. What we *really* want is to strip away the absolute path
78 ?X: and rely on the end user's $PATH to correctly find the executable.
79 ?X: This method assumes there is a "basename" command available. If
80 ?X: not, replace it with the following expr-based command:
81 ?X: expr $temp : '.*/\(.*\)' \| $temp
82 ?X: Since this preserves the actual command name, we can now drop the
83 ?X: OS/2 specific code.
84 ?X: --Andy Dougherty August 1999
86 ?X: On OS/2, a special $ar command not even named 'ar' is required,
87 ?X: so we don't strip that name.
88 ?X: Also, on DOSish systems, there might not be a ln command, but we
89 ?X: might have ln='cp'.
90 ?X: However, we can't set d_portable=undef on such systems since
91 ?X: Unix-ish tools don't have standard locations there. Thus we
92 ?X: MUST rely on the user's $PATH.
93 ?X: --Andy Dougherty 4/1998
95 for file in $loclist $trylist; do
97 eval $file=`basename $temp`
103 : create config.sh file
105 echo "Creating config.sh..." >&4
106 $spitshell <<EOT >config.sh
109 # This file was produced by running the Configure script. It holds all the
110 # definitions figured out by Configure. Should you modify one of these values,
111 # do not forget to propagate your changes by running "Configure -der". You may
112 # instead choose to run each of the .SH files by yourself, or "Configure -S".
115 # Package name : $package
116 # Source directory : $src
117 # Configuration time: $cf_time
118 # Configured by : $cf_by
119 # Target system : $myuname
122 ?X: Command line options are saved by the Options.U unit in the
123 ?X: temporary file UU/cmdline.opt
124 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
125 $spitshell <<EOT >>config.sh