install pods to 'pods' rather than 'pod' on cygwin (modified
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 10 Oct 1999 06:33:15 +0000 (06:33 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 10 Oct 1999 06:33:15 +0000 (06:33 +0000)
a patch suggested by cwilson@cc865179-c.chmbl1.ga.home.com)

p4raw-id: //depot/perl@4333

installperl
lib/diagnostics.pm
utils/perldoc.PL

index faf1c70..d0d5eeb 100755 (executable)
@@ -113,6 +113,7 @@ my $libperl = $Config{libperl};
 # Shared library and dynamic loading suffixes.
 my $so = $Config{so};
 my $dlext = $Config{dlext};
+my $dlsrc = $Config{dlsrc};
 
 my $d_dosuid = $Config{d_dosuid};
 my $binexp = $Config{binexp};
@@ -161,14 +162,16 @@ if ($Is_Cygwin) {
   $perldll = 'perl56.' . $dlext if $Config{'ccflags'} =~ /PERL_OBJECT/i;
 }
 
--f $perldll || die "No perl DLL built\n";
+   if ($dlsrc != "dl_none.xs") {
+      -f $perldll || die "No perl DLL built\n";
 
 # Install the DLL
 
-safe_unlink("$installbin/$perldll");
-copy("$perldll", "$installbin/$perldll");
-chmod(0755, "$installbin/$perldll");
-}
+      safe_unlink("$installbin/$perldll");
+      copy("$perldll", "$installbin/$perldll");
+      chmod(0755, "$installbin/$perldll");
+   }
+} # if ($Is_W32 or $Is_Cygwin)
 
 # This will be used to store the packlist
 my $packlist = ExtUtils::Packlist->new("$installarchlib/.packlist");
@@ -365,19 +368,21 @@ if (! $versiononly) {
     }
 }
 
-# Install pod pages.  Where? I guess in $installprivlib/pod.
+# Install pod pages.  Where? I guess in $installprivlib/pod
+# ($installprivlib/pods for cygwin).
 
+my $pod = $Is_Cygwin ? 'pods' : 'pod';
 unless ( $versiononly && !($installprivlib =~ m/\Q$]/)) {
-    mkpath("${installprivlib}/pod", 1, 0777);
+    mkpath("${installprivlib}/$pod", 1, 0777);
 
     # If Perl 5.003's perldiag.pod is there, rename it.
-    if (open POD, "${installprivlib}/pod/perldiag.pod") {
+    if (open POD, "${installprivlib}/$pod/perldiag.pod") {
        read POD, $_, 4000;
        close POD;
        # Some of Perl 5.003's diagnostic messages ended with periods.
        if (/^=.*\.$/m) {
-           my ($from, $to) = ("${installprivlib}/pod/perldiag.pod",
-                              "${installprivlib}/pod/perldiag-5.003.pod");
+           my ($from, $to) = ("${installprivlib}/$pod/perldiag.pod",
+                              "${installprivlib}/$pod/perldiag-5.003.pod");
            print "  rename $from $to";
            rename($from, $to)
                or warn "Couldn't rename $from to $to: $!\n"
@@ -385,9 +390,10 @@ unless ( $versiononly && !($installprivlib =~ m/\Q$]/)) {
        }
     }
 
-    foreach my $file (@pods) {
-       # $file is a name like  pod/perl.pod
-       copy_if_diff($file, "${installprivlib}/${file}");
+    for (@pods) {
+       # $_ is a name like  pod/perl.pod
+        (my $base = $_) =~ s#.*/##;
+       copy_if_diff($_, "${installprivlib}/$pod/${base}");
     }
 
 }
index f174ee5..05af621 100755 (executable)
@@ -177,9 +177,14 @@ if ($^O eq 'VMS') {
     $privlib = VMS::Filespec::unixify($privlib);
     $archlib = VMS::Filespec::unixify($archlib);
 }
-@trypod = ("$archlib/pod/perldiag.pod",
+@trypod = (
+          "$archlib/pod/perldiag.pod",
           "$privlib/pod/perldiag-$].pod",
-          "$privlib/pod/perldiag.pod");
+          "$privlib/pod/perldiag.pod"
+          "$archlib/pods/perldiag.pod",
+          "$privlib/pods/perldiag-$].pod",
+          "$privlib/pods/perldiag.pod"
+         );
 # handy for development testing of new warnings etc
 unshift @trypod, "./pod/perldiag.pod" if -e "pod/perldiag.pod";
 ($PODFILE) = ((grep { -e } @trypod), $trypod[$#trypod])[0];
index 7dc478b..e0f276a 100644 (file)
@@ -243,6 +243,7 @@ sub minus_f_nocase {
 
 sub check_file {
     my($dir,$file) = @_;
+    return "" if length $dir and not -d $dir;
     if ($opt_m) {
        return minus_f_nocase($dir,$file);
     }
@@ -278,6 +279,8 @@ sub searchfor {
                     $ret = check_file $dir,"$s.bat")
                or ( $ret = check_file "$dir/pod","$s.pod")
                or ( $ret = check_file "$dir/pod",$s)
+               or ( $ret = check_file "$dir/pods","$s.pod")
+               or ( $ret = check_file "$dir/pods",$s)
        ) {
            return $ret;
        }
@@ -708,6 +711,10 @@ and others.
 =cut
 
 #
+# Version 1.15: Tue Aug 24 01:50:20 EST 1999
+#       Charles Wilson <cwilson@ece.gatech.edu>
+#      changed /pod/ directory to /pods/ for cygwin
+#         to support cygwin/win32
 # Version 1.14: Wed Jul 15 01:50:20 EST 1998
 #       Robin Barker <rmb1@cise.npl.co.uk>
 #      -strict, -w cleanups