This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Spelling - megapatch
[metaconfig.git] / U / installdirs / Setprefixvar.U
CommitLineData
bbf326f0
MB
1?RCS: $Id: Setprefixvar.U,v 3.0 2006/04/01 17:25:29 hmbrand $
2?RCS:
3?RCS: Copyright (c) 2006-2006, H.Merijn Brand & Nicholas Clark
4?RCS:
5?RCS: This file is included with or a derivative work of a file included
6?RCS: with the metaconfig program of Raphael Manfredi's "dist" distribution.
7?RCS: In accordance with clause 7 of dist's modified Artistic License:
8?RCS:
9?RCS: You may distribute under the terms of either the GNU General Public
10?RCS: License or the Artistic License, as specified in the README file.
11?RCS:
12?X:
13?X: This unit sets up the scripts installprefix and setprefixvar, so code
14?X: in other parts can be more simple and maintainable
15?X:
16?MAKE:Setprefixvar: Myread Getfile startsh eunicefix test \
17 prefix prefixexp installprefix installprefixexp
18?MAKE: -pick add $@ %<
19?LINT:extern prefixvar
65a32477 20?X: metalint still sees "`\$${prefixvar}exp`" as variable :(
41322e17 21?T:prefixvarexp
bbf326f0
MB
22?F:./setprefixvar
23?F:./installprefix
24: Perform the prefixexp/installprefixexp correction if necessary
25cat <<EOS >installprefix
26$startsh
27EOS
28cat <<'EOSC' >>installprefix
29: Change installation prefix, if necessary.
30if $test X"$prefix" != X"$installprefix"; then
31 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
32else
33 eval "install${prefixvar}=\"\$${prefixvar}exp\""
34fi
35EOSC
36chmod +x installprefix
37$eunicefix installprefix
38
39: Set variables such as privlib and privlibexp from the output of ./getfile
40: performing the prefixexp/installprefixexp correction if necessary.
41cat <<EOS >setprefixvar
42$startsh
43EOS
44cat <<'EOSC' >>setprefixvar
45eval "${prefixvar}=\"\$ans\""
50e46291 46eval "${prefixvar}exp=\"\$ansexp\""
bbf326f0
MB
47. ./installprefix
48EOSC
49chmod +x setprefixvar
50$eunicefix setprefixvar
51