=head1 NAME
ModPerl::MM -- A "subclass" of ExtUtils::MakeMaker for mod_perl 2.0
=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 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 $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 is a "subclass" of C for mod_perl
2.0, to a degree of sub-classability of C.
When C is used instead of
C, C overrides
several C methods behind the scenes and supplies
default C 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 at
all.
=head1 C Default Methods
C overrides method I as long as I
hasn't already specified a method I. If the latter happens,
C will DWIM and do nothing.
In case the functionality of C methods needs to be
extended, rather than completely overriden, the C methods
can be called internally. For example if you need to modify constants
in addition to the modifications applied by
C, call the C
method (notice that it resides in the package C and
not C), 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 C
to override certain methods. In that case an explicit override in
I will do the job. For example if you don't want the
C method to be overriden by C, add to your
I:
sub MY::constants { shift->MM::constants(@_); }";
C overrides the following methods:
=head2 C
This method is deprecated.
=head1 C Default Arguments
C supplies default arguments such as
C and C unless they weren't passed to
C from I.
If the default values aren't satisfying these should be overriden in
I. For example to supply an empty INC, explicitly set the
argument in I.
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 function. The following example appends
an extra value to the default C attribute:
my $extra_inc = "/foo/include";
ModPerl::MM::WriteMakefile(
...
INC => join " ", $extra_inc, ModPerl::MM::get_def_opt('INC'),
...
);
C supplies default values for the following
C attributes:
=head2 C
=head2 C
=head2 C
=head2 C
=head2 C
=head2 C
=head2 C
=head3 C
dynamic_lib => { OTHERLDFLAGS => ... }
=head2 C
=head3 C
macro => { MOD_INSTALL => ... }
makes sure that Apache-Test/ is added to @INC.
=head1 Public API
The following functions are a part of the public API. They are
described elsewhere in this document.
=head2 C
ModPerl::MM::WriteMakefile(...);
=head2 C
my $def_val = ModPerl::MM::get_def_opt($key);
=cut