Randy Kobes wrote:

> On Wed, 3 Oct 2001, Stas Bekman wrote:
> 
> 
>>If I put foo/Makefile.PL into the root of the modperl-2.0, it gets
>>automatically executed with the same args at the top Makefile.PL and all
>>the make calls are automatically propogated there as well, now I cannot
>>figure out why if I put the Makefile.PL not on the first level but
>>somewhat deeper, this exact thing doesn't happen.
>>
>>I've created modperl-2.0/docs/src/api/mod_perl-2.0/Makefile.PL. How do I
>>make it a part of the automatic build?
>>
>>It seems that the magic is in the MakeMaker and not mod_perl, since I
>>cannot find any leads in the mod_perl code.
>>
>>Thanks.
>>
> 
> Would giving WriteMakefile() a DIR attribute (an array ref of
> subdirectories containing Makefile.PLs) work?


Yes, thanks Randy, $self->{DIR} in MM is the one. Unfortunately it's not 
possible to override MM::init_dirscan(), and I don't see any other 
overridable target in MM_Unix immediately following init_dirscan() so I 
can adjust $self->{DIR}.


If I pass DIR to Makefile, I've to repeat what init_dirscan does, 
because I don't want mod_perl build to lose the dropin-n-build 
functionality. So I've ended up with something like this in the top

use File::Spec ();
use DirHandle ();
my @mf_dirs = ();
for my $dir (@extra_makefile_dirs,
              grep !/^\.\.?$/, grep {-d} DirHandle->new('.')->read) {
     next if -l $dir; # no symlinks per MakeMaker
     push @mf_dirs, $dir if -f File::Spec->catfile($dir, "Makefile.PL");
}

ModPerl::MM::WriteMakefile(
     NAME => 'mod_perl',
     VERSION => $VERSION,
     DIR     => \@mf_dirs,
     ...

not sure whether it's the right way to go, but it works.

Since docs/src/api/mod_perl-2.0/Makefile.PL is then called with ../blib 
as the build target I've to rewrite .. into ../../../.. to get back to 
the top blib. Should I change Makefile.PL: MY::paththru to give a 
different argument?

The current build system wasn't designed for reaching dirs which are not 
immediate children of the top dir, unless I create Makefile.PLs in every 
dir on the way to docs/src/api/mod_perl-2.0/Makefile.PL, I'm not sure 
what's the best way to go...

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to