1docs::api::ModPerl::MM(U3s)er Contributed Perl Documentatdioocns::api::ModPerl::MM(3)
2
3
4

NAME

6       ModPerl::MM -- A "subclass" of ExtUtils::MakeMaker for mod_perl 2.0
7

Synopsis

9         use ModPerl::MM;
10
11         # ModPerl::MM takes care of doing all the dirty job of overriding
12         ModPerl::MM::WriteMakefile(...);
13
14         # if there is a need to extend the default methods
15         sub MY::constants {
16             my $self = shift;
17             $self->ModPerl::MM::MY::constants;
18             # do something else;
19         }
20
21         # or prevent overriding completely
22         sub MY::constants { shift->MM::constants(@_); }";
23
24         # override the default value of WriteMakefile's attribute
25         my $extra_inc = "/foo/include";
26         ModPerl::MM::WriteMakefile(
27             ...
28             INC => $extra_inc,
29             ...
30         );
31
32         # extend the default value of WriteMakefile's attribute
33         my $extra_inc = "/foo/include";
34         ModPerl::MM::WriteMakefile(
35             ...
36             INC => join " ", $extra_inc, ModPerl::MM::get_def_opt('INC'),
37             ...
38         );
39

Description

41       "ModPerl::MM" is a "subclass" of "ExtUtils::MakeMaker" for mod_perl
42       2.0, to a degree of sub-classability of "ExtUtils::MakeMaker".
43
44       When "ModPerl::MM::WriteMakefile()" is used instead of "ExtUtils::Make‐
45       Maker::WriteMakefile()", "ModPerl::MM" overrides several "ExtU‐
46       tils::MakeMaker" methods behind the scenes and supplies default
47       "WriteMakefile()" arguments adjusted for mod_perl 2.0 build. It's writ‐
48       ten in such a way so that normally 3rd party module developers for
49       mod_perl 2.0, don't need to mess with Makefile.PL at all.
50

"MY::" Default Methods

52       "ModPerl::MM" overrides method foo as long as Makefile.PL hasn't
53       already specified a method MY::foo. If the latter happens, "Mod‐
54       Perl::MM" will DWIM and do nothing.
55
56       In case the functionality of "ModPerl::MM" methods needs to be
57       extended, rather than completely overriden, the "ModPerl::MM" methods
58       can be called internally. For example if you need to modify constants
59       in addition to the modifications applied by "ModPerl::MM::MY::con‐
60       stants", call the "ModPerl::MM::MY::constants" method (notice that it
61       resides in the package "ModPerl::MM::MY" and not "ModPerl::MM"), then
62       do your extra manipulations on constants:
63
64         # if there is a need to extend the methods
65         sub MY::constants {
66             my $self = shift;
67             $self->ModPerl::MM::MY::constants;
68             # do something else;
69         }
70
71       In certain cases a developers may want to prevent from "ModPerl::MM" to
72       override certain methods. In that case an explicit override in Make‐
73       file.PL will do the job. For example if you don't want the "con‐
74       stants()" method to be overriden by "ModPerl::MM", add to your Make‐
75       file.PL:
76
77         sub MY::constants { shift->MM::constants(@_); }";
78
79       "ModPerl::MM" overrides the following methods:
80
81       "ModPerl::MM::MY::post_initialize"
82
83       This method is deprecated.
84

"WriteMakefile()" Default Arguments

86       "ModPerl::MM::WriteMakefile" supplies default arguments such as "INC"
87       and "TYPEMAPS" unless they weren't passed to "ModPerl::MM::WriteMake‐
88       file" from Makefile.PL.
89
90       If the default values aren't satisfying these should be overriden in
91       Makefile.PL. For example to supply an empty INC, explicitly set the
92       argument in Makefile.PL.
93
94         ModPerl::MM::WriteMakefile(
95             ...
96             INC => '',
97             ...
98         );
99
100       If instead of fully overriding the default arguments, you want to
101       extend or modify them, they can be retrieved using the "Mod‐
102       Perl::MM::get_def_opt()" function. The following example appends an
103       extra value to the default "INC" attribute:
104
105         my $extra_inc = "/foo/include";
106         ModPerl::MM::WriteMakefile(
107             ...
108             INC => join " ", $extra_inc, ModPerl::MM::get_def_opt('INC'),
109             ...
110         );
111
112       "ModPerl::MM" supplies default values for the following "Mod‐
113       Perl::MM::WriteMakefile" attributes:
114
115       "CCFLAGS"
116
117       "LIBS"
118
119       "INC"
120
121       "OPTIMIZE"
122
123       "LDDLFLAGS"
124
125       "TYPEMAPS"
126
127       "dynamic_lib"
128
129       "OTHERLDFLAGS"
130
131         dynamic_lib => { OTHERLDFLAGS => ... }
132
133       "macro"
134
135       "MOD_INSTALL"
136
137         macro => { MOD_INSTALL => ... }
138
139       makes sure that Apache-Test/ is added to @INC.
140

Public API

142       The following functions are a part of the public API. They are
143       described elsewhere in this document.
144
145       "WriteMakefile()"
146
147         ModPerl::MM::WriteMakefile(...);
148
149       "get_def_opt()"
150
151         my $def_val = ModPerl::MM::get_def_opt($key);
152
153
154
155perl v5.8.8                       2006-11-19         docs::api::ModPerl::MM(3)
Impressum