X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=installperl;h=93b9947d941b8005d2213783ef566c070a0adc76;hb=c2da85bab803bec3ca5fa4521a7396803c18a76d;hp=d462333fd27215ff1467e3531e78475f1a5c34fc;hpb=1d84e8dfc14d5303f4e9e567bd263f6b4d88e584;p=p5sagit%2Fp5-mst-13.2.git diff --git a/installperl b/installperl index d462333..93b9947 100755 --- a/installperl +++ b/installperl @@ -50,7 +50,8 @@ umask 022 unless $Is_VMS; my @scripts = qw(utils/c2ph utils/h2ph utils/h2xs utils/perlbug utils/perldoc utils/pl2pm utils/splain utils/perlcc x2p/s2p x2p/find2perl - pod/pod2man pod/pod2html pod/pod2latex pod/pod2text); + pod/pod2man pod/pod2html pod/pod2latex pod/pod2text + pod/pod2usage pod/podchecker pod/podselect); if ($scr_ext) { @scripts = map { "$_$scr_ext" } @scripts; } @@ -87,8 +88,8 @@ my $ver = $]; my $release = substr($ver,0,3); # Not used presently. my $patchlevel = substr($ver,3,2); die "Patchlevel of perl ($patchlevel)", - "and patchlevel of config.sh ($Config{'PATCHLEVEL'}) don't match\n" - if $patchlevel != $Config{'PATCHLEVEL'}; + "and patchlevel of config.sh ($Config{'PERL_VERSION'}) don't match\n" + if $patchlevel != $Config{'PERL_VERSION'}; # Fetch some frequently-used items from %Config my $installbin = $Config{installbin}; @@ -159,11 +160,6 @@ if ($Is_VMS) { copy("perlshr$exe_ext", "$installbin/${perl}shr$exe_ext"); chmod(0755, "$installbin/${perl}shr$exe_ext"); } -elsif ($^O ne 'dos') { - safe_unlink("$installbin/$perl$ver$exe_ext"); - copy("perl$exe_ext", "$installbin/$perl$ver$exe_ext"); - chmod(0755, "$installbin/$perl$ver$exe_ext"); -} elsif ($^O eq 'mpeix') { # MPE lacks hard links and requires that executables with special # capabilities reside in the MPE namespace. @@ -174,6 +170,12 @@ elsif ($^O eq 'mpeix') { # Create a backup copy with the version number. link($Config{perlpath}, "$installbin/perl$ver$exe_ext"); } +elsif ($^O ne 'dos') { + safe_unlink("$installbin/$perl$ver$exe_ext"); + copy("perl$exe_ext", "$installbin/$perl$ver$exe_ext"); + strip("$installbin/perl$ver$exe_ext") if $^O =~ /^(rhapsody)$; + chmod(0755, "$installbin/$perl$ver$exe_ext"); +} else { safe_unlink("$installbin/$perl.exe"); copy("perl.exe", "$installbin/$perl.exe"); @@ -220,15 +222,25 @@ else { @corefiles = <*.h libperl*.*>; # AIX needs perl.exp installed as well. push(@corefiles,'perl.exp') if $^O eq 'aix'; + if ($^O eq 'mpeix') { + # MPE needs mpeixish.h installed as well. + mkpath("$installarchlib/CORE/mpeix", 1, 0777); + push(@corefiles,'mpeix/mpeixish.h'); + } # If they have built sperl.o... push(@corefiles,'sperl.o') if -f 'sperl.o'; } foreach my $file (@corefiles) { # HP-UX (at least) needs to maintain execute permissions # on dynamically-loadable libraries. So we do it for all. - copy_if_diff($file,"$installarchlib/CORE/$file") - and chmod($file =~ /\.(so|\Q$dlext\E)$/ ? 0555 : 0444, - "$installarchlib/CORE/$file"); + if (copy_if_diff($file,"$installarchlib/CORE/$file")) { + if ($file =~ /\.(so|\Q$dlext\E)$/) { + chmod(0555, "$installarchlib/CORE/$file"); + strip("-S", "$installarchlib/CORE/$file") if $^O =~ /^(rhapsody)$; + } else { + chmod(0444, "$installarchlib/CORE/$file"); + } + } } # Install main perl executables @@ -251,7 +263,8 @@ if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VM my $mainperl_is_instperl = 0; -if (!$versiononly && !$nonono && !$Is_W32 && !$Is_VMS && -t STDIN && -t STDERR +if ($Config{installusrbinperl} eq 'define' && + !$versiononly && !$nonono && !$Is_W32 && !$Is_VMS && -t STDIN && -t STDERR && -w $mainperldir && ! samepath($mainperldir, $installbin)) { my($usrbinperl) = "$mainperldir/$perl$exe_ext"; my($instperl) = "$installbin/$perl$exe_ext"; @@ -327,7 +340,7 @@ if (! $versiononly) { # Install pod pages. Where? I guess in $installprivlib/pod. -if (! $versiononly || !($installprivlib =~ m/\Q$]/)) { +unless ( $versiononly && !($installprivlib =~ m/\Q$]/)) { mkpath("${installprivlib}/pod", 1, 0777); # If Perl 5.003's perldiag.pod is there, rename it. @@ -564,8 +577,6 @@ sub installlib { and chmod($name =~ /\.(so|$dlext)$/o ? 0555 : 0444, "$installlib/$name"); } - } elsif (-d $_) { - mkpath("$installlib/$name", 1, 0777); } } @@ -598,3 +609,23 @@ sub copy_if_diff { 1; } } + +sub strip +{ + my(@args) = @_; + + my @opts; + while (@args && $args[0] =~ /^(-\w+)$/) { + push @opts, shift @args; + } + + foreach my $file (@args) { + if (-f $file) { + print STDERR " strip $file\n"; + system("strip", @opts, $file); + } else { + print STDERR "# file '$file' skipped\n"; + } + } +} +