summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-03-13 23:13:23 +0000
committerNicholas Clark <nick@ccl4.org>2006-03-13 23:13:23 +0000
commit1d230ada0b2ff8ef3af3370141f10c3315abf450 (patch)
treeee6f8edb0dcbf5985b0ccd66f180211d864738aa
parent4d20abadde4f672afab51524d4ff00c7c65bbed7 (diff)
downloadperl-1d230ada0b2ff8ef3af3370141f10c3315abf450.tar.gz
Somewhat less shaky relocatable @INC support. You can install things
to the current location of the perl tree, move it, install more things, move it again, lather rinse repeat. Configure with -Duserelocatableinc p4raw-id: //depot/perl@27491
-rwxr-xr-xConfigure10
-rwxr-xr-xconfigpm29
-rwxr-xr-xinstallperl25
3 files changed, 61 insertions, 3 deletions
diff --git a/Configure b/Configure
index 56a05f9279..374eb392b3 100755
--- a/Configure
+++ b/Configure
@@ -1161,6 +1161,7 @@ nm_so_opt=''
runnm=''
usenm=''
useperlio=''
+initialinstalllocation=''
userelocatableinc=''
usesocks=''
d_oldpthreads=''
@@ -6031,8 +6032,12 @@ eval $setvar
: Default prefix is now "up one level from where the binaries are"
case "$userelocatableinc" in
-$define|true|[yY]*) prefix=".../.."
- prefixexp=".../..";;
+$define|true|[yY]*) initialinstalllocation="$binexp"
+ bin=".../"
+ binexp=".../"
+ prefix=".../.."
+ prefixexp=".../.."
+ installprefixexp=".../..";;
esac
@@ -22063,6 +22068,7 @@ useopcode='$useopcode'
useperlio='$useperlio'
useposix='$useposix'
usereentrant='$usereentrant'
+initialinstalllocation="$initialinstalllocation"
userelocatableinc='$userelocatableinc'
usesfio='$usesfio'
useshrplib='$useshrplib'
diff --git a/configpm b/configpm
index de4a69445c..1bd2e38630 100755
--- a/configpm
+++ b/configpm
@@ -326,7 +326,34 @@ if (fetch_string({},'userelocatableinc')) {
siteprefixexp
sitelib_stem
- vendorlib_stem)) {
+ vendorlib_stem
+
+ installarchlib
+ installhtml1dir
+ installhtml3dir
+ installman1dir
+ installman3dir
+ installprefix
+ installprefixexp
+ installprivlib
+ installscript
+ installsitearch
+ installsitebin
+ installsitehtml1dir
+ installsitehtml3dir
+ installsitelib
+ installsiteman1dir
+ installsiteman3dir
+ installsitescript
+ installvendorarch
+ installvendorbin
+ installvendorhtml1dir
+ installvendorhtml3dir
+ installvendorlib
+ installvendorman1dir
+ installvendorman3dir
+ installvendorscript
+ )) {
push @need_relocation, $what if fetch_string({}, $what) =~ m!^\.\.\./!;
}
}
diff --git a/installperl b/installperl
index 2f59f4563a..919fc648bd 100755
--- a/installperl
+++ b/installperl
@@ -7,6 +7,31 @@ BEGIN {
$ENV{PERL5LIB} = 'lib';
}
+BEGIN {
+ use Config;
+ if ($Config{userelocatableinc}) {
+ # This might be a considered a hack. Need to get information about the
+ # configuration from Config.pm *before* Config.pm expands any .../
+ # prefixes.
+ #
+ # So we set $^X to pretend that we're the already installed perl, so
+ # Config.pm doesits ... expansion off that location.
+
+ my $location = $Config{initialinstalllocation};
+ die <<'OS' unless defined $location;
+$Config{initialinstalllocation} is not defined - can't install a relocatable
+perl without this.
+OS
+ $^X = "$location/perl";
+ # And then remove all trace of ever having loaded Config.pm, so that
+ # it will reload with the revised $^X
+ undef %Config::;
+ delete $INC{"Config.pm"};
+ delete $INC{"Config_heavy.pl"};
+ # You never saw us. We weren't here.
+ }
+}
+
use strict;
my ($Is_VMS, $Is_W32, $Is_OS2, $Is_Cygwin, $Is_Darwin,
$nonono, $dostrip, $versiononly, $silent, $verbose, $force,