Michael G Schwern wrote:
> On Thu, Jun 06, 2002 at 02:58:21PM -0700, David Carmean wrote:
>
>>The application is a single executable (script) named 'ddnstool'.
>>It also uses three modules as class libraries. To keep things straight
>>the modules live a couple of levels down in an internal company namespace.
>>I've used h2xs to generate module skeletons. So a MANIFEST *exerpt* might
>>look something like this:
>>
>> MANIFEST
>> Makefile.PL
>> bin/ddnstool
>> FOO/DDNS/Exceptions/Makefile.PL
>> FOO/DDNS/Exceptions/Exceptions.pm
>> FOO/DDNS/Graph/Makefile.PL
>> FOO/DDNS/Graph/Graph.pm
>> FOO/DDNS/Zonemaster/Makefile.PL
>> FOO/DDNS/Zonemaster/Zonemaster.pm
>>
>>
>>My goal is to get everything tied together and in the top-level
>>..../blib so that I can develop and test subsets then the full app.
>>
>>The only way I've figured out to do this is to create fake
>>packages at the two intervening directory levels:
>>
>> FOO/FOO.pm
>> FOO/DDNS/DDNS.pm
>
>
> MakeMaker will only recurse one subdirectory deep, so it won't make the jump
> from ./Makefile.PL to FOO/DDNS/Exceptions/Makefile.PL on it's own. Whether
> or not this is the right thing, I dunno, but the work around is to simply
> place a Makefile.PL in each intervening subdirectory (so one in FOO/ and one
> in FOO/DDNS/) which calls ExtUtils::MakeMaker::WriteEmptyMakefile(). That
> way, there will be a Makefile in each subdirectory it has to walk down
> through.
I'm using the following approach (which doesn't seem to work on win32):
#XXX: dunno why but win32 fails because of this:
#cd docs/api/mod_perl-2.0 && nmake all ...
#NMAKE : fatal error U1073: don't know how to make 'all'
#Stop.
#NMAKE : fatal error U1077: 'cd' : return code '0x2'
#Stop.
my @remote_makefile_dirs = WIN32() ? () :
qw(docs/api/mod_perl-2.0);
ModPerl::MM::WriteMakefile(
...,
DIR => get_dirs_with_makefile(@remote_makefile_dirs),
...,
);
# by default only Makefile.PL's in the first level sub-dirs are
# discovered. If you want to reach a Makefile.PL's in some remote
# directories, pass them to this function.
sub get_dirs_with_makefile {
my @remove_makefile_dirs = @_;
my %mf_dirs = ();
# since we cannot override MM::init_dirscan, but at the same time
# want to change $self->{DIR}, we have to reproduce
# MM::init_dirscan's section on setting DIR
for my $dir (@remote_makefile_dirs,
grep {-d} DirHandle->new(curdir())->read) {
next if curdir() eq $dir || updir() eq $dir;
next if -l $dir; # no symlinks per MakeMaker
$mf_dirs{$dir}++ if -f catfile($dir, "Makefile.PL");
}
return [sort keys %mf_dirs];
}
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com