SPUG: MM_Unix mod needed?

Charles DeRykus charles.e.derykus at boeing.com
Thu Jan 6 17:01:11 CST 2000


> I want to change MakeMaker so that subdirectories do not inherit the
> INSTALLSITELIB installation path from the parent Makefile.PL.  From
> my review of the code, it appears I'd need to change MM_Unix.pm to
> change the 'sub tools_other' method to remove the following line:
>
>   return join "", @m if $self->{PARENT};
>
> Additionally, I'd need to modify MakeMaker.pm as follows to avoid the subdir p
>ass:
>
>    if ($self->{PARENT}) {
>          for (qw/install dist dist_basics dist_core dist_dir dist_test dist_ci
>/) {
>              $self->{SKIPHASH}{$_} = 1;
>         }
>     }
>
>     _to_
>
>     if ($self->{PARENT}) {
>          for (qw/dist dist_basics dist_core dist_dir dist_test dist_ci/) {
>              $self->{SKIPHASH}{$_} = 1;
>         }
>     }
>
> Has anyone dealt with this before?  Is there a better solution?


I saw your original post and was suprised that passing a
PREFIX attribute didn't work within the subdirectory. 
I did notice that there's a a mechanism for overriding  
MakeMaker method output though: 

     If you cannot achieve the desired Makefile behaviour by
     specifying attributes you may define private subroutines in
     the Makefile.PL.  Each subroutines returns the text it
     wishes to have written to the Makefile. To override a
     section of the Makefile you can either say:

             sub MY::c_o { "new literal text" }

     or you can edit the default by saying something like:

             sub MY::c_o {
                 package MY; # so that "SUPER" works right
                 my $inherited = shift->SUPER::c_o(@_);
                 $inherited =~ s/old text/new text/;
                 $inherited;
             }


Sounds like this would be easier and more flexible - if you 
can just figure out the appropriate method to override. 
Hopefully, I'm not barking up the wrong tree here. 

--
Charles DeRykus

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address





More information about the spug-list mailing list