This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove trailing '/' from prefix
[metaconfig.git] / U / installdirs / prefix.U
CommitLineData
959f3c4c
JH
1?RCS: $Id: prefix.U,v 3.1 1999/07/08 18:27:51 doughera Exp doughera $
2?RCS:
3?RCS: Copyright (c) 1991-1993, Raphael Manfredi
65a32477
MBT
4?RCS:
5?RCS: You may redistribute only under the terms of the Artistic License,
959f3c4c
JH
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
65a32477 8?RCS: that same Artistic License; a copy of which may be found at the root
959f3c4c
JH
9?RCS: of the source tree for dist 3.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.1 1999/07/08 18:27:51 doughera
15?RCS: 5.005_5x version -- Andy Dougherty
16?RCS:
17?RCS: Revision 3.0.1.2 1995/01/30 14:44:05 ram
18?RCS: patch49: new prefixexp variable holding a fully expanded prefix
19?RCS: patch49: save off previous prefix value in oldprefix if changed (WED)
20?RCS: patch49: added the INSTALLPREFIX define for C programs to use (WED)
21?RCS:
22?RCS: Revision 3.0.1.1 1994/08/29 16:31:34 ram
23?RCS: patch32: created by ADO
24?RCS:
25?MAKE:prefix prefixexp +oldprefix: Getfile Loc Oldconfig cat package
26?MAKE: -pick add $@ %<
27?S:prefix:
28?S: This variable holds the name of the directory below which the
29?S: user will install the package. Usually, this is /usr/local, and
30?S: executables go in /usr/local/bin, library stuff in /usr/local/lib,
31?S: man pages in /usr/local/man, etc. It is only used to set defaults
32?S: for things in bin.U, mansrc.U, privlib.U, or scriptdir.U.
33?S:.
34?S:prefixexp:
35?S: This variable holds the full absolute path of the directory below
36?S: which the user will install the package. Derived from prefix.
37?S:.
38?S:oldprefix:
39?S: This variable is set non-null if the prefix was previously defined
40?S: and gets set to a new value. Used internally by Configure only.
41?S:.
42?C:INSTALLPREFIX:
43?C: This symbol contains the name of the install prefix for this package.
44?C:.
45?H:#define INSTALLPREFIX "$prefix" /**/
46?H:.
47: determine root of directory hierarchy where package will be installed.
48case "$prefix" in
0e18c0f4 49'') dflt=`./loc . /usr/local /usr/local /local /opt /usr`
959f3c4c 50 ;;
0e18c0f4 51*) dflt="$prefix"
959f3c4c
JH
52 ;;
53esac
54$cat <<EOM
55
56By default, $package will be installed in $dflt/bin, manual pages
57under $dflt/man, etc..., i.e. with $dflt as prefix for all
58installation directories. Typically this is something like /usr/local.
59If you wish to have binaries under /usr/bin but other parts of the
60installation under /usr/local, that's ok: you will be prompted
61separately for each of the installation directories, the prefix being
62only used to set the defaults.
63
64EOM
65fn=d~
66rp='Installation prefix to use?'
67. ./getfile
68oldprefix=''
69case "$prefix" in
0e18c0f4
MBT
70'') ;;
71*) case "$ans" in
959f3c4c
JH
72 "$prefix") ;;
73 *) oldprefix="$prefix";;
74 esac
75 ;;
76esac
0e18c0f4
MBT
77
78case "$ans" in
79*?/) prefix=`echo "$ans" | sed 's/.$//'`
80 ;;
81*) prefix="$ans"
82esac
83
84case "$ansexp" in
85*?/) prefixexp=`echo "$ansexp" | sed 's/.$//'`
86 ;;
87*) prefixexp="$ansexp"
88esac
959f3c4c 89