Andy Armstrong wrote:
> I have a module[1] that builds a bundled library that has source in a
> top level directory and a subdirectory.
> 
> For the current release I've dumped a Makefile.PL in the bundled
> library's root that invokes its configure script and then adds a 'test'
> target to the generated Makefile.

I contemplated just this problem for Alien::SVN which does nothing but build a
bundled Subversion library.  The necessary hoops you have to jump through to
override enough of MakeMaker to do this are absurd.  You'll spend most of your
time fighting MakeMaker.

OTOH, Module::Build is easily overridable with its ACTION_foo() methods.
Getting it to do what you want by overriding the code, test and install
targets is relatively straight forward.

See
http://search.cpan.org/src/MSCHWERN/Alien-SVN-1.4.5.2/inc/My/SVN/Builder.pm
for an example.

Most of the complication in that code comes from trying to make the Subversion
source do something it normally doesn't want to do.  Also that it has to call
a Makefile.PL inside Subversion.

One mistake that's still in that code is by completely overriding the test and
install actions I broke their dependency code.  Both ACTION_test and
ACTION_install should have a $self->depends_on('code') first thing.


-- 
Insulting our readers is part of our business model.
        http://somethingpositive.net/sp07122005.shtml

Reply via email to