From: Gurusamy Sarathy Date: Wed, 26 Nov 1997 03:20:55 +0000 (+0000) Subject: [win32] merge win32-aware installperl in ansiperl branch. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eef1cf2a23a873e7d505bb26346d56dd1fe0c960;p=p5sagit%2Fp5-mst-13.2.git [win32] merge win32-aware installperl in ansiperl branch. p4raw-id: //depot/win32/perl@313 --- diff --git a/installperl b/installperl index e999d3b..465b48d 100755 --- a/installperl +++ b/installperl @@ -84,6 +84,17 @@ if ($d_dosuid && $>) { die "You must run as root to install suidperl\n"; } -x 't/TEST' || warn "WARNING: You've never run 'make test'!!!", " (Installing anyway.)\n"; +if ($^O eq 'MSWin32') { + +-f 'perl.' . $dlext || die "No perl DLL built\n"; + +# Install the DLL + +safe_unlink("$installbin/perl.$dlext"); +copy("perl.$dlext", "$installbin/perl.$dlext"); +chmod(0755, "$installbin/perl.$dlext"); +} + # First we install the version-numbered executables. safe_unlink("$installbin/perl$ver$exe_ext"); @@ -256,7 +267,7 @@ if (! $versiononly || !($installprivlib =~ m/\Q$]/)) { if (!$versiononly) { - $dirsep = ($^O eq 'os2') ? ';' : ':' ; + $dirsep = ($^O eq 'os2' || $^O eq 'MSWin32') ? ';' : ':' ; ($path = $ENV{"PATH"}) =~ s:\\:/:g ; @path = split(/$dirsep/, $path); @otherperls = (); @@ -302,7 +313,7 @@ sub unlink { foreach $name (@names) { next unless -e $name; - chmod 0777, $name if $^O eq 'os2'; + chmod 0777, $name if ($^O eq 'os2' || $^O eq 'MSWin32'); print STDERR " unlink $name\n"; ( CORE::unlink($name) and ++$cnt or warn "Couldn't unlink $name: $!\n" ) unless $nonono; @@ -315,7 +326,7 @@ sub safe_unlink { local @names = @_; foreach $name (@names) { next unless -e $name; - chmod 0777, $name if $^O eq 'os2'; + chmod 0777, $name if ($^O eq 'os2' || $^O eq 'MSWin32'); print STDERR " unlink $name\n"; next if CORE::unlink($name); warn "Couldn't unlink $name: $!\n"; @@ -383,9 +394,11 @@ sub copy { sub samepath { local($p1, $p2) = @_; - local($dev1, $ino1, $dev2, $ino2); + + return (lc($p1) eq lc($p2)) if ($^O eq 'MSWin32'); if ($p1 ne $p2) { + local($dev1, $ino1, $dev2, $ino2); ($dev1, $ino1) = stat($p1); ($dev2, $ino2) = stat($p2); ($dev1 == $dev2 && $ino1 == $ino2); @@ -414,7 +427,9 @@ sub installlib { my $installlib = $installprivlib; if ($dir =~ /^auto/ || - ($name =~ /^(.*)\.(?:pm|pod)$/ && $archpms{$1})) { + ($name =~ /^(.*)\.(?:pm|pod)$/ && $archpms{$1}) || + ($name =~ /^(.*)\.(?:h|lib)$/i && $^O eq 'MSWin32') + ) { $installlib = $installarchlib; return unless $do_installarchlib; } else {