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 / Prefixup.U
1 ?RCS: $Id: Prefixup.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: Prefixup.U,v $
12 ?RCS: Revision 3.0.1.1  1995/01/30  14:30:40  ram
13 ?RCS: patch49: created
14 ?RCS:
15 ?X:
16 ?X: Used as: "set dflt; eval $prefixup" to set $dflt to be $prefix/dir
17 ?X: instead of $prefixexp/dir, in case portability was involved somehow
18 ?X: and $prefix uses ~name expansion.
19 ?X:
20 ?MAKE:Prefixup: prefix prefixexp
21 ?MAKE:  -pick add $@ %<
22 ?LINT:define prefixup
23 ?S:prefixup:
24 ?S:     This shell variable is used internally by Configure to reset
25 ?S:     the leading installation prefix correctly when $prefix uses
26 ?S:     ~name expansion.
27 ?S:             set dflt
28 ?S:             eval $prefixup
29 ?S:     That will set $dflt to $prefix/dir if it was $prefixexp/dir and
30 ?S:     $prefix differs from $prefixexp.
31 ?S:.
32 ?V:prefixup
33 : set the prefixup variable, to restore leading tilda escape
34 prefixup='case "$prefixexp" in
35 "$prefix") ;;
36 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
37 esac'
38