Hello,

I'm trying out ExtUtils::MakeMaker on Red Hat 9, and have found a
problem.  RH 9 comes with Perl 5.8.0 which has some patches from
5.8.1-RC* applied.

One of these patches results in install(site|vendor)man[13]dir *not*
being defined, instead install(site|vendor)man[13] are:

  $ perl -V:* | grep -P '^install.*man'
  installman1dir='/usr/share/man/man1'
  installman3dir='/usr/share/man/man3'
  installsiteman1='/usr/share/man/man1'
  installsiteman3='/usr/share/man/man3'
  installvendorman1='/usr/share/man/man1'
  installvendorman3='/usr/share/man/man3'

It seems that the offending patch is
http://public.activestate.com/cgi-bin/perlbrowse?patch=18110
Additionally 5.8.1-RC1 to RC3 had this included, but it was changed back
in 5.8.1-RC4 (in unable to find the exact patch ATM).

So, I threw together a patch which fixes this by consulting the
'dir'-suffixless $Config vars too.

While at it, I tweaked MM_Unix so that it now defaults to the "core"
install dirs for perls which don't have vendor dir support or have
usevendorprefix not set (applicable of course when INSTALLDIRS=vendor is
used).  Ditto for the site dirs.  This is the behaviour I understand and
expect from reading core Perl's Configure.

I realize hacking MakeMaker must be done with a delicate touch and tried
to be very careful not to break anything; I think I succeeded and it
should be safe to apply this patch.  After applying it, I get good,
expected results from a "perl Makefile.PL INSTALLDIRS=vendor ; make
install DESTDIR=foo" on the following systems:

* FreeBSD 4.8 (perl 5.00503, usevendorprefix N/A)
* Red Hat 7.1 (perl 5.6.0, usevendorprefix N/A)
* Red Hat 7.2 (perl 5.6.1, usevendorprefix no)
* Red Hat 7.3 (perl 5.6.1, usevendorprefix yes (patched by RH))
* Tru64 5.1 (perl 5.6.1, usevendorprefix no)
* Mandrake 8.2 (perl 5.6.1, usevendorprefix no)
* Debian testing/unstable (perl 5.8.0, usevendorprefix yes)
* Red Hat 8.0 (perl 5.8.0, usevendorprefix yes)
* Red Hat 9 (perl 5.8.0 + some 5.8.1RC'ish patches, usevendorprefix yes)

Cheers,
-\/ille

--- lib/ExtUtils/MM_Unix.pm.orig        2003-08-15 04:28:42.000000000 +0300
+++ lib/ExtUtils/MM_Unix.pm     2003-09-03 00:27:52.000000000 +0300
@@ -2045,14 +2045,26 @@
 
     $self->init_lib2arch;
 
-    # Initialize installvendorman*dir if necessary
+    # Note: Perl 5.8.1-RC1 to RC3 have install(site|vendor)man[13] but no
+    #       install(site|vendor)man[13]dir.  For example Red Hat Linux 9
+    #       ships with an affected (patched) Perl:
+    #       http://public.activestate.com/cgi-bin/perlbrowse?patch=18110
+
+    # Initialize installvendorman*dir if necessary.  If usevendorprefix
+    # is not defined, initialize to core install dirs.
     foreach my $num (1, 3) {
         my $k = 'installvendorman'.$num.'dir';
+        my $l = 'installvendorman'.$num;
+        my $m = 'installman'.$num.'dir';
 
         unless ($Config{$k}) {
-            $Config_Override{$k} = $Config{usevendorprefix} ?
+            if ($Config{$l}) {
+                $Config_Override{$k} = $Config{$l};
+            } else {
+                $Config_Override{$k} = $Config{usevendorprefix} ?
                   $self->catdir($Config{vendorprefixexp}, 'man', "man$num") :
-                  '';
+                  $Config{$m} || '';
+            }
         }
     }
 
@@ -2061,26 +2073,33 @@
     my $vprefix = $Config{usevendorprefix}  ? $Config{vendorprefixexp} : '';
     my $sprefix = $Config{siteprefixexp}    || '';
 
-    # 5.005_03 doesn't have a siteprefix.
-    $sprefix = $iprefix unless $sprefix;
-
     # There are often no Config.pm defaults for these, but we can make
     # it up.
     unless( $Config{installsiteman1dir} ) {
-        $Config_Override{installsiteman1dir} = 
-          $self->catdir($sprefix, 'man', 'man1');
+        $Config_Override{installsiteman1dir} =
+          $Config{installsiteman1} ||
+          ($sprefix ? $self->catdir($sprefix, 'man', 'man1') :
+           $Config{installman1dir});
     }
 
     unless( $Config{installsiteman3dir} ) {
-        $Config_Override{installsiteman3dir} = 
-          $self->catdir($sprefix, 'man', 'man3');
+        $Config_Override{installsiteman3dir} =
+          $Config{installsiteman3} ||
+          ($sprefix ? $self->catdir($sprefix, 'man', 'man3') :
+           $Config{installman3dir});
     }
 
     unless( $Config{installsitebin} ) {
         $Config_Override{installsitebin} =
-          $self->catdir($sprefix, 'bin');
+          ($sprefix ? $self->catdir($sprefix, 'bin') : 'installbin');
     }
 
+    # 5.005_03 doesn't have a siteprefix.
+    $sprefix = $iprefix unless $sprefix;
+
+    # < 5.6.1 doesn't have vendor dir support, default to "core" dirs.
+    $vprefix = $iprefix unless $vprefix;
+
     $self->{PREFIX}       ||= '';
 
     if( $self->{PREFIX} ) {
@@ -2226,8 +2245,11 @@
     }
 
     # Generate these if they weren't figured out.
-    $self->{VENDORARCHEXP} ||= $self->{INSTALLVENDORARCH};
-    $self->{VENDORLIBEXP}  ||= $self->{INSTALLVENDORLIB};
+    $self->{INSTALLVENDORBIN}  ||= $self->{INSTALLBIN};
+    $self->{INSTALLVENDORLIB}  ||= $self->{INSTALLPRIVLIB};
+    $self->{INSTALLVENDORARCH} ||= $self->{INSTALLARCHLIB};
+    $self->{VENDORARCHEXP}     ||= $self->{INSTALLVENDORARCH};
+    $self->{VENDORLIBEXP}      ||= $self->{INSTALLVENDORLIB};
 
     return 1;
 }

Reply via email to