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 / prefix.U
1 ?RCS: $Id: prefix.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: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
12 ?RCS:
13 ?RCS: $Log: prefix.U,v $
14 ?RCS: Revision 3.0.1.2  1995/01/30  14:44:05  ram
15 ?RCS: patch49: new prefixexp variable holding a fully expanded prefix
16 ?RCS: patch49: save off previous prefix value in oldprefix if changed (WED)
17 ?RCS: patch49: added the INSTALLPREFIX define for C programs to use (WED)
18 ?RCS:
19 ?RCS: Revision 3.0.1.1  1994/08/29  16:31:34  ram
20 ?RCS: patch32: created by ADO
21 ?RCS:
22 ?MAKE:prefix prefixexp +oldprefix: Getfile Loc Oldconfig cat package
23 ?MAKE:  -pick add $@ %<
24 ?S:prefix:
25 ?S:     This variable holds the name of the directory below which the
26 ?S:     user will install the package.  Usually, this is /usr/local, and
27 ?S:     executables go in /usr/local/bin, library stuff in /usr/local/lib,
28 ?S:     man pages in /usr/local/man, etc.  It is only used to set defaults
29 ?S:     for things in bin.U, mansrc.U, privlib.U, or scriptdir.U.
30 ?S:.
31 ?S:prefixexp:
32 ?S:     This variable holds the full absolute path of the directory below
33 ?S:     which the user will install the package.  Derived from prefix.
34 ?S:.
35 ?S:oldprefix:
36 ?S:     This variable is set non-null if the prefix was previously defined
37 ?S:     and gets set to a new value. Used internally by Configure only.
38 ?S:.
39 ?C:INSTALLPREFIX:
40 ?C:     This symbol contains the name of the install prefix for this package.
41 ?C:.
42 ?H:#define INSTALLPREFIX "$prefix"              /**/
43 ?H:.
44 : determine root of directory hierarchy where package will be installed.
45 case "$prefix" in
46 '')
47         dflt=`./loc . /usr/local /usr/local /local /opt /usr`
48         ;;
49 *)
50         dflt="$prefix"
51         ;;
52 esac
53 $cat <<EOM
54
55 By default, $package will be installed in $dflt/bin, manual
56 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
57 all installation directories. Typically set to /usr/local, but you
58 may choose /usr if you wish to install $package among your system
59 binaries. If you wish to have binaries under /bin but manual pages
60 under /usr/local/man, that's ok: you will be prompted separately
61 for each of the installation directories, the prefix being only used
62 to set the defaults.
63
64 EOM
65 fn=d~
66 rp='Installation prefix to use?'
67 . ./getfile
68 oldprefix=''
69 case "$prefix" in
70 '') ;;
71 *)
72         case "$ans" in
73         "$prefix") ;;
74         *) oldprefix="$prefix";;
75         esac
76         ;;
77 esac
78 prefix="$ans"
79 prefixexp="$ansexp"
80