| 1 |
?RCS: $Id: bin.U,v 3.1 1999/07/09 18:20:13 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: $Log: bin.U,v $ |
| 12 |
?RCS: Revision 3.1 1999/07/09 18:20:13 doughera |
| 13 |
?RCS: Updated for installprefix |
| 14 |
?RCS: |
| 15 |
?RCS: Revision 3.0.1.4 1995/09/25 09:15:32 ram |
| 16 |
?RCS: patch59: unit is now forced to the top of Configure, if possible |
| 17 |
?RCS: |
| 18 |
?RCS: Revision 3.0.1.3 1995/01/30 14:32:40 ram |
| 19 |
?RCS: patch49: can now handle installation prefix changes (from WED) |
| 20 |
?RCS: |
| 21 |
?RCS: Revision 3.0.1.2 1994/08/29 16:05:28 ram |
| 22 |
?RCS: patch32: now uses installation prefix |
| 23 |
?RCS: |
| 24 |
?RCS: Revision 3.0.1.1 1993/09/13 15:56:51 ram |
| 25 |
?RCS: patch10: made prompting more explicit (WAD) |
| 26 |
?RCS: |
| 27 |
?RCS: Revision 3.0 1993/08/18 12:05:26 ram |
| 28 |
?RCS: Baseline for dist 3.0 netwide release. |
| 29 |
?RCS: |
| 30 |
?MAKE:bin binexp installbin userelocatableinc initialinstalllocation: \ |
| 31 |
Myread Prefixit Getfile Setvar Setprefixvar Oldconfig \ |
| 32 |
test prefix prefixexp |
| 33 |
?MAKE: -pick add $@ %< |
| 34 |
?Y:TOP |
| 35 |
?D:bin='' |
| 36 |
?S:bin: |
| 37 |
?S: This variable holds the name of the directory in which the user wants |
| 38 |
?S: to put publicly executable images for the package in question. It |
| 39 |
?S: is most often a local directory such as /usr/local/bin. Programs using |
| 40 |
?S: this variable must be prepared to deal with ~name substitution. |
| 41 |
?S:. |
| 42 |
?D:binexp='' |
| 43 |
?S:binexp: |
| 44 |
?S: This is the same as the bin variable, but is filename expanded at |
| 45 |
?S: configuration time, for use in your makefiles. |
| 46 |
?S:. |
| 47 |
?D:installbin='' |
| 48 |
?S:installbin: |
| 49 |
?S: This variable is the same as binexp unless AFS is running in which case |
| 50 |
?S: the user is explicitly prompted for it. This variable should always |
| 51 |
?S: be used in your makefiles for maximum portability. |
| 52 |
?S:. |
| 53 |
?D:userelocatableinc='' |
| 54 |
?S:userelocatableinc: |
| 55 |
?S: This variable is set to true to indicate that perl should relocate |
| 56 |
?S: @INC entries at runtime based on the path to the perl binary. |
| 57 |
?S: Any @INC paths starting ".../" are relocated relative to the directory |
| 58 |
?S: containing the perl binary, and a logical cleanup of the path is then |
| 59 |
?S: made around the join point (removing "dir/../" pairs) |
| 60 |
?S:. |
| 61 |
?S:initialinstalllocation: |
| 62 |
?S: When userelocatableinc is true, this variable holds the location |
| 63 |
?S: that make install should copy the perl binary to, with all the |
| 64 |
?S: run-time relocatable paths calculated from this at install time. |
| 65 |
?S: When used, it is initialized to the original value of binexp, and |
| 66 |
?S: then binexp is set to '.../', as the other binaries are found |
| 67 |
?S: relative to the perl binary. |
| 68 |
?S:. |
| 69 |
?C:BIN: |
| 70 |
?C: This symbol holds the path of the bin directory where the package will |
| 71 |
?C: be installed. Program must be prepared to deal with ~name substitution. |
| 72 |
?C:. |
| 73 |
?C:BIN_EXP: |
| 74 |
?C: This symbol is the filename expanded version of the BIN symbol, for |
| 75 |
?C: programs that do not want to deal with that at run-time. |
| 76 |
?C:. |
| 77 |
?C:PERL_RELOCATABLE_INC: |
| 78 |
?C: This symbol, if defined, indicates that we'd like to relocate entries |
| 79 |
?C: in @INC at run time based on the location of the perl binary. |
| 80 |
?C:. |
| 81 |
?H:#define BIN "$bin" /**/ |
| 82 |
?H:#define BIN_EXP "$binexp" /**/ |
| 83 |
?H:#define PERL_RELOCATABLE_INC "$userelocatableinc" /**/ |
| 84 |
?H:. |
| 85 |
?D:bin='/usr/local/bin' |
| 86 |
?LINT:change prefix |
| 87 |
?LINT:change prefixexp |
| 88 |
?LINT:change prefixvar |
| 89 |
?LINT:change installprefixexp |
| 90 |
?LINT:set userelocatableinc |
| 91 |
: determine where public executables go |
| 92 |
echo " " |
| 93 |
set dflt bin bin |
| 94 |
eval $prefixit |
| 95 |
fn=d~ |
| 96 |
rp='Pathname where the public executables will reside?' |
| 97 |
. ./getfile |
| 98 |
if $test "X$ansexp" != "X$binexp"; then |
| 99 |
installbin='' |
| 100 |
fi |
| 101 |
prefixvar=bin |
| 102 |
: XXX Bug? -- ignores Configure -Dinstallprefix setting. |
| 103 |
: XXX If this is fixed, also fix the "start perl" hunk below, which relies on |
| 104 |
: this via initialinstalllocation |
| 105 |
. ./setprefixvar |
| 106 |
|
| 107 |
case "$userelocatableinc" in |
| 108 |
$define|true|[yY]*) dflt='y' ;; |
| 109 |
*) dflt='n' ;; |
| 110 |
esac |
| 111 |
cat <<EOM |
| 112 |
|
| 113 |
Would you like to build Perl so that the installation is relocatable, so that |
| 114 |
library paths in @INC are determined relative to the path of the perl binary? |
| 115 |
This is not advised for system Perl installs, or if you need to run setid |
| 116 |
scripts or scripts under taint mode. |
| 117 |
|
| 118 |
If this doesn't make any sense to you, just accept the default '$dflt'. |
| 119 |
EOM |
| 120 |
rp='Use relocatable @INC?' |
| 121 |
. ./myread |
| 122 |
case "$ans" in |
| 123 |
y|Y) val="$define" ;; |
| 124 |
*) val="$undef" ;; |
| 125 |
esac |
| 126 |
set userelocatableinc |
| 127 |
eval $setvar |
| 128 |
|
| 129 |
initialinstalllocation="$binexp" |
| 130 |
: Default prefix is now "up one level from where the binaries are" |
| 131 |
case "$userelocatableinc" in |
| 132 |
$define|true|[yY]*) |
| 133 |
bin=".../" |
| 134 |
binexp=".../" |
| 135 |
prefix=".../.." |
| 136 |
prefixexp=".../.." |
| 137 |
installprefixexp=".../.." |
| 138 |
;; |
| 139 |
esac |
| 140 |
|