| 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 License, |
| 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 License; 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 <[email protected]> |
| 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 |
'') dflt=`./loc . /usr/local /usr/local /local /opt /usr` |
| 50 |
;; |
| 51 |
*) dflt="$prefix" |
| 52 |
;; |
| 53 |
esac |
| 54 |
$cat <<EOM |
| 55 |
|
| 56 |
By default, $package will be installed in $dflt/bin, manual pages |
| 57 |
under $dflt/man, etc..., i.e. with $dflt as prefix for all |
| 58 |
installation directories. Typically this is something like /usr/local. |
| 59 |
If you wish to have binaries under /usr/bin but other parts of the |
| 60 |
installation under /usr/local, that's ok: you will be prompted |
| 61 |
separately for each of the installation directories, the prefix being |
| 62 |
only used 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 |
*) case "$ans" in |
| 72 |
"$prefix") ;; |
| 73 |
*) oldprefix="$prefix";; |
| 74 |
esac |
| 75 |
;; |
| 76 |
esac |
| 77 |
|
| 78 |
case "$ans" in |
| 79 |
*?/) prefix=`echo "$ans" | sed 's/.$//'` |
| 80 |
;; |
| 81 |
*) prefix="$ans" |
| 82 |
esac |
| 83 |
|
| 84 |
case "$ansexp" in |
| 85 |
*?/) prefixexp=`echo "$ansexp" | sed 's/.$//'` |
| 86 |
;; |
| 87 |
*) prefixexp="$ansexp" |
| 88 |
esac |
| 89 |
|