This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add the files from dist/meta to perl's repo
[metaconfig.git] / dist / U / Config_sh.U
1 ?RCS: $Id: Config_sh.U 1 2006-08-24 12:32:52Z rmanfredi $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
4 ?RCS:
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.
10 ?RCS:
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
14 ?RCS:
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
17 ?RCS:
18 ?RCS: Revision 3.0.1.1  1994/10/29  15:50:37  ram
19 ?RCS: patch36: added ?F: line for metalint file checking
20 ?RCS:
21 ?RCS: Revision 3.0  1993/08/18  12:04:48  ram
22 ?RCS: Baseline for dist 3.0 netwide release.
23 ?RCS:
24 ?X:
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).
29 ?X:
30 ?MAKE:Config_sh: cf_time cf_by test spitshell startsh myuname Myread \
31         End Obsol_sh Loc +d_portable package src cat sed
32 ?MAKE:  -pick add.Config_sh $@ %<
33 ?MAKE:  -pick add $@ ./Obsol_sh
34 ?MAKE:  -pick close.Config_sh $@ %<
35 ?F:!config.over !config.arch
36 ?T:file sfile xsed
37 ?LINT:unclosed EOT
38 : back to where it started
39 if test -d ../UU; then
40         cd ..
41 fi
42
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
46         . ./config.arch
47 fi
48
49 : configuration may be patched via a 'config.over' file
50 if $test -f config.over; then
51         echo " "
52         dflt=y
53         rp='I see a config.over file.  Do you wish to load it?'
54         . UU/myread
55         case "$ans" in
56         n*) echo "OK, I'll ignore it.";;
57         *)      . ./config.over
58                 echo "Configuration override changes have been loaded."
59                 ;;
60         esac
61 fi
62
63 @if d_portable
64 : in case they want portability, strip down executable paths
65 ?X:
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...
69 ?X: In order to allow vi='/usr/bin/nvi' which will strip down to vi='nvi',
70 ?X: we can't just say 'eval $file="\$file"', we have to recourse to sed.
71 ?X: We don't use basename since it is less portable than sed.
72 ?X:
73 case "$d_portable" in
74 "$define")
75         echo " "
76         echo "Stripping down executable paths..." >&4
77         xsed=$sed
78         for file in $loclist $trylist; do
79                 eval sfile="\$$file"
80                 sfile=`echo $sfile | $xsed -e 's,.*/\(.*\),\1,'`
81                 eval $file="$sfile"
82         done
83         ;;
84 esac
85
86 @end
87 : create config.sh file
88 echo " "
89 echo "Creating config.sh..." >&4
90 $spitshell <<EOT >config.sh
91 $startsh
92 #
93 # This file was produced by running the Configure script. It holds all the
94 # definitions figured out by Configure. Should you modify one of these values,
95 # do not forget to propagate your changes by running "Configure -der". You may
96 # instead choose to run each of the .SH files by yourself, or "Configure -S".
97 #
98
99 # Package name      : $package
100 # Source directory  : $src
101 # Configuration time: $cf_time
102 # Configured by     : $cf_by
103 # Target system     : $myuname
104
105 EOT
106 ?X: Command line options are saved by the Options.U unit in the
107 ?X: temporary file UU/cmdline.opt
108 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
109 $spitshell <<EOT >>config.sh
110