NAME
ModPerl::MM - A "subclass" of ExtUtils::MakeMaker for modperl 2.0
SSyynnooppssiissuse ModPerl::MM;
# ModPerl::MM takes care of doing all the dirty job of overriding
ModPerl::MM::WriteMakefile(...);
# if there is a need to extend the default methods
sub MY::constants {my $self = shift;
$self->ModPerl::MM::MY::constants;
# do something else;
}# or prevent overriding completely
sub MY::constants { shift->MM::constants(@); }";
# override the default value of WriteMakefile's attribute
my $extrainc = "/foo/include";
ModPerl::MM::WriteMakefile(
...INC => $extrainc,
... );# extend the default value of WriteMakefile's attribute
my $extrainc = "/foo/include";
ModPerl::MM::WriteMakefile(
...INC => join " ", $extrainc, ModPerl::MM::getdefopt('INC'),
... ); DDeessccrriippttiioonn"ModPerl::MM" is a "subclass" of "ExtUtils::MakeMaker" for modperl
2.0, to a degree of sub-classability of "ExtUtils::MakeMaker".
When "ModPerl::MM::WriteMakefile()" is used instead of
"ExtUtils::MakeMaker::WriteMakefile()", "ModPerl::MM" overrides several
"ExtUtils::MakeMaker" methods behind the scenes and supplies default "WriteMakefile()" arguments adjusted for modperl 2.0 build. It's written in such a way so that normally 3rd party module developers for modperl 2.0, don't need to mess with Makefile.PL at all. "MY::" Default Methods"ModPerl::MM" overrides method foo as long as Makefile.PL hasn't
already specified a method MY::foo. If the latter happens,"ModPerl::MM" will DWIM and do nothing.
In case the functionality of "ModPerl::MM" methods needs to be
extended, rather than completely overriden, the "ModPerl::MM" methods
can be called internally. For example if you need to modify constants in addition to the modifications applied by"ModPerl::MM::MY::constants", call the "ModPerl::MM::MY::constants"
method (notice that it resides in the package "ModPerl::MM::MY" and not
"ModPerl::MM"), then do your extra manipulations on constants:
# if there is a need to extend the methods
sub MY::constants {my $self = shift;
$self->ModPerl::MM::MY::constants;
# do something else;
}In certain cases a developers may want to prevent from "ModPerl::MM" to
override certain methods. In that case an explicit override in Makefile.PL will do the job. For example if you don't want the"constants()" method to be overriden by "ModPerl::MM", add to your
Makefile.PL:sub MY::constants { shift->MM::constants(@); }";
"ModPerl::MM" overrides the following methods:
""MMooddPPeerrll::::MMMM::::MMYY::::ppoossttiinniittiiaalliizzee"" This method is deprecated. ""WWrriitteeMMaakkeeffiillee(())"" DDeeffaauulltt AArrgguummeennttss"ModPerl::MM::WriteMakefile" supplies default arguments such as "INC"
and "TYPEMAPS" unless they weren't passed to"ModPerl::MM::WriteMakefile" from Makefile.PL.
If the default values aren't satisfying these should be overriden in Makefile.PL. For example to supply an empty INC, explicitly set the argument in Makefile.PL.ModPerl::MM::WriteMakefile(
... INC => '', ... ); If instead of fully overriding the default arguments, you want to extend or modify them, they can be retrieved using the"ModPerl::MM::getdefopt()" function. The following example appends an
extra value to the default "INC" attribute:my $extrainc = "/foo/include";
ModPerl::MM::WriteMakefile(
...INC => join " ", $extrainc, ModPerl::MM::getdefopt('INC'),
... );"ModPerl::MM" supplies default values for the following
"ModPerl::MM::WriteMakefile" attributes:
""CCCCFFLLAAGGSS"" ""LLIIBBSS"" ""IINNCC"" ""OOPPTTIIMMIIZZEE"" ""LLDDDDLLFFLLAAGGSS"" ""TTYYPPEEMMAAPPSS"" ""ddyynnaammiicclliibb"" "OTHERLDFLAGS" dynamiclib => { OTHERLDFLAGS => ... } ""mmaaccrroo"" "MODINSTALL" macro => { MODINSTALL => ... }makes sure that Apache-Test/ is added to @INC.
PPuubblliicc AAPPII The following functions are a part of the public API. They are described elsewhere in this document. ""WWrriitteeMMaakkeeffiillee(())""ModPerl::MM::WriteMakefile(...);
""ggeettddeeffoopptt(())""my $defval = ModPerl::MM::getdefopt($key);
perl v5.8.8 apachemodperl-101.1~220:0:5m-o1d0-p2e0rl-2.0.2::docs::api::ModPerl::MM(3)