OK, I've refurbished ModPerl::MM to work with 3rd party modules. It's explained in
http://perl.apache.org/docs/2.0/api/ModPerl/MM.html

The punch line is that most 3rd party Apache:: modules's Makefile.PL will look as simple as:

    require ModPerl::MM;
    ModPerl::MM::WriteMakefile(
        NAME => "Apache::Peek",
        VERSION_FROM => "Peek.pm",
    );

no matter if they use XS or not. Of course more code will needed if the same Makefile.PL has to support mod_perl 1.0 as well.

The only thing that troubles me is the automagical overriding of MY:: methods behind the scenes. If you remember I've first used B::Deparse and later have resorted to a much more robust solution, overriding ExtUtils::MakeMaker::mv_all_methods, which is cool for building mod_perl itself, since if in the future ExtUtils::MakeMaker changes force us to change things, it's all under our control. This is not the case with 3rd party modules.

The drawback of not-using this solution is that all 3rd party Makefile.PL will have to manually assign the overrides. e.g.:

    require ModPerl::MM;
    ModPerl::MM::WriteMakefile(
        NAME => "Apache::Peek",
        VERSION_FROM => "Peek.pm",
    );
    *MY::constants = \&ModPerl::MM::MY::constants;
    *MY::post_initialize = \&ModPerl::MM::MY::post_initialize;

also if in the future we supply more default overrides, the 3rd party modules Makefile.PLs will have to be fixed. Using the overriding behind the scenes they won't need to be touched.

If I knew that ExtUtils::MakeMaker::mv_all_methods will stay as it is, that won't be an issue.

One more note. Is that a good name for an api: ModPerl::MM::get_def_opt? See the manpage URL for details.

p.s. Of course you need the very latest cvs version to have this functionality.

Your comments are very appreciated

__________________________________________________________________
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


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



Reply via email to