5 chdir '..' if !-d 'lib' and -d '..\lib';
7 $ENV{PERL5LIB} = 'lib';
11 my ($Is_VMS, $Is_W32, $Is_OS2, $Is_Cygwin, $Is_Darwin,
12 $nonono, $dostrip, $versiononly, $silent, $verbose,
13 $otherperls, $archname,$Is_NetWare, $nwinstall);
17 $Is_VMS = $^O eq 'VMS';
18 $Is_W32 = $^O eq 'MSWin32';
19 $Is_OS2 = $^O eq 'os2';
20 $Is_Cygwin = $^O eq 'cygwin';
21 $Is_Darwin = $^O eq 'darwin';
22 if ($Is_VMS) { eval 'use VMS::Filespec;' }
25 my $scr_ext = ($Is_VMS ? '.Com' : $Is_W32 ? '.bat' : '');
31 use ExtUtils::Packlist;
33 use subs qw(unlink link chmod);
35 if ($Config{d_umask}) {
36 umask(022); # umasks like 077 aren't that useful for installations
39 $Is_NetWare = $Config{osname} eq 'NetWare';
45 # override the ones in the rest of the script
47 File::Path::mkpath(@_) unless $nonono;
50 my $mainperldir = "/usr/bin";
51 my $exe_ext = $Config{exe_ext};
53 # Allow ``make install PERLNAME=something_besides_perl'':
54 my $perl = defined($ENV{PERLNAME}) ? $ENV{PERLNAME} : 'perl';
56 # This is the base used for versioned names, like "perl5.6.0".
57 # It's separate because a common use of $PERLNAME is to install
58 # perl as "perl5", if that's used as base for versioned files you
60 my $perl_verbase = defined($ENV{PERLNAME_VERBASE})
61 ? $ENV{PERLNAME_VERBASE}
66 $nonono = 1 if $ARGV[0] eq '-n';
67 $dostrip = 1 if $ARGV[0] eq '-s';
68 $versiononly = 1 if $ARGV[0] eq '-v';
69 $versiononly = 0 if $ARGV[0] eq '+v';
70 $silent = 1 if $ARGV[0] eq '-S';
71 $otherperls = 0 if $ARGV[0] eq '-o';
72 $verbose = 1 if $ARGV[0] eq '-V' || $ARGV [0] eq '-n';
73 $archname = 1 if $ARGV[0] eq '-A';
74 $nwinstall = 1 if $ARGV[0] eq '-netware';
75 if ($ARGV[0] eq '-?' or $ARGV[0] =~ /^-?-h/) {
78 -n Don't actually run any commands; just print them.
79 -s Run strip on installed binaries.
80 -v Only install perl as a binary with the version number in the name.
81 (Override whatever config.sh says)
82 +v Install perl as "perl" and as a binary with the version number in
83 the name. (Override whatever config.sh says)
85 -o Skip checking for other copies of perl in your PATH.
87 -A Also install perl with the architecture's name in the perl binary's
89 -netware Install correctly on a Netware server.
96 $versiononly = 1 if $Config{versiononly} && !defined $versiononly;
97 my (@scripts, @tolink);
98 open SCRIPTS, "utils.lst" or die "Can't open utils.lst: $!";
101 next if /#\s*pod\s*=/; # Binary programs need separate treatment
103 if (/(\S*)\s*#\s*link\s*=\s*(\S*)/) {
105 push @tolink, [$1, $2];
112 if ($scr_ext) { @scripts = map { "$_$scr_ext" } @scripts; }
114 my @pods = (<pod/*.pod>);
116 # Specify here any .pm files that are actually architecture-dependent.
117 # (Those included with XS extensions under ext/ are automatically
119 # Now that the default privlib has the full perl version number included,
120 # we no longer have to play the trick of sticking version-specific .pm
121 # files under the archlib directory.
128 push(@scripts,'djgpp/fixpmain');
129 $archpms{config} = $archpms{filehand} = 1;
132 if ((-e "testcompile") && (defined($ENV{'COMPILE'})))
134 push(@scripts, map("$_.exe", @scripts));
138 if ("$File::Find::dir/$_" =~ m{^ext\b(.*)/([^/]+)\.pm$}) {
139 my($path, $modname) = ($1,$2);
141 # strip trailing component first
142 $path =~ s{/[^/]*$}{};
144 # strip optional "/lib";
145 $path =~ s{/lib\b}{};
147 # strip any leading /
150 # reconstitute canonical module name
151 $modname = "$path/$modname" if length $path;
154 $archpms{$modname} = 1;
158 # print "[$_]\n" for sort keys %archpms;
160 my $ver = $Config{version};
161 my $release = substr($],0,3); # Not used currently.
162 my $patchlevel = substr($],3,2);
163 die "Patchlevel of perl ($patchlevel)",
164 "and patchlevel of config.sh ($Config{'PERL_VERSION'}) don't match\n"
165 if $patchlevel != $Config{'PERL_VERSION'};
167 # Fetch some frequently-used items from %Config
168 my $installbin = $Config{installbin};
169 my $installscript = $Config{installscript};
170 my $installprivlib = $Config{installprivlib};
171 my $installarchlib = $Config{installarchlib};
172 my $installsitelib = $Config{installsitelib};
173 my $installsitearch = $Config{installsitearch};
174 my $installman1dir = $Config{installman1dir};
175 my $man1ext = $Config{man1ext};
176 my $libperl = $Config{libperl};
177 # Shared library and dynamic loading suffixes.
178 my $so = $Config{so};
179 my $dlext = $Config{dlext};
180 my $dlsrc = $Config{dlsrc};
181 if ($^O eq 'os390') {
184 my $archlibexp = $Config{archlibexp};
185 my $usedl = $Config{usedl};
186 if ($usedl eq 'define') {
187 `./$^X -pibak -e 's{$pwd\/libperl.x}{$archlibexp/CORE/libperl.x}' lib/Config.pm`;
192 # This is required only if we are installing on a NetWare server
193 $installscript = $Config{installnwscripts};
194 $installprivlib = $Config{installnwlib};
195 $installarchlib = $Config{installnwlib};
196 $installsitelib = $Config{installnwlib};
199 my $d_dosuid = $Config{d_dosuid};
200 my $binexp = $Config{binexp};
202 if ($Is_VMS) { # Hang in there until File::Spec hits the big time
203 foreach ( \$installbin, \$installscript, \$installprivlib,
204 \$installarchlib, \$installsitelib, \$installsitearch,
206 $$_ = unixify($$_); $$_ =~ s:/$::;
210 # Do some quick sanity checks.
212 if ($d_dosuid && $>) { die "You must run as root to install suidperl\n"; }
214 $installbin || die "No installbin directory in config.sh\n";
215 -d $installbin || mkpath($installbin, $verbose, 0777);
216 -d $installbin || $nonono || die "$installbin is not a directory\n";
217 -w $installbin || $nonono || die "$installbin is not writable by you\n"
218 unless $installbin =~ m#^/afs/# || $nonono;
221 -x 'perl' . $exe_ext || die "perl isn't executable!\n";
222 -x 'suidperl' . $exe_ext|| die "suidperl isn't executable!\n" if $d_dosuid;
224 -f 't/rantests' || $Is_W32
225 || warn "WARNING: You've never run 'make test' or",
226 " some tests failed! (Installing anyway.)\n";
229 if (($Is_W32 and ! $Is_NetWare) or $Is_Cygwin) {
234 $perldll =~ s/(\..*)?$/.$dlext/;
235 if ($Config{useshrplib} eq 'true') {
236 # install ld2 and perlld as well
237 foreach ('ld2', 'perlld') {
238 safe_unlink("$installbin/$_");
239 copy("$_", "$installbin/$_");
240 chmod(0755, "$installbin/$_");
244 $perldll = 'perl57.' . $dlext;
247 if ($dlsrc ne "dl_none.xs") {
248 -f $perldll || die "No perl DLL built\n";
252 safe_unlink("$installbin/$perldll");
253 copy("$perldll", "$installbin/$perldll");
254 chmod(0755, "$installbin/$perldll");
256 } # if (($Is_W32 and ! $Is_NetWare) or $Is_Cygwin)
258 # This will be used to store the packlist
259 my $packlist = ExtUtils::Packlist->new("$installarchlib/.packlist");
261 # First we install the version-numbered executables.
264 safe_unlink("$installbin/$perl$exe_ext");
265 copy("perl$exe_ext", "$installbin/$perl$exe_ext");
266 chmod(0755, "$installbin/$perl$exe_ext");
267 safe_unlink("$installbin/${perl}shr$exe_ext");
268 copy("perlshr$exe_ext", "$installbin/${perl}shr$exe_ext");
269 chmod(0755, "$installbin/${perl}shr$exe_ext");
271 elsif ($^O eq 'mpeix') {
272 # MPE lacks hard links and requires that executables with special
273 # capabilities reside in the MPE namespace.
274 safe_unlink("$installbin/perl$ver$exe_ext", $Config{perlpath});
275 # Install the primary executable into the MPE namespace as perlpath.
276 copy("perl$exe_ext", $Config{perlpath});
277 chmod(0755, $Config{perlpath});
278 # Create a backup copy with the version number.
279 link($Config{perlpath}, "$installbin/perl$ver$exe_ext");
281 elsif ($^O ne 'dos') {
283 safe_unlink("$installbin/$perl_verbase$ver$exe_ext");
284 copy("perl$exe_ext", "$installbin/$perl_verbase$ver$exe_ext");
285 strip("$installbin/$perl_verbase$ver$exe_ext");
286 chmod(0755, "$installbin/$perl_verbase$ver$exe_ext");
289 # If installing onto a NetWare server
291 # Copy perl.nlm, echo.nlm, type.nlm, a2p.nlm & cgi2perl.nlm
292 mkpath($Config{installnwsystem}, 1, 0777);
293 copy("netware\\".$ENV{'MAKE_TYPE'}."\\perl.nlm", $Config{installnwsystem});
294 copy("netware\\testnlm\\echo\\echo.nlm", $Config{installnwsystem});
295 copy("netware\\testnlm\\type\\type.nlm", $Config{installnwsystem});
296 copy("x2p\\a2p.nlm", $Config{installnwsystem});
297 chmod(0755, "$Config{installnwsystem}\\perl.nlm");
298 mkpath($Config{installnwlcgi}, 1, 0777);
299 copy("lib\\auto\\cgi2perl\\cgi2perl.nlm", $Config{installnwlcgi});
304 safe_unlink("$installbin/$perl.exe");
305 copy("perl.exe", "$installbin/$perl.exe");
308 safe_unlink("$installbin/s$perl_verbase$ver$exe_ext");
310 copy("suidperl$exe_ext", "$installbin/s$perl_verbase$ver$exe_ext");
311 chmod(04711, "$installbin/s$perl_verbase$ver$exe_ext");
314 # Install library files.
316 my ($do_installarchlib, $do_installprivlib) = (0, 0);
318 mkpath($installprivlib, $verbose, 0777);
319 mkpath($installarchlib, $verbose, 0777);
320 mkpath($installsitelib, $verbose, 0777) if ($installsitelib);
321 mkpath($installsitearch, $verbose, 0777) if ($installsitearch);
324 $do_installarchlib = ! samepath($installarchlib, '.');
325 $do_installprivlib = ! samepath($installprivlib, '.');
326 $do_installprivlib = 0 if $versiononly && !($installprivlib =~ m/\Q$ver/);
328 if ($do_installarchlib || $do_installprivlib) {
329 find(\&installlib, '.');
331 chdir ".." || die "Can't cd back to source directory: $!\n";
334 warn "Can't cd to lib to install lib files: $!\n";
337 # Install header files and libraries.
338 mkpath("$installarchlib/CORE", $verbose, 0777);
340 if ($Is_VMS) { # We did core file selection during build
341 my $coredir = "lib/$Config{archname}/$ver/CORE";
343 map { s|^$coredir/||i; } @corefiles = <$coredir/*.*>;
346 # [als] hard-coded 'libperl' name... not good!
347 @corefiles = <*.h libperl*.*>;
349 # AIX needs perl.exp installed as well.
350 push(@corefiles,'perl.exp') if $^O eq 'aix';
351 if ($^O eq 'mpeix') {
352 # MPE needs mpeixish.h installed as well.
353 mkpath("$installarchlib/CORE/mpeix", $verbose, 0777);
354 push(@corefiles,'mpeix/mpeixish.h');
356 # If they have built sperl.o...
357 push(@corefiles,'sperl.o') if -f 'sperl.o';
359 foreach my $file (@corefiles) {
360 # HP-UX (at least) needs to maintain execute permissions
361 # on dynamically-loadable libraries. So we do it for all.
362 if (copy_if_diff($file,"$installarchlib/CORE/$file")) {
363 if ($file =~ /\.(\Q$so\E|\Q$dlext\E)$/) {
364 strip("-S", "$installarchlib/CORE/$file") if $^O =~ /^(rhapsody|darwin)$/;
365 chmod(0555, "$installarchlib/CORE/$file");
367 chmod(0444, "$installarchlib/CORE/$file");
372 # Install main perl executables
373 # Make links to ordinary names if installbin directory isn't current directory.
375 if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VMS && ! $Is_NetWare) {
376 safe_unlink("$installbin/$perl$exe_ext", "$installbin/suid$perl$exe_ext");
377 if ($^O eq 'mpeix') {
378 # MPE doesn't support hard links, so use a symlink.
379 # We don't want another cloned copy.
380 symlink($Config{perlpath}, "$installbin/perl$exe_ext");
382 link("$installbin/$perl_verbase$ver$exe_ext",
383 "$installbin/$perl$exe_ext");
385 link("$installbin/s$perl_verbase$ver$exe_ext",
386 "$installbin/suid$perl$exe_ext")
390 # For development purposes it can be very useful to have multiple perls
391 # build for different "architectures" (eg threading or not) simultaneously.
392 if ($archname && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VMS) {
393 my $archperl = "$perl_verbase$ver-$Config{archname}$exe_ext";
394 safe_unlink("$installbin/$archperl");
395 if ($^O eq 'mpeix') {
396 # MPE doesn't support hard links, so use a symlink.
397 # We don't want another cloned copy.
398 symlink($Config{perlpath}, "$installbin/$archperl");
400 link("$installbin/$perl_verbase$ver$exe_ext",
401 "$installbin/$archperl");
405 # Offer to install perl in a "standard" location
407 my $mainperl_is_instperl = 0;
409 if ($Config{installusrbinperl} && $Config{installusrbinperl} eq 'define' &&
410 !$versiononly && !$nonono && !$Is_W32 && !$Is_NetWare && !$Is_VMS && -t STDIN && -t STDERR
411 && -w $mainperldir && ! samepath($mainperldir, $installbin)) {
412 my($usrbinperl) = "$mainperldir/$perl$exe_ext";
413 my($instperl) = "$installbin/$perl$exe_ext";
414 my($expinstperl) = "$binexp/$perl$exe_ext";
416 # First make sure $usrbinperl is not already the same as the perl we
418 if (-x $usrbinperl) {
419 # Try to be clever about mainperl being a symbolic link
420 # to binexp/perl if binexp and installbin are different.
421 $mainperl_is_instperl =
422 samepath($usrbinperl, $instperl) ||
423 samepath($usrbinperl, $expinstperl) ||
424 (($binexp ne $installbin) &&
426 ((readlink $usrbinperl) eq $expinstperl));
428 if (! $mainperl_is_instperl) {
430 ( $Config{'d_link'} eq 'define' &&
431 eval { CORE::link $instperl, $usrbinperl } ) ||
432 eval { symlink $expinstperl, $usrbinperl } ||
433 copy($instperl, $usrbinperl);
435 $mainperl_is_instperl = 1;
439 # Make links to ordinary names if installbin directory isn't current directory.
441 if (!$versiononly && ! samepath($installbin, 'x2p')) {
442 safe_unlink("$installbin/a2p$exe_ext");
443 copy("x2p/a2p$exe_ext", "$installbin/a2p$exe_ext");
444 strip("$installbin/a2p$exe_ext");
445 chmod(0755, "$installbin/a2p$exe_ext");
449 # cppstdin is just a script, but it is architecture-dependent, so
450 # it can't safely be shared. Place it in $installbin.
451 # Note that Configure doesn't build cppstin if it isn't needed, so
452 # we skip this if cppstdin doesn't exist.
453 if (! $versiononly && (-f 'cppstdin') && (! samepath($installbin, '.'))) {
454 safe_unlink("$installbin/cppstdin");
455 copy("cppstdin", "$installbin/cppstdin");
456 chmod(0755, "$installbin/cppstdin");
460 my ($installscript, $orig, $alias, $scr_ext) = @_;
462 safe_unlink("$installscript/$alias$scr_ext");
463 if ($^O eq 'dos' or $Is_VMS or $^O eq 'transit') {
464 copy("$installscript/$orig$scr_ext",
465 "$installscript/$alias$scr_ext");
467 link("$installscript/$orig$scr_ext",
468 "$installscript/$alias$scr_ext");
473 mkpath($installscript, $verbose, 0777);
476 (my $base = $_) =~ s#.*/##;
478 copy($_, "$installscript/$base");
479 chmod(0755, "$installscript/$base");
483 my ($from, $to) = map { "$_$ver" } @$_;
484 (my $frbase = $from) =~ s#.*/##;
485 (my $tobase = $to) =~ s#.*/##;
486 script_alias($installscript, $frbase, $tobase, $scr_ext);
490 (my $base = $_) =~ s#.*/##;
491 copy($_, "$installscript/$base");
492 chmod(0755, "$installscript/$base");
496 my ($from, $to) = @$_;
497 (my $frbase = $from) =~ s#.*/##;
498 (my $tobase = $to) =~ s#.*/##;
499 script_alias($installscript, $frbase, $tobase, $scr_ext);
503 # Install pod pages. Where? I guess in $installprivlib/pod
504 # ($installprivlib/pods for cygwin).
506 my $pod = ($Is_Cygwin || $Is_Darwin) ? 'pods' : 'pod';
507 if ( !$versiononly || ($installprivlib =~ m/\Q$ver/)) {
508 mkpath("${installprivlib}/$pod", $verbose, 0777);
510 # If Perl 5.003's perldiag.pod is there, rename it.
511 if (open POD, "${installprivlib}/$pod/perldiag.pod") {
514 # Some of Perl 5.003's diagnostic messages ended with periods.
516 my ($from, $to) = ("${installprivlib}/$pod/perldiag.pod",
517 "${installprivlib}/$pod/perldiag-5.003.pod");
518 print " rename $from $to";
520 or warn "Couldn't rename $from to $to: $!\n"
526 # $_ is a name like pod/perl.pod
527 (my $base = $_) =~ s#.*/##;
528 copy_if_diff($_, "${installprivlib}/$pod/${base}");
533 # Check to make sure there aren't other perls around in installer's
534 # path. This is probably UNIX-specific. Check all absolute directories
535 # in the path except for where public executables are supposed to live.
536 # Also skip $mainperl if the user opted to have it be a link to the
539 if (!$versiononly && $otherperls) {
541 my $dirsep = ($Is_OS2 || $Is_W32 || $Is_NetWare) ? ';' : ':' ;
542 ($path = $ENV{"PATH"}) =~ s:\\:/:g ;
543 @path = split(/$dirsep/, $path);
546 while (exists $ENV{'DCL$PATH' . $i}) {
547 my $dir = unixpath($ENV{'DCL$PATH' . $i}); $dir =~ s-/$--;
555 # Use &samepath here because some systems have other dirs linked
556 # to $mainperldir (like SunOS)
557 next if samepath($_, $binexp);
558 next if ($mainperl_is_instperl && samepath($_, $mainperldir));
559 my $otherperl = "$_/$perl$exe_ext";
560 next if $otherperls{$otherperl}++;
561 push(@otherperls, $otherperl)
562 if (-x $otherperl && ! -d $otherperl);
565 warn "\nWarning: $perl appears in your path in the following " .
566 "locations beyond where\nwe just installed it:\n";
575 $packlist->write() unless $nonono;
576 print " Installation complete\n" if $verbose;
580 ###############################################################################
585 my($default) = $prompt =~ m/\[([yn])\]\s*$/i;
586 print STDERR $prompt;
587 chop($answer = <STDIN>);
588 $answer = $default if $answer =~ m/^\s*$/;
589 ($answer =~ m/^[yY]/);
596 return scalar(@names) if $Is_VMS;
598 foreach my $name (@names) {
599 next unless -e $name;
600 chmod 0777, $name if ($Is_OS2 || $Is_W32 || $Is_Cygwin || $Is_NetWare);
601 print " unlink $name\n" if $verbose;
602 ( CORE::unlink($name) and ++$cnt
603 or warn "Couldn't unlink $name: $!\n" ) unless $nonono;
609 return if $nonono or $Is_VMS;
611 foreach my $name (@names) {
612 next unless -e $name;
613 chmod 0777, $name if ($Is_OS2 || $Is_W32 || $Is_NetWare);
614 print " unlink $name\n" if $verbose;
615 next if CORE::unlink($name);
616 warn "Couldn't unlink $name: $!\n";
618 print " mv $name $name.old\n" if $verbose;
619 safe_rename($name, "$name.old")
620 or warn "Couldn't rename $name: $!\n";
627 if (-f $to and not unlink($to)) {
629 for ($i = 1; $i < 50; $i++) {
630 last if rename($to, "$to.$i");
632 warn("Cannot rename to `$to.$i': $!"), return 0
633 if $i >= 50; # Give up!
635 link($from,$to) || return 0;
643 print $verbose ? " ln $from $to\n" : " $to\n" unless $silent;
645 CORE::link($from, $to)
647 : ($from =~ m#^/afs/# || $to =~ m#^/afs/#)
648 ? die "AFS" # okay inside eval {}
649 : die "Couldn't link $from to $to: $!\n"
651 $packlist->{$to} = { from => $from, type => 'link' };
655 print $verbose ? " cp $from $to\n" : " $to\n" unless $silent;
656 print " creating new version of $to\n"
657 if $Is_VMS and -e $to and !$silent;
658 File::Copy::copy($from, $to)
660 : warn "Couldn't copy $from to $to: $!\n"
662 $packlist->{$to} = { type => 'file' };
668 my($mode,$name) = @_;
670 return if ($^O eq 'dos');
671 printf " chmod %o %s\n", $mode, $name if $verbose;
672 CORE::chmod($mode,$name)
673 || warn sprintf("Couldn't chmod %o %s: $!\n", $mode, $name)
680 print $verbose ? " cp $from $to\n" : " $to\n" unless $silent;
681 print " creating new version of $to\n" if $Is_VMS and -e $to and !$silent;
682 File::Copy::copy($from, $to)
683 || warn "Couldn't copy $from to $to: $!\n"
685 $packlist->{$to} = { type => 'file' };
691 return (lc($p1) eq lc($p2)) if ($Is_W32 || $Is_NetWare);
694 my($dev1, $ino1, $dev2, $ino2);
695 ($dev1, $ino1) = stat($p1);
696 ($dev2, $ino2) = stat($p2);
697 ($dev1 == $dev2 && $ino1 == $ino2);
705 my $dir = $File::Find::dir;
706 $dir =~ s#^\.(?![^/])/?##;
707 local($depth) = $dir ? "lib/$dir" : "lib";
711 # Ignore RCS and CVS directories.
712 if (($name eq 'CVS' or $name eq 'RCS') and -d $name) {
713 $File::Find::prune = 1;
717 # ignore patch backups, RCS files, emacs backup & temp files and the
718 # .exists files, .PL files, and .t files.
719 return if $name =~ m{\.orig$|~$|^#.+#$|,v$|^\.exists|\.PL$|\.t$};
721 $name = "$dir/$name" if $dir ne '';
723 my $installlib = $installprivlib;
724 if ($dir =~ /^auto/ ||
725 ($name =~ /^(.*)\.(?:pm|pod)$/ && $archpms{$1}) ||
726 ($name =~ /^(.*)\.(?:h|lib)$/i && ($Is_W32 || $Is_NetWare))
728 $installlib = $installarchlib;
729 return unless $do_installarchlib;
731 return unless $do_installprivlib;
735 if (/\.(?:al|ix)$/ && !($dir =~ m[^auto/(.*)$] && $archpms{$1})) {
736 $installlib = $installprivlib;
737 #We're installing *.al and *.ix files into $installprivlib,
738 #but we have to delete old *.al and *.ix files from the 5.000
740 #This might not work because $archname might have changed.
741 unlink("$installarchlib/$name");
743 $packlist->{"$installlib/$name"} = { type => 'file' };
744 if (compare($_, "$installlib/$name") || $nonono) {
745 unlink("$installlib/$name");
746 mkpath("$installlib/$dir", $verbose, 0777);
747 # HP-UX (at least) needs to maintain execute permissions
748 # on dynamically-loaded libraries.
749 if ($Is_NetWare && !$nwinstall) {
750 # Don't copy .nlp,.nlm files, doesn't make sense on Windows and also
751 # if copied will give problems when building new extensions.
752 # Has to be copied if we are installing on a NetWare server and hence
753 # the check !$nwinstall
754 if (!(/\.(?:nlp|nlm|bs)$/)) {
755 copy_if_diff($_, "$installlib/$name")
756 and chmod($name =~ /\.(so|$dlext)$/o ? 0555 : 0444,
757 "$installlib/$name");
760 if (copy_if_diff($_, "$installlib/$name")) {
761 if ($name =~ /\.(so|$dlext)$/o) {
762 strip("-S", "$installlib/$name") if $^O =~ /^(rhapsody|darwin)$/;
763 chmod(0555, "$installlib/$name");
765 strip("-S", "$installlib/$name")
766 if ($name =~ /\.a$/o and $^O =~ /^(rhapsody|darwin)$/);
767 chmod(0444, "$installlib/$name");
775 # Copy $from to $to, only if $from is different than $to.
776 # Also preserve modification times for .a libraries.
777 # On some systems, if you do
779 # cp libperl.a /usr/local/lib/perl5/archlib/CORE/libperl.a
780 # and then try to link against the installed libperl.a, you might
781 # get an error message to the effect that the symbol table is older
783 # Return true if copying occurred.
787 return 1 if (($^O eq 'VMS') && (-d $from));
788 -f $from || warn "$0: $from not found";
789 $packlist->{$to} = { type => 'file' };
790 if (compare($from, $to) || $nonono) {
791 safe_unlink($to); # In case we don't have write permissions.
793 $from = $depth . "/" . $from if $depth;
796 # Restore timestamps if it's a .a library or for OS/2.
797 if (!$nonono && ($Is_OS2 || $to =~ /\.a$/)) {
798 my ($atime, $mtime) = (stat $from)[8,9];
799 utime $atime, $mtime, $to;
809 return unless $dostrip;
812 while (@args && $args[0] =~ /^(-\w+)$/) {
813 push @opts, shift @args;
816 foreach my $file (@args) {
819 print " strip " . join(' ', @opts);
820 print " " if (@opts);
823 system("strip", @opts, $file);
825 print "# file '$file' skipped\n" if $verbose;