X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=installperl;h=e9d2b59b12ad3059e82b56762c24b84af0340eb6;hb=67a86ef3f5ab1f509f5775da82cbf43e437569ac;hp=aaa17ea31ff09673d47560d78d44d9c5eb7a28fb;hpb=25207203046d8f94b03829079bb348bf2c1b204b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/installperl b/installperl index aaa17ea..e9d2b59 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, @@ -156,11 +181,8 @@ find(sub { if ("$File::Find::dir/$_" =~ m{^ext\b(.*)/([^/]+)\.pm$}) { my($path, $modname) = ($1,$2); - # strip trailing component first - $path =~ s{/[^/]*$}{}; - - # strip optional "/lib"; - $path =~ s{/lib\b}{}; + # strip to optional "/lib", or remove trailing component + $path =~ s{.*/lib\b}{} or $path =~ s{/[^/]*$}{}; # strip any leading / $path =~ s{^/}{}; @@ -263,37 +285,6 @@ if (($Is_W32 and ! $Is_NetWare) or $Is_Cygwin) { my $v_e_r_s = $ver; $v_e_r_s =~ tr/./_/; $perldll =~ s/(\..*)?$/$v_e_r_s.$dlext/; $perldll =~ s/^lib/cyg/; - if ($Config{useshrplib} eq 'true') { - # install ld2 and perlld as well - foreach ('ld2', 'perlld') { - safe_unlink("$installbin/$_"); - copy("$_", "$installbin/$_"); - chmod(0755, "$installbin/$_"); - $packlist->{"$installbin/$_"} = { type => 'file' }; - }; - open (LD2, ">$installbin/ld2"); - print LD2 <