Commit | Line | Data |
---|---|---|
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 | |
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 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. | |
48 | case "$prefix" in | |
49 | '') | |
50 | dflt=`./loc . /usr/local /usr/local /local /opt /usr` | |
51 | ;; | |
52 | *) | |
53 | dflt="$prefix" | |
54 | ;; | |
55 | esac | |
56 | $cat <<EOM | |
57 | ||
58 | By default, $package will be installed in $dflt/bin, manual pages | |
59 | under $dflt/man, etc..., i.e. with $dflt as prefix for all | |
60 | installation directories. Typically this is something like /usr/local. | |
61 | If you wish to have binaries under /usr/bin but other parts of the | |
62 | installation under /usr/local, that's ok: you will be prompted | |
63 | separately for each of the installation directories, the prefix being | |
64 | only used to set the defaults. | |
65 | ||
66 | EOM | |
67 | fn=d~ | |
68 | rp='Installation prefix to use?' | |
69 | . ./getfile | |
70 | oldprefix='' | |
71 | case "$prefix" in | |
72 | '') ;; | |
73 | *) | |
74 | case "$ans" in | |
75 | "$prefix") ;; | |
76 | *) oldprefix="$prefix";; | |
77 | esac | |
78 | ;; | |
79 | esac | |
80 | prefix="$ans" | |
81 | prefixexp="$ansexp" | |
82 |