This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Spelling - megapatch
[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
49'')
50 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
51 ;;
a7eb1db8
MB
52*?/)
53 dflt=`echo "$prefix" | sed 's/.$//'`
54 ;;
959f3c4c
JH
55*)
56 dflt="$prefix"
57 ;;
58esac
59$cat <<EOM
60
61By default, $package will be installed in $dflt/bin, manual pages
62under $dflt/man, etc..., i.e. with $dflt as prefix for all
63installation directories. Typically this is something like /usr/local.
64If you wish to have binaries under /usr/bin but other parts of the
65installation under /usr/local, that's ok: you will be prompted
66separately for each of the installation directories, the prefix being
67only used to set the defaults.
68
69EOM
70fn=d~
71rp='Installation prefix to use?'
72. ./getfile
73oldprefix=''
74case "$prefix" in
75'') ;;
76*)
77 case "$ans" in
78 "$prefix") ;;
79 *) oldprefix="$prefix";;
80 esac
81 ;;
82esac
83prefix="$ans"
84prefixexp="$ansexp"
85