X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=installperl;h=da8f45ee4ace39ac895a5c8243d4a42f1719e93a;hb=9953ff723fac897df4afc6a69aaa7bfe5e8dc983;hp=c717750c50070a78d9371d4dd1acfcdb6ca07358;hpb=5f9145a3c5d730d3a29901fe5c70a26f92663207;p=p5sagit%2Fp5-mst-13.2.git diff --git a/installperl b/installperl index c717750..da8f45e 100755 --- a/installperl +++ b/installperl @@ -67,6 +67,11 @@ if ( $Is_VMS ) { } $otherperls = 1; +# This little hack simplifies making the code after the comment "Fetch some +# frequently-used items from %Config" warning free. With $opts{destdir} always +# defined, it's also possible to make the s/\Q$opts{destdir}\E unconditional. + +$opts{destdir} = ''; # Consider refactoring this to use Getopt::Long once Getopt::Long's planned # feature is implemented, to distinguish + and - options. while (@ARGV) { @@ -148,8 +153,13 @@ if ((-e "testcompile") && (defined($ENV{'COMPILE'}))) { push(@scripts, map("$_.exe", @scripts)); } +# Exclude nonxs extensions that are not architecture dependent +my @nonxs = grep(!/^Errno$/, split(' ', $Config{'nonxs_ext'})); + find(sub { - if ("$File::Find::dir/$_" =~ m{^ext\b(.*)/([^/]+)\.pm$}) { + if (($File::Find::name =~ m{^ext\b(.*)/([^/]+)\.pm$}) && + ! grep { $File::Find::name =~ /^ext\/$_/ } @nonxs) + { my($path, $modname) = ($1,$2); # strip to optional "/lib", or remove trailing component @@ -364,7 +374,26 @@ if ($Is_VMS) { # We did core file selection during build $coredir =~ tr/./_/; map { s|^$coredir/||i; } @corefiles = <$coredir/*.*>; } -else { +elsif ($Is_Cygwin) { # On Cygwin symlink it to CORE to make Makefile happy + @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>; + my $coredll = "$installarchlib/CORE/$libperl"; + safe_unlink($coredll); + ( $Config{'d_link'} eq 'define' && + eval { + CORE::link("$installbin/$libperl", $coredll); + $packlist->{$coredll} = { from => "$installbin/$libperl", + type => 'link' }; + } + ) || + eval { + symlink("$installbin/$libperl", $coredll); + $packlist->{$coredll} = { from => "$installbin/$libperl", + type => 'link' }; + } || + ( copy("$installbin/$libperl", $coredll) && + push(@corefiles, $coredll) + ) +} else { # [als] hard-coded 'libperl' name... not good! @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>; @@ -588,6 +617,7 @@ if (!$versiononly && $otherperls) { next unless m,^/,; # Use &samepath here because some systems have other dirs linked # to $mainperldir (like SunOS) + next unless -d; next if samepath($_, $binexp); next if samepath($_, cwd()); next if ($mainperl_is_instperl && samepath($_, $mainperldir)); @@ -662,7 +692,7 @@ sub copy { my($from,$to) = @_; my $xto = $to; - $xto =~ s/^\Q$opts{destdir}\E// if $opts{destdir}; + $xto =~ s/^\Q$opts{destdir}\E//; print $opts{verbose} ? " cp $from $xto\n" : " $xto\n" unless $opts{silent}; print " creating new version of $xto\n" @@ -747,7 +777,7 @@ sub installlib { unlink("$installarchlib/$name"); } my $xname = "$installlib/$name"; - $xname =~ s/^\Q$opts{destdir}\E// if $opts{destdir}; + $xname =~ s/^\Q$opts{destdir}\E//; $packlist->{$xname} = { type => 'file' }; if ($force || compare($_, "$installlib/$name") || $opts{notify}) { unlink("$installlib/$name"); @@ -794,7 +824,7 @@ sub copy_if_diff { my($from,$to)=@_; return 1 if (($^O eq 'VMS') && (-d $from)); my $xto = $to; - $xto =~ s/^\Q$opts{destdir}\E// if $opts{destdir}; + $xto =~ s/^\Q$opts{destdir}\E//; my $perlpodbadsymlink; if ($from =~ m!^pod/perl[\w-]+\.pod$! && -l $from &&