stas 2003/03/23 22:02:59
Modified: src/docs/2.0/api/ModPerl MM.pod Log: bring the docs up-to-date with the recent additions to ModPerl::MM Revision Changes Path 1.2 +92 -9 modperl-docs/src/docs/2.0/api/ModPerl/MM.pod Index: MM.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/ModPerl/MM.pod,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MM.pod 22 Mar 2003 08:20:30 -0000 1.1 +++ MM.pod 24 Mar 2003 06:02:59 -0000 1.2 @@ -2,33 +2,53 @@ ModPerl::MM -- A "subclass" of ExtUtils::MakeMaker for mod_perl 2.0 -=head1 SYNOPSIS +=head1 Synopsis use 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 methods + # 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 + # or prevent overriding completely sub MY::constants { shift->MM::constants(@_); }"; -=head1 DESCRIPTION + # override the default value of WriteMakefile's attribute + my $extra_inc = "/foo/include"; + ModPerl::MM::WriteMakefile( + ... + INC => $extra_inc, + ... + ); + + # extend the default value of WriteMakefile's attribute + my $extra_inc = "/foo/include"; + ModPerl::MM::WriteMakefile( + ... + INC => join " ", $extra_inc, ModPerl::MM::get_def_opt('INC'), + ... + ); + +=head1 Description C<ModPerl::MM> is a "subclass" of C<ExtUtils::MakeMaker> for mod_perl 2.0, to a degree of sub-classability of C<ExtUtils::MakeMaker>. When C<ModPerl::MM::WriteMakefile()> is used instead of C<ExtUtils::MakeMaker::WriteMakefile()>, C<ModPerl::MM> overrides -several C<ExtUtils::MakeMaker> methods behind the scenes. So in most -cases 3rd party module developers for mod_perl 2.0, don't need to mess -with I<Makefile.PL> at all. +several C<ExtUtils::MakeMaker> methods behind the scenes and supplies +default C<WriteMakefile()> arguments adjusted for mod_perl 2.0 +build. It's written in such a way so that normally 3rd party module +developers for mod_perl 2.0, don't need to mess with I<Makefile.PL> at +all. + +=head1 C<MY::> Default Methods C<ModPerl::MM> overrides method I<foo> as long as I<Makefile.PL> hasn't already specified a method I<MY::foo>. If the latter happens, @@ -57,8 +77,6 @@ sub MY::constants { shift->MM::constants(@_); }"; -=head1 OVERRIDEN METHODS - C<ModPerl::MM> overrides the following methods: =head2 C<ModPerl::MM::MY::constants> @@ -72,5 +90,70 @@ This method makes sure that everything gets installed relative to the C<Apache2/> subdir if C<MP_INST_APACHE2=1> was used to build mod_perl 2.0. + +=head1 C<WriteMakefile()> Default Arguments + +C<ModPerl::MM::WriteMakefile> supplies default arguments such as +C<INC> and C<TYPEMAPS> unless they weren't passed to +C<ModPerl::MM::WriteMakefile> from I<Makefile.PL>. + +If the default values aren't satisfying these should be overriden in +I<Makefile.PL>. For example to supply an empty INC, explicitly set the +argument in I<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 +C<ModPerl::MM::get_def_opt()> function. The following example appends +an extra value to the default C<INC> attribute: + + my $extra_inc = "/foo/include"; + ModPerl::MM::WriteMakefile( + ... + INC => join " ", $extra_inc, ModPerl::MM::get_def_opt('INC'), + ... + ); + +C<ModPerl::MM> supplies default values for the following +C<ModPerl::MM::WriteMakefile> attributes: + +=head2 C<CCFLAGS> + + +=head2 C<LIBS> + + +=head2 C<INC> + + +=head2 C<OPTIMIZE> + + +=head2 C<LDDLFLAGS> + + +=head2 C<TYPEMAPS> + + +=head2 C<OTHERLDFLAGS> + + +=head1 Public API + +The following functions are a part of the public API. They are +described elsewhere in this document. + +=head2 C<WriteMakefile()> + + ModPerl::MM::WriteMakefile(...); + +=head2 C<get_def_opt()> + + my $def_val = ModPerl::MM::get_def_opt($key); =cut