| 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 |
| 20 |
?X: metalint still sees "`\$${prefixvar}exp`" as variable :( |
| 21 |
?T:prefixvarexp |
| 22 |
?F:./setprefixvar |
| 23 |
?F:./installprefix |
| 24 |
: Perform the prefixexp/installprefixexp correction if necessary |
| 25 |
cat <<EOS >installprefix |
| 26 |
$startsh |
| 27 |
EOS |
| 28 |
cat <<'EOSC' >>installprefix |
| 29 |
: Change installation prefix, if necessary. |
| 30 |
if $test X"$prefix" != X"$installprefix"; then |
| 31 |
eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`" |
| 32 |
else |
| 33 |
eval "install${prefixvar}=\"\$${prefixvar}exp\"" |
| 34 |
fi |
| 35 |
EOSC |
| 36 |
chmod +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. |
| 41 |
cat <<EOS >setprefixvar |
| 42 |
$startsh |
| 43 |
EOS |
| 44 |
cat <<'EOSC' >>setprefixvar |
| 45 |
eval "${prefixvar}=\"\$ans\"" |
| 46 |
eval "${prefixvar}exp=\"\$ansexp\"" |
| 47 |
. ./installprefix |
| 48 |
EOSC |
| 49 |
chmod +x setprefixvar |
| 50 |
$eunicefix setprefixvar |
| 51 |
|