Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / ExtUtils / MakeMaker.html
bloba95fa4201f7218335cd372874439b23f69d3d47b
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>ExtUtils::MakeMaker - Create a module Makefile</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;ExtUtils::MakeMaker - Create a module Makefile</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#synopsis">SYNOPSIS</a></li>
24 <li><a href="#description">DESCRIPTION</a></li>
25 <ul>
27 <li><a href="#how_to_write_a_makefile_pl">How To Write A Makefile.PL</a></li>
28 <li><a href="#default_makefile_behaviour">Default Makefile Behaviour</a></li>
29 <li><a href="#make_test">make test</a></li>
30 <li><a href="#make_testdb">make testdb</a></li>
31 <li><a href="#make_install">make install</a></li>
32 <li><a href="#prefix_and_lib_attribute">PREFIX and LIB attribute</a></li>
33 <li><a href="#afs_users">AFS users</a></li>
34 <li><a href="#static_linking_of_a_new_perl_binary">Static Linking of a new Perl Binary</a></li>
35 <li><a href="#determination_of_perl_library_and_installation_locations">Determination of Perl Library and Installation Locations</a></li>
36 <li><a href="#which_architecture_dependent_directory">Which architecture dependent directory?</a></li>
37 <li><a href="#using_attributes_and_parameters">Using Attributes and Parameters</a></li>
38 <li><a href="#additional_lowercase_attributes">Additional lowercase attributes</a></li>
39 <li><a href="#overriding_makemaker_methods">Overriding MakeMaker Methods</a></li>
40 <li><a href="#the_end_of_cargo_cult_programming">The End Of Cargo Cult Programming</a></li>
41 <li><a href="#hintsfile_support">Hintsfile support</a></li>
42 <li><a href="#distribution_support">Distribution Support</a></li>
43 <li><a href="#module_metadata">Module Meta-Data</a></li>
44 <li><a href="#disabling_an_extension">Disabling an extension</a></li>
45 <li><a href="#other_handy_functions">Other Handy Functions</a></li>
46 </ul>
48 <li><a href="#environment">ENVIRONMENT</a></li>
49 <li><a href="#see_also">SEE ALSO</a></li>
50 <li><a href="#authors">AUTHORS</a></li>
51 <li><a href="#license">LICENSE</a></li>
52 </ul>
53 <!-- INDEX END -->
55 <hr />
56 <p>
57 </p>
58 <h1><a name="name">NAME</a></h1>
59 <p>ExtUtils::MakeMaker - Create a module Makefile</p>
60 <p>
61 </p>
62 <hr />
63 <h1><a name="synopsis">SYNOPSIS</a></h1>
64 <pre>
65 use ExtUtils::MakeMaker;</pre>
66 <pre>
67 WriteMakefile( ATTRIBUTE =&gt; VALUE [, ...] );</pre>
68 <p>
69 </p>
70 <hr />
71 <h1><a name="description">DESCRIPTION</a></h1>
72 <p>This utility is designed to write a Makefile for an extension module
73 from a Makefile.PL. It is based on the Makefile.SH model provided by
74 Andy Dougherty and the perl5-porters.</p>
75 <p>It splits the task of generating the Makefile into several subroutines
76 that can be individually overridden. Each subroutine returns the text
77 it wishes to have written to the Makefile.</p>
78 <p>MakeMaker is object oriented. Each directory below the current
79 directory that contains a Makefile.PL is treated as a separate
80 object. This makes it possible to write an unlimited number of
81 Makefiles with a single invocation of WriteMakefile().</p>
82 <p>
83 </p>
84 <h2><a name="how_to_write_a_makefile_pl">How To Write A Makefile.PL</a></h2>
85 <p>See ExtUtils::MakeMaker::Tutorial.</p>
86 <p>The long answer is the rest of the manpage :-)</p>
87 <p>
88 </p>
89 <h2><a name="default_makefile_behaviour">Default Makefile Behaviour</a></h2>
90 <p>The generated Makefile enables the user of the extension to invoke</p>
91 <pre>
92 perl Makefile.PL # optionally &quot;perl Makefile.PL verbose&quot;
93 make
94 make test # optionally set TEST_VERBOSE=1
95 make install # See below</pre>
96 <p>The Makefile to be produced may be altered by adding arguments of the
97 form <code>KEY=VALUE</code>. E.g.</p>
98 <pre>
99 perl Makefile.PL PREFIX=~</pre>
100 <p>Other interesting targets in the generated Makefile are</p>
101 <pre>
102 make config # to check if the Makefile is up-to-date
103 make clean # delete local temp files (Makefile gets renamed)
104 make realclean # delete derived files (including ./blib)
105 make ci # check in all the files in the MANIFEST file
106 make dist # see below the Distribution Support section</pre>
108 </p>
109 <h2><a name="make_test">make test</a></h2>
110 <p>MakeMaker checks for the existence of a file named <em>test.pl</em> in the
111 current directory and if it exists it execute the script with the
112 proper set of perl <code>-I</code> options.</p>
113 <p>MakeMaker also checks for any files matching glob(``t/*.t''). It will
114 execute all matching files in alphabetical order via the
115 <a href="file://C|\msysgit\mingw\html/lib/Test/Harness.html">the Test::Harness manpage</a> module with the <code>-I</code> switches set correctly.</p>
116 <p>If you'd like to see the raw output of your tests, set the
117 <code>TEST_VERBOSE</code> variable to true.</p>
118 <pre>
119 make test TEST_VERBOSE=1</pre>
121 </p>
122 <h2><a name="make_testdb">make testdb</a></h2>
123 <p>A useful variation of the above is the target <code>testdb</code>. It runs the
124 test under the Perl debugger (see <a href="file://C|\msysgit\mingw\html/pod/perldebug.html">the perldebug manpage</a>). If the file
125 <em>test.pl</em> exists in the current directory, it is used for the test.</p>
126 <p>If you want to debug some other testfile, set the <code>TEST_FILE</code> variable
127 thusly:</p>
128 <pre>
129 make testdb TEST_FILE=t/mytest.t</pre>
130 <p>By default the debugger is called using <code>-d</code> option to perl. If you
131 want to specify some other option, set the <code>TESTDB_SW</code> variable:</p>
132 <pre>
133 make testdb TESTDB_SW=-Dx</pre>
135 </p>
136 <h2><a name="make_install">make install</a></h2>
137 <p>make alone puts all relevant files into directories that are named by
138 the macros INST_LIB, INST_ARCHLIB, INST_SCRIPT, INST_MAN1DIR and
139 INST_MAN3DIR. All these default to something below ./blib if you are
140 <em>not</em> building below the perl source directory. If you <em>are</em>
141 building below the perl source, INST_LIB and INST_ARCHLIB default to
142 ../../lib, and INST_SCRIPT is not defined.</p>
143 <p>The <em>install</em> target of the generated Makefile copies the files found
144 below each of the INST_* directories to their INSTALL*
145 counterparts. Which counterparts are chosen depends on the setting of
146 INSTALLDIRS according to the following table:</p>
147 <pre>
148 INSTALLDIRS set to
149 perl site vendor</pre>
150 <pre>
151 PERLPREFIX SITEPREFIX VENDORPREFIX
152 INST_ARCHLIB INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH
153 INST_LIB INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB
154 INST_BIN INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN
155 INST_SCRIPT INSTALLSCRIPT INSTALLSCRIPT INSTALLSCRIPT
156 INST_MAN1DIR INSTALLMAN1DIR INSTALLSITEMAN1DIR INSTALLVENDORMAN1DIR
157 INST_MAN3DIR INSTALLMAN3DIR INSTALLSITEMAN3DIR INSTALLVENDORMAN3DIR</pre>
158 <p>The INSTALL... macros in turn default to their %Config
159 ($Config{installprivlib}, $Config{installarchlib}, etc.) counterparts.</p>
160 <p>You can check the values of these variables on your system with</p>
161 <pre>
162 perl '-V:install.*'</pre>
163 <p>And to check the sequence in which the library directories are
164 searched by perl, run</p>
165 <pre>
166 perl -le 'print join $/, @INC'</pre>
167 <p>Sometimes older versions of the module you're installing live in other
168 directories in @INC. Because Perl loads the first version of a module it
169 finds, not the newest, you might accidentally get one of these older
170 versions even after installing a brand new version. To delete <em>all other
171 versions of the module you're installing</em> (not simply older ones) set the
172 <code>UNINST</code> variable.</p>
173 <pre>
174 make install UNINST=1</pre>
176 </p>
177 <h2><a name="prefix_and_lib_attribute">PREFIX and LIB attribute</a></h2>
178 <p>PREFIX and LIB can be used to set several INSTALL* attributes in one
179 go. The quickest way to install a module in a non-standard place might
180 be</p>
181 <pre>
182 perl Makefile.PL PREFIX=~</pre>
183 <p>This will install all files in the module under your home directory,
184 with man pages and libraries going into an appropriate place (usually
185 ~/man and ~/lib).</p>
186 <p>Another way to specify many INSTALL directories with a single
187 parameter is LIB.</p>
188 <pre>
189 perl Makefile.PL LIB=~/lib</pre>
190 <p>This will install the module's architecture-independent files into
191 ~/lib, the architecture-dependent files into ~/lib/$archname.</p>
192 <p>Note, that in both cases the tilde expansion is done by MakeMaker, not
193 by perl by default, nor by make.</p>
194 <p>Conflicts between parameters LIB, PREFIX and the various INSTALL*
195 arguments are resolved so that:</p>
196 <ul>
197 <li>
198 <p>setting LIB overrides any setting of INSTALLPRIVLIB, INSTALLARCHLIB,
199 INSTALLSITELIB, INSTALLSITEARCH (and they are not affected by PREFIX);</p>
200 </li>
201 <li>
202 <p>without LIB, setting PREFIX replaces the initial <code>$Config{prefix}</code>
203 part of those INSTALL* arguments, even if the latter are explicitly
204 set (but are set to still start with <code>$Config{prefix}</code>).</p>
205 </li>
206 </ul>
207 <p>If the user has superuser privileges, and is not working on AFS or
208 relatives, then the defaults for INSTALLPRIVLIB, INSTALLARCHLIB,
209 INSTALLSCRIPT, etc. will be appropriate, and this incantation will be
210 the best:</p>
211 <pre>
212 perl Makefile.PL;
213 make;
214 make test
215 make install</pre>
216 <p>make install per default writes some documentation of what has been
217 done into the file <code>$(INSTALLARCHLIB)/perllocal.pod</code>. This feature
218 can be bypassed by calling make pure_install.</p>
220 </p>
221 <h2><a name="afs_users">AFS users</a></h2>
222 <p>will have to specify the installation directories as these most
223 probably have changed since perl itself has been installed. They will
224 have to do this by calling</p>
225 <pre>
226 perl Makefile.PL INSTALLSITELIB=/afs/here/today \
227 INSTALLSCRIPT=/afs/there/now INSTALLMAN3DIR=/afs/for/manpages
228 make</pre>
229 <p>Be careful to repeat this procedure every time you recompile an
230 extension, unless you are sure the AFS installation directories are
231 still valid.</p>
233 </p>
234 <h2><a name="static_linking_of_a_new_perl_binary">Static Linking of a new Perl Binary</a></h2>
235 <p>An extension that is built with the above steps is ready to use on
236 systems supporting dynamic loading. On systems that do not support
237 dynamic loading, any newly created extension has to be linked together
238 with the available resources. MakeMaker supports the linking process
239 by creating appropriate targets in the Makefile whenever an extension
240 is built. You can invoke the corresponding section of the makefile with</p>
241 <pre>
242 make perl</pre>
243 <p>That produces a new perl binary in the current directory with all
244 extensions linked in that can be found in INST_ARCHLIB, SITELIBEXP,
245 and PERL_ARCHLIB. To do that, MakeMaker writes a new Makefile, on
246 UNIX, this is called Makefile.aperl (may be system dependent). If you
247 want to force the creation of a new perl, it is recommended, that you
248 delete this Makefile.aperl, so the directories are searched-through
249 for linkable libraries again.</p>
250 <p>The binary can be installed into the directory where perl normally
251 resides on your machine with</p>
252 <pre>
253 make inst_perl</pre>
254 <p>To produce a perl binary with a different name than <code>perl</code>, either say</p>
255 <pre>
256 perl Makefile.PL MAP_TARGET=myperl
257 make myperl
258 make inst_perl</pre>
259 <p>or say</p>
260 <pre>
261 perl Makefile.PL
262 make myperl MAP_TARGET=myperl
263 make inst_perl MAP_TARGET=myperl</pre>
264 <p>In any case you will be prompted with the correct invocation of the
265 <code>inst_perl</code> target that installs the new binary into INSTALLBIN.</p>
266 <p>make inst_perl per default writes some documentation of what has been
267 done into the file <code>$(INSTALLARCHLIB)/perllocal.pod</code>. This
268 can be bypassed by calling make pure_inst_perl.</p>
269 <p>Warning: the inst_perl: target will most probably overwrite your
270 existing perl binary. Use with care!</p>
271 <p>Sometimes you might want to build a statically linked perl although
272 your system supports dynamic loading. In this case you may explicitly
273 set the linktype with the invocation of the Makefile.PL or make:</p>
274 <pre>
275 perl Makefile.PL LINKTYPE=static # recommended</pre>
276 <p>or</p>
277 <pre>
278 make LINKTYPE=static # works on most systems</pre>
280 </p>
281 <h2><a name="determination_of_perl_library_and_installation_locations">Determination of Perl Library and Installation Locations</a></h2>
282 <p>MakeMaker needs to know, or to guess, where certain things are
283 located. Especially INST_LIB and INST_ARCHLIB (where to put the files
284 during the <code>make(1)</code> run), PERL_LIB and PERL_ARCHLIB (where to read
285 existing modules from), and PERL_INC (header files and <code>libperl*.*</code>).</p>
286 <p>Extensions may be built either using the contents of the perl source
287 directory tree or from the installed perl library. The recommended way
288 is to build extensions after you have run 'make install' on perl
289 itself. You can do that in any directory on your hard disk that is not
290 below the perl source tree. The support for extensions below the ext
291 directory of the perl distribution is only good for the standard
292 extensions that come with perl.</p>
293 <p>If an extension is being built below the <code>ext/</code> directory of the perl
294 source then MakeMaker will set PERL_SRC automatically (e.g.,
295 <code>../..</code>). If PERL_SRC is defined and the extension is recognized as
296 a standard extension, then other variables default to the following:</p>
297 <pre>
298 PERL_INC = PERL_SRC
299 PERL_LIB = PERL_SRC/lib
300 PERL_ARCHLIB = PERL_SRC/lib
301 INST_LIB = PERL_LIB
302 INST_ARCHLIB = PERL_ARCHLIB</pre>
303 <p>If an extension is being built away from the perl source then MakeMaker
304 will leave PERL_SRC undefined and default to using the installed copy
305 of the perl library. The other variables default to the following:</p>
306 <pre>
307 PERL_INC = $archlibexp/CORE
308 PERL_LIB = $privlibexp
309 PERL_ARCHLIB = $archlibexp
310 INST_LIB = ./blib/lib
311 INST_ARCHLIB = ./blib/arch</pre>
312 <p>If perl has not yet been installed then PERL_SRC can be defined on the
313 command line as shown in the previous section.</p>
315 </p>
316 <h2><a name="which_architecture_dependent_directory">Which architecture dependent directory?</a></h2>
317 <p>If you don't want to keep the defaults for the INSTALL* macros,
318 MakeMaker helps you to minimize the typing needed: the usual
319 relationship between INSTALLPRIVLIB and INSTALLARCHLIB is determined
320 by Configure at perl compilation time. MakeMaker supports the user who
321 sets INSTALLPRIVLIB. If INSTALLPRIVLIB is set, but INSTALLARCHLIB not,
322 then MakeMaker defaults the latter to be the same subdirectory of
323 INSTALLPRIVLIB as Configure decided for the counterparts in %Config ,
324 otherwise it defaults to INSTALLPRIVLIB. The same relationship holds
325 for INSTALLSITELIB and INSTALLSITEARCH.</p>
326 <p>MakeMaker gives you much more freedom than needed to configure
327 internal variables and get different results. It is worth to mention,
328 that <code>make(1)</code> also lets you configure most of the variables that are
329 used in the Makefile. But in the majority of situations this will not
330 be necessary, and should only be done if the author of a package
331 recommends it (or you know what you're doing).</p>
333 </p>
334 <h2><a name="using_attributes_and_parameters">Using Attributes and Parameters</a></h2>
335 <p>The following attributes may be specified as arguments to <code>WriteMakefile()</code>
336 or as NAME=VALUE pairs on the command line.</p>
337 <dl>
338 <dt><strong><a name="item_abstract">ABSTRACT</a></strong>
340 <dd>
341 <p>One line description of the module. Will be included in PPD file.</p>
342 </dd>
343 </li>
344 <dt><strong><a name="item_abstract_from">ABSTRACT_FROM</a></strong>
346 <dd>
347 <p>Name of the file that contains the package description. MakeMaker looks
348 for a line in the POD matching /^($package\s-\s)(.*)/. This is typically
349 the first line in the ``=head1 NAME'' section. $2 becomes the abstract.</p>
350 </dd>
351 </li>
352 <dt><strong><a name="item_author">AUTHOR</a></strong>
354 <dd>
355 <p>String containing name (and email address) of package author(s). Is used
356 in PPD (Perl Package Description) files for PPM (Perl Package Manager).</p>
357 </dd>
358 </li>
359 <dt><strong><a name="item_binary_location">BINARY_LOCATION</a></strong>
361 <dd>
362 <p>Used when creating PPD files for binary packages. It can be set to a
363 full or relative path or URL to the binary archive for a particular
364 architecture. For example:</p>
365 </dd>
366 <dd>
367 <pre>
368 perl Makefile.PL BINARY_LOCATION=x86/Agent.tar.gz</pre>
369 </dd>
370 <dd>
371 <p>builds a PPD package that references a binary of the <code>Agent</code> package,
372 located in the <code>x86</code> directory relative to the PPD itself.</p>
373 </dd>
374 </li>
375 <dt><strong><a name="item_c">C</a></strong>
377 <dd>
378 <p>Ref to array of *.c file names. Initialised from a directory scan
379 and the values portion of the XS attribute hash. This is not
380 currently used by MakeMaker but may be handy in Makefile.PLs.</p>
381 </dd>
382 </li>
383 <dt><strong><a name="item_ccflags">CCFLAGS</a></strong>
385 <dd>
386 <p>String that will be included in the compiler call command line between
387 the arguments INC and OPTIMIZE.</p>
388 </dd>
389 </li>
390 <dt><strong><a name="item_config">CONFIG</a></strong>
392 <dd>
393 <p>Arrayref. E.g. [qw(archname manext)] defines ARCHNAME &amp; MANEXT from
394 config.sh. MakeMaker will add to CONFIG the following values anyway:
397 cccdlflags
398 ccdlflags
399 dlext
400 dlsrc
402 lddlflags
403 ldflags
404 libc
405 lib_ext
406 obj_ext
407 ranlib
408 sitelibexp
409 sitearchexp
410 so</p>
411 </dd>
412 </li>
413 <dt><strong><a name="item_configure">CONFIGURE</a></strong>
415 <dd>
416 <p>CODE reference. The subroutine should return a hash reference. The
417 hash may contain further attributes, e.g. {LIBS =&gt; ...}, that have to
418 be determined by some evaluation method.</p>
419 </dd>
420 </li>
421 <dt><strong><a name="item_define">DEFINE</a></strong>
423 <dd>
424 <p>Something like <code>&quot;-DHAVE_UNISTD_H&quot;</code></p>
425 </dd>
426 </li>
427 <dt><strong><a name="item_destdir">DESTDIR</a></strong>
429 <dd>
430 <p>This is the root directory into which the code will be installed. It
431 <em>prepends itself to the normal prefix</em>. For example, if your code
432 would normally go into <em>/usr/local/lib/perl</em> you could set DESTDIR=~/tmp/
433 and installation would go into <em>~/tmp/usr/local/lib/perl</em>.</p>
434 </dd>
435 <dd>
436 <p>This is primarily of use for people who repackage Perl modules.</p>
437 </dd>
438 <dd>
439 <p>NOTE: Due to the nature of make, it is important that you put the trailing
440 slash on your DESTDIR. <em>~/tmp/</em> not <em>~/tmp</em>.</p>
441 </dd>
442 </li>
443 <dt><strong><a name="item_dir">DIR</a></strong>
445 <dd>
446 <p>Ref to array of subdirectories containing Makefile.PLs e.g. [ 'sdbm'
447 ] in ext/SDBM_File</p>
448 </dd>
449 </li>
450 <dt><strong><a name="item_distname">DISTNAME</a></strong>
452 <dd>
453 <p>A safe filename for the package.</p>
454 </dd>
455 <dd>
456 <p>Defaults to NAME above but with :: replaced with -.</p>
457 </dd>
458 <dd>
459 <p>For example, Foo::Bar becomes Foo-Bar.</p>
460 </dd>
461 </li>
462 <dt><strong><a name="item_distvname">DISTVNAME</a></strong>
464 <dd>
465 <p>Your name for distributing the package with the version number
466 included. This is used by 'make dist' to name the resulting archive
467 file.</p>
468 </dd>
469 <dd>
470 <p>Defaults to DISTNAME-VERSION.</p>
471 </dd>
472 <dd>
473 <p>For example, version 1.04 of Foo::Bar becomes Foo-Bar-1.04.</p>
474 </dd>
475 <dd>
476 <p>On some OS's where . has special meaning VERSION_SYM may be used in
477 place of VERSION.</p>
478 </dd>
479 </li>
480 <dt><strong><a name="item_dl_funcs">DL_FUNCS</a></strong>
482 <dd>
483 <p>Hashref of symbol names for routines to be made available as universal
484 symbols. Each key/value pair consists of the package name and an
485 array of routine names in that package. Used only under AIX, OS/2,
486 VMS and Win32 at present. The routine names supplied will be expanded
487 in the same way as XSUB names are expanded by the <a href="#item_xs"><code>XS()</code></a> macro.
488 Defaults to</p>
489 </dd>
490 <dd>
491 <pre>
492 {&quot;$(NAME)&quot; =&gt; [&quot;boot_$(NAME)&quot; ] }</pre>
493 </dd>
494 <dd>
495 <p>e.g.</p>
496 </dd>
497 <dd>
498 <pre>
499 {&quot;RPC&quot; =&gt; [qw( boot_rpcb rpcb_gettime getnetconfigent )],
500 &quot;NetconfigPtr&quot; =&gt; [ 'DESTROY'] }</pre>
501 </dd>
502 <dd>
503 <p>Please see the <a href="file://C|\msysgit\mingw\html/lib/ExtUtils/Mksymlists.html">the ExtUtils::Mksymlists manpage</a> documentation for more information
504 about the DL_FUNCS, DL_VARS and FUNCLIST attributes.</p>
505 </dd>
506 </li>
507 <dt><strong><a name="item_dl_vars">DL_VARS</a></strong>
509 <dd>
510 <p>Array of symbol names for variables to be made available as universal symbols.
511 Used only under AIX, OS/2, VMS and Win32 at present. Defaults to [].
512 (e.g. [ qw(Foo_version Foo_numstreams Foo_tree ) ])</p>
513 </dd>
514 </li>
515 <dt><strong><a name="item_exclude_ext">EXCLUDE_EXT</a></strong>
517 <dd>
518 <p>Array of extension names to exclude when doing a static build. This
519 is ignored if INCLUDE_EXT is present. Consult INCLUDE_EXT for more
520 details. (e.g. [ qw( Socket POSIX ) ] )</p>
521 </dd>
522 <dd>
523 <p>This attribute may be most useful when specified as a string on the
524 command line: perl Makefile.PL EXCLUDE_EXT='Socket Safe'</p>
525 </dd>
526 </li>
527 <dt><strong><a name="item_exe_files">EXE_FILES</a></strong>
529 <dd>
530 <p>Ref to array of executable files. The files will be copied to the
531 INST_SCRIPT directory. Make realclean will delete them from there
532 again.</p>
533 </dd>
534 <dd>
535 <p>If your executables start with something like #!perl or
536 #!/usr/bin/perl MakeMaker will change this to the path of the perl
537 'Makefile.PL' was invoked with so the programs will be sure to run
538 properly even if perl is not in /usr/bin/perl.</p>
539 </dd>
540 </li>
541 <dt><strong><a name="item_first_makefile">FIRST_MAKEFILE</a></strong>
543 <dd>
544 <p>The name of the Makefile to be produced. This is used for the second
545 Makefile that will be produced for the MAP_TARGET.</p>
546 </dd>
547 <dd>
548 <p>Defaults to 'Makefile' or 'Descrip.MMS' on VMS.</p>
549 </dd>
550 <dd>
551 <p>(Note: we couldn't use MAKEFILE because dmake uses this for something
552 else).</p>
553 </dd>
554 </li>
555 <dt><strong><a name="item_fullperl">FULLPERL</a></strong>
557 <dd>
558 <p>Perl binary able to run this extension, load XS modules, etc...</p>
559 </dd>
560 </li>
561 <dt><strong><a name="item_fullperlrun">FULLPERLRUN</a></strong>
563 <dd>
564 <p>Like PERLRUN, except it uses FULLPERL.</p>
565 </dd>
566 </li>
567 <dt><strong><a name="item_fullperlruninst">FULLPERLRUNINST</a></strong>
569 <dd>
570 <p>Like PERLRUNINST, except it uses FULLPERL.</p>
571 </dd>
572 </li>
573 <dt><strong><a name="item_funclist">FUNCLIST</a></strong>
575 <dd>
576 <p>This provides an alternate means to specify function names to be
577 exported from the extension. Its value is a reference to an
578 array of function names to be exported by the extension. These
579 names are passed through unaltered to the linker options file.</p>
580 </dd>
581 </li>
582 <dt><strong><a name="item_h">H</a></strong>
584 <dd>
585 <p>Ref to array of *.h file names. Similar to C.</p>
586 </dd>
587 </li>
588 <dt><strong><a name="item_imports">IMPORTS</a></strong>
590 <dd>
591 <p>This attribute is used to specify names to be imported into the
592 extension. Takes a hash ref.</p>
593 </dd>
594 <dd>
595 <p>It is only used on OS/2 and Win32.</p>
596 </dd>
597 </li>
598 <dt><strong><a name="item_inc">INC</a></strong>
600 <dd>
601 <p>Include file dirs eg: <code>&quot;-I/usr/5include -I/path/to/inc&quot;</code></p>
602 </dd>
603 </li>
604 <dt><strong><a name="item_include_ext">INCLUDE_EXT</a></strong>
606 <dd>
607 <p>Array of extension names to be included when doing a static build.
608 MakeMaker will normally build with all of the installed extensions when
609 doing a static build, and that is usually the desired behavior. If
610 INCLUDE_EXT is present then MakeMaker will build only with those extensions
611 which are explicitly mentioned. (e.g. [ qw( Socket POSIX ) ])</p>
612 </dd>
613 <dd>
614 <p>It is not necessary to mention DynaLoader or the current extension when
615 filling in INCLUDE_EXT. If the INCLUDE_EXT is mentioned but is empty then
616 only DynaLoader and the current extension will be included in the build.</p>
617 </dd>
618 <dd>
619 <p>This attribute may be most useful when specified as a string on the
620 command line: perl Makefile.PL INCLUDE_EXT='POSIX Socket Devel::Peek'</p>
621 </dd>
622 </li>
623 <dt><strong><a name="item_installarchlib">INSTALLARCHLIB</a></strong>
625 <dd>
626 <p>Used by 'make install', which copies files from INST_ARCHLIB to this
627 directory if INSTALLDIRS is set to perl.</p>
628 </dd>
629 </li>
630 <dt><strong><a name="item_installbin">INSTALLBIN</a></strong>
632 <dd>
633 <p>Directory to install binary files (e.g. tkperl) into if
634 INSTALLDIRS=perl.</p>
635 </dd>
636 </li>
637 <dt><strong><a name="item_installdirs">INSTALLDIRS</a></strong>
639 <dd>
640 <p>Determines which of the sets of installation directories to choose:
641 perl, site or vendor. Defaults to site.</p>
642 </dd>
643 </li>
644 <dt><strong><a name="item_installman1dir">INSTALLMAN1DIR</a></strong>
646 <dt><strong><a name="item_installman3dir">INSTALLMAN3DIR</a></strong>
648 <dd>
649 <p>These directories get the man pages at 'make install' time if
650 INSTALLDIRS=perl. Defaults to $Config{installman*dir}.</p>
651 </dd>
652 <dd>
653 <p>If set to 'none', no man pages will be installed.</p>
654 </dd>
655 </li>
656 <dt><strong><a name="item_installprivlib">INSTALLPRIVLIB</a></strong>
658 <dd>
659 <p>Used by 'make install', which copies files from INST_LIB to this
660 directory if INSTALLDIRS is set to perl.</p>
661 </dd>
662 <dd>
663 <p>Defaults to $Config{installprivlib}.</p>
664 </dd>
665 </li>
666 <dt><strong><a name="item_installscript">INSTALLSCRIPT</a></strong>
668 <dd>
669 <p>Used by 'make install' which copies files from INST_SCRIPT to this
670 directory.</p>
671 </dd>
672 </li>
673 <dt><strong><a name="item_installsitearch">INSTALLSITEARCH</a></strong>
675 <dd>
676 <p>Used by 'make install', which copies files from INST_ARCHLIB to this
677 directory if INSTALLDIRS is set to site (default).</p>
678 </dd>
679 </li>
680 <dt><strong><a name="item_installsitebin">INSTALLSITEBIN</a></strong>
682 <dd>
683 <p>Used by 'make install', which copies files from INST_BIN to this
684 directory if INSTALLDIRS is set to site (default).</p>
685 </dd>
686 </li>
687 <dt><strong><a name="item_installsitelib">INSTALLSITELIB</a></strong>
689 <dd>
690 <p>Used by 'make install', which copies files from INST_LIB to this
691 directory if INSTALLDIRS is set to site (default).</p>
692 </dd>
693 </li>
694 <dt><strong><a name="item_installsiteman1dir">INSTALLSITEMAN1DIR</a></strong>
696 <dt><strong><a name="item_installsiteman3dir">INSTALLSITEMAN3DIR</a></strong>
698 <dd>
699 <p>These directories get the man pages at 'make install' time if
700 INSTALLDIRS=site (default). Defaults to
701 $(SITEPREFIX)/man/man$(MAN*EXT).</p>
702 </dd>
703 <dd>
704 <p>If set to 'none', no man pages will be installed.</p>
705 </dd>
706 </li>
707 <dt><strong><a name="item_installvendorarch">INSTALLVENDORARCH</a></strong>
709 <dd>
710 <p>Used by 'make install', which copies files from INST_ARCHLIB to this
711 directory if INSTALLDIRS is set to vendor.</p>
712 </dd>
713 </li>
714 <dt><strong><a name="item_installvendorbin">INSTALLVENDORBIN</a></strong>
716 <dd>
717 <p>Used by 'make install', which copies files from INST_BIN to this
718 directory if INSTALLDIRS is set to vendor.</p>
719 </dd>
720 </li>
721 <dt><strong><a name="item_installvendorlib">INSTALLVENDORLIB</a></strong>
723 <dd>
724 <p>Used by 'make install', which copies files from INST_LIB to this
725 directory if INSTALLDIRS is set to vendor.</p>
726 </dd>
727 </li>
728 <dt><strong><a name="item_installvendorman1dir">INSTALLVENDORMAN1DIR</a></strong>
730 <dt><strong><a name="item_installvendorman3dir">INSTALLVENDORMAN3DIR</a></strong>
732 <dd>
733 <p>These directories get the man pages at 'make install' time if
734 INSTALLDIRS=vendor. Defaults to $(VENDORPREFIX)/man/man$(MAN*EXT).</p>
735 </dd>
736 <dd>
737 <p>If set to 'none', no man pages will be installed.</p>
738 </dd>
739 </li>
740 <dt><strong><a name="item_inst_archlib">INST_ARCHLIB</a></strong>
742 <dd>
743 <p>Same as INST_LIB for architecture dependent files.</p>
744 </dd>
745 </li>
746 <dt><strong><a name="item_inst_bin">INST_BIN</a></strong>
748 <dd>
749 <p>Directory to put real binary files during 'make'. These will be copied
750 to INSTALLBIN during 'make install'</p>
751 </dd>
752 </li>
753 <dt><strong><a name="item_inst_lib">INST_LIB</a></strong>
755 <dd>
756 <p>Directory where we put library files of this extension while building
757 it.</p>
758 </dd>
759 </li>
760 <dt><strong><a name="item_inst_man1dir">INST_MAN1DIR</a></strong>
762 <dd>
763 <p>Directory to hold the man pages at 'make' time</p>
764 </dd>
765 </li>
766 <dt><strong><a name="item_inst_man3dir">INST_MAN3DIR</a></strong>
768 <dd>
769 <p>Directory to hold the man pages at 'make' time</p>
770 </dd>
771 </li>
772 <dt><strong><a name="item_inst_script">INST_SCRIPT</a></strong>
774 <dd>
775 <p>Directory, where executable files should be installed during
776 'make'. Defaults to ``./blib/script'', just to have a dummy location during
777 testing. make install will copy the files in INST_SCRIPT to
778 INSTALLSCRIPT.</p>
779 </dd>
780 </li>
781 <dt><strong><a name="item_ld">LD</a></strong>
783 <dd>
784 <p>Program to be used to link libraries for dynamic loading.</p>
785 </dd>
786 <dd>
787 <p>Defaults to $Config{ld}.</p>
788 </dd>
789 </li>
790 <dt><strong><a name="item_lddlflags">LDDLFLAGS</a></strong>
792 <dd>
793 <p>Any special flags that might need to be passed to ld to create a
794 shared library suitable for dynamic loading. It is up to the makefile
795 to use it. (See <a href="file://C|\msysgit\mingw\html/lib/Config.html#lddlflags">lddlflags in the Config manpage</a>)</p>
796 </dd>
797 <dd>
798 <p>Defaults to $Config{lddlflags}.</p>
799 </dd>
800 </li>
801 <dt><strong><a name="item_ldfrom">LDFROM</a></strong>
803 <dd>
804 <p>Defaults to ``$(OBJECT)'' and is used in the ld command to specify
805 what files to link/load from (also see dynamic_lib below for how to
806 specify ld flags)</p>
807 </dd>
808 </li>
809 <dt><strong><a name="item_lib">LIB</a></strong>
811 <dd>
812 <p>LIB should only be set at <code>perl Makefile.PL</code> time but is allowed as a
813 MakeMaker argument. It has the effect of setting both INSTALLPRIVLIB
814 and INSTALLSITELIB to that value regardless any explicit setting of
815 those arguments (or of PREFIX). INSTALLARCHLIB and INSTALLSITEARCH
816 are set to the corresponding architecture subdirectory.</p>
817 </dd>
818 </li>
819 <dt><strong><a name="item_libperl_a">LIBPERL_A</a></strong>
821 <dd>
822 <p>The filename of the perllibrary that will be used together with this
823 extension. Defaults to libperl.a.</p>
824 </dd>
825 </li>
826 <dt><strong><a name="item_libs">LIBS</a></strong>
828 <dd>
829 <p>An anonymous array of alternative library
830 specifications to be searched for (in order) until
831 at least one library is found. E.g.</p>
832 </dd>
833 <dd>
834 <pre>
835 'LIBS' =&gt; [&quot;-lgdbm&quot;, &quot;-ldbm -lfoo&quot;, &quot;-L/path -ldbm.nfs&quot;]</pre>
836 </dd>
837 <dd>
838 <p>Mind, that any element of the array
839 contains a complete set of arguments for the ld
840 command. So do not specify</p>
841 </dd>
842 <dd>
843 <pre>
844 'LIBS' =&gt; [&quot;-ltcl&quot;, &quot;-ltk&quot;, &quot;-lX11&quot;]</pre>
845 </dd>
846 <dd>
847 <p>See ODBM_File/Makefile.PL for an example, where an array is needed. If
848 you specify a scalar as in</p>
849 </dd>
850 <dd>
851 <pre>
852 'LIBS' =&gt; &quot;-ltcl -ltk -lX11&quot;</pre>
853 </dd>
854 <dd>
855 <p>MakeMaker will turn it into an array with one element.</p>
856 </dd>
857 </li>
858 <dt><strong><a name="item_linktype">LINKTYPE</a></strong>
860 <dd>
861 <p>'static' or 'dynamic' (default unless usedl=undef in
862 config.sh). Should only be used to force static linking (also see
863 linkext below).</p>
864 </dd>
865 </li>
866 <dt><strong><a name="item_makeaperl">MAKEAPERL</a></strong>
868 <dd>
869 <p>Boolean which tells MakeMaker, that it should include the rules to
870 make a perl. This is handled automatically as a switch by
871 MakeMaker. The user normally does not need it.</p>
872 </dd>
873 </li>
874 <dt><strong><a name="item_makefile_old">MAKEFILE_OLD</a></strong>
876 <dd>
877 <p>When 'make clean' or similar is run, the $(FIRST_MAKEFILE) will be
878 backed up at this location.</p>
879 </dd>
880 <dd>
881 <p>Defaults to $(FIRST_MAKEFILE).old or $(FIRST_MAKEFILE)_old on VMS.</p>
882 </dd>
883 </li>
884 <dt><strong><a name="item_man1pods">MAN1PODS</a></strong>
886 <dd>
887 <p>Hashref of pod-containing files. MakeMaker will default this to all
888 EXE_FILES files that include POD directives. The files listed
889 here will be converted to man pages and installed as was requested
890 at Configure time.</p>
891 </dd>
892 </li>
893 <dt><strong><a name="item_man3pods">MAN3PODS</a></strong>
895 <dd>
896 <p>Hashref that assigns to *.pm and *.pod files the files into which the
897 manpages are to be written. MakeMaker parses all *.pod and *.pm files
898 for POD directives. Files that contain POD will be the default keys of
899 the MAN3PODS hashref. These will then be converted to man pages during
900 <code>make</code> and will be installed during <code>make install</code>.</p>
901 </dd>
902 </li>
903 <dt><strong><a name="item_map_target">MAP_TARGET</a></strong>
905 <dd>
906 <p>If it is intended, that a new perl binary be produced, this variable
907 may hold a name for that binary. Defaults to perl</p>
908 </dd>
909 </li>
910 <dt><strong><a name="item_myextlib">MYEXTLIB</a></strong>
912 <dd>
913 <p>If the extension links to a library that it builds set this to the
914 name of the library (see SDBM_File)</p>
915 </dd>
916 </li>
917 <dt><strong><a name="item_name">NAME</a></strong>
919 <dd>
920 <p>Perl module name for this extension (DBD::Oracle). This will default
921 to the directory name but should be explicitly defined in the
922 Makefile.PL.</p>
923 </dd>
924 </li>
925 <dt><strong><a name="item_needs_linking">NEEDS_LINKING</a></strong>
927 <dd>
928 <p>MakeMaker will figure out if an extension contains linkable code
929 anywhere down the directory tree, and will set this variable
930 accordingly, but you can speed it up a very little bit if you define
931 this boolean variable yourself.</p>
932 </dd>
933 </li>
934 <dt><strong><a name="item_noecho">NOECHO</a></strong>
936 <dd>
937 <p>Command so make does not print the literal commands its running.</p>
938 </dd>
939 <dd>
940 <p>By setting it to an empty string you can generate a Makefile that
941 prints all commands. Mainly used in debugging MakeMaker itself.</p>
942 </dd>
943 <dd>
944 <p>Defaults to <code>@</code>.</p>
945 </dd>
946 </li>
947 <dt><strong><a name="item_norecurs">NORECURS</a></strong>
949 <dd>
950 <p>Boolean. Attribute to inhibit descending into subdirectories.</p>
951 </dd>
952 </li>
953 <dt><strong><a name="item_no_meta">NO_META</a></strong>
955 <dd>
956 <p>When true, suppresses the generation and addition to the MANIFEST of
957 the META.yml module meta-data file during 'make distdir'.</p>
958 </dd>
959 <dd>
960 <p>Defaults to false.</p>
961 </dd>
962 </li>
963 <dt><strong><a name="item_no_vc">NO_VC</a></strong>
965 <dd>
966 <p>In general, any generated Makefile checks for the current version of
967 MakeMaker and the version the Makefile was built under. If NO_VC is
968 set, the version check is neglected. Do not write this into your
969 Makefile.PL, use it interactively instead.</p>
970 </dd>
971 </li>
972 <dt><strong><a name="item_object">OBJECT</a></strong>
974 <dd>
975 <p>List of object files, defaults to '$(BASEEXT)$(OBJ_EXT)', but can be a long
976 string containing all object files, e.g. ``tkpBind.o
977 tkpButton.o tkpCanvas.o''</p>
978 </dd>
979 <dd>
980 <p>(Where BASEEXT is the last component of NAME, and OBJ_EXT is $Config{obj_ext}.)</p>
981 </dd>
982 </li>
983 <dt><strong><a name="item_optimize">OPTIMIZE</a></strong>
985 <dd>
986 <p>Defaults to <code>-O</code>. Set it to <code>-g</code> to turn debugging on. The flag is
987 passed to subdirectory makes.</p>
988 </dd>
989 </li>
990 <dt><strong><a name="item_perl">PERL</a></strong>
992 <dd>
993 <p>Perl binary for tasks that can be done by miniperl</p>
994 </dd>
995 </li>
996 <dt><strong><a name="item_perl_core">PERL_CORE</a></strong>
998 <dd>
999 <p>Set only when MakeMaker is building the extensions of the Perl core
1000 distribution.</p>
1001 </dd>
1002 </li>
1003 <dt><strong><a name="item_perlmaincc">PERLMAINCC</a></strong>
1005 <dd>
1006 <p>The call to the program that is able to compile perlmain.c. Defaults
1007 to $(CC).</p>
1008 </dd>
1009 </li>
1010 <dt><strong><a name="item_perl_archlib">PERL_ARCHLIB</a></strong>
1012 <dd>
1013 <p>Same as for PERL_LIB, but for architecture dependent files.</p>
1014 </dd>
1015 <dd>
1016 <p>Used only when MakeMaker is building the extensions of the Perl core
1017 distribution (because normally $(PERL_ARCHLIB) is automatically in @INC,
1018 and adding it would get in the way of PERL5LIB).</p>
1019 </dd>
1020 </li>
1021 <dt><strong><a name="item_perl_lib">PERL_LIB</a></strong>
1023 <dd>
1024 <p>Directory containing the Perl library to use.</p>
1025 </dd>
1026 <dd>
1027 <p>Used only when MakeMaker is building the extensions of the Perl core
1028 distribution (because normally $(PERL_LIB) is automatically in @INC,
1029 and adding it would get in the way of PERL5LIB).</p>
1030 </dd>
1031 </li>
1032 <dt><strong><a name="item_perl_malloc_ok">PERL_MALLOC_OK</a></strong>
1034 <dd>
1035 <p>defaults to 0. Should be set to TRUE if the extension can work with
1036 the memory allocation routines substituted by the Perl <code>malloc()</code> subsystem.
1037 This should be applicable to most extensions with exceptions of those</p>
1038 </dd>
1039 <ul>
1040 <li>
1041 <p>with bugs in memory allocations which are caught by Perl's malloc();</p>
1042 </li>
1043 <li>
1044 <p>which interact with the memory allocator in other ways than via
1045 malloc(), realloc(), free(), calloc(), <code>sbrk()</code> and brk();</p>
1046 </li>
1047 <li>
1048 <p>which rely on special alignment which is not provided by Perl's malloc().</p>
1049 </li>
1050 </ul>
1051 <p><strong>NOTE.</strong> Negligence to set this flag in <em>any one</em> of loaded extension
1052 nullifies many advantages of Perl's malloc(), such as better usage of
1053 system resources, error detection, memory usage reporting, catchable failure
1054 of memory allocations, etc.</p>
1055 <dt><strong><a name="item_perlprefix">PERLPREFIX</a></strong>
1057 <dd>
1058 <p>Directory under which core modules are to be installed.</p>
1059 </dd>
1060 <dd>
1061 <p>Defaults to $Config{installprefixexp} falling back to
1062 $Config{installprefix}, $Config{prefixexp} or $Config{prefix} should
1063 $Config{installprefixexp} not exist.</p>
1064 </dd>
1065 <dd>
1066 <p>Overridden by PREFIX.</p>
1067 </dd>
1068 </li>
1069 <dt><strong><a name="item_perlrun">PERLRUN</a></strong>
1071 <dd>
1072 <p>Use this instead of $(PERL) when you wish to run perl. It will set up
1073 extra necessary flags for you.</p>
1074 </dd>
1075 </li>
1076 <dt><strong><a name="item_perlruninst">PERLRUNINST</a></strong>
1078 <dd>
1079 <p>Use this instead of $(PERL) when you wish to run perl to work with
1080 modules. It will add things like -I$(INST_ARCH) and other necessary
1081 flags so perl can see the modules you're about to install.</p>
1082 </dd>
1083 </li>
1084 <dt><strong><a name="item_perl_src">PERL_SRC</a></strong>
1086 <dd>
1087 <p>Directory containing the Perl source code (use of this should be
1088 avoided, it may be undefined)</p>
1089 </dd>
1090 </li>
1091 <dt><strong><a name="item_perm_rw">PERM_RW</a></strong>
1093 <dd>
1094 <p>Desired permission for read/writable files. Defaults to <code>644</code>.
1095 See also <a href="file://C|\msysgit\mingw\html/lib/ExtUtils/MM_Unix.html#perm_rw">perm_rw in the MM_Unix manpage</a>.</p>
1096 </dd>
1097 </li>
1098 <dt><strong><a name="item_perm_rwx">PERM_RWX</a></strong>
1100 <dd>
1101 <p>Desired permission for executable files. Defaults to <code>755</code>.
1102 See also <a href="file://C|\msysgit\mingw\html/lib/ExtUtils/MM_Unix.html#perm_rwx">perm_rwx in the MM_Unix manpage</a>.</p>
1103 </dd>
1104 </li>
1105 <dt><strong><a name="item_pl_files">PL_FILES</a></strong>
1107 <dd>
1108 <p>MakeMaker can run programs to generate files for you at build time.
1109 By default any file named *.PL (except Makefile.PL and Build.PL) in
1110 the top level directory will be assumed to be a Perl program and run
1111 passing its own basename in as an argument. For example...</p>
1112 </dd>
1113 <dd>
1114 <pre>
1115 perl foo.PL foo</pre>
1116 </dd>
1117 <dd>
1118 <p>This behavior can be overridden by supplying your own set of files to
1119 search. PL_FILES accepts a hash ref, the key being the file to run
1120 and the value is passed in as the first argument when the PL file is run.</p>
1121 </dd>
1122 <dd>
1123 <pre>
1124 PL_FILES =&gt; {'bin/foobar.PL' =&gt; 'bin/foobar'}</pre>
1125 </dd>
1126 <dd>
1127 <p>Would run bin/foobar.PL like this:</p>
1128 </dd>
1129 <dd>
1130 <pre>
1131 perl bin/foobar.PL bin/foobar</pre>
1132 </dd>
1133 <dd>
1134 <p>If multiple files from one program are desired an array ref can be used.</p>
1135 </dd>
1136 <dd>
1137 <pre>
1138 PL_FILES =&gt; {'bin/foobar.PL' =&gt; [qw(bin/foobar1 bin/foobar2)]}</pre>
1139 </dd>
1140 <dd>
1141 <p>In this case the program will be run multiple times using each target file.</p>
1142 </dd>
1143 <dd>
1144 <pre>
1145 perl bin/foobar.PL bin/foobar1
1146 perl bin/foobar.PL bin/foobar2</pre>
1147 </dd>
1148 <dd>
1149 <p>PL files are normally run <strong>after</strong> pm_to_blib and include INST_LIB and
1150 INST_ARCH in its <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__inc"><code>@INC</code></a> so the just built modules can be
1151 accessed... unless the PL file is making a module (or anything else in
1152 PM) in which case it is run <strong>before</strong> pm_to_blib and does not include
1153 INST_LIB and INST_ARCH in its <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item__inc"><code>@INC</code></a>. This apparently odd behavior
1154 is there for backwards compatibility (and its somewhat DWIM).</p>
1155 </dd>
1156 </li>
1157 <dt><strong><a name="item_pm">PM</a></strong>
1159 <dd>
1160 <p>Hashref of .pm files and *.pl files to be installed. e.g.</p>
1161 </dd>
1162 <dd>
1163 <pre>
1164 {'name_of_file.pm' =&gt; '$(INST_LIBDIR)/install_as.pm'}</pre>
1165 </dd>
1166 <dd>
1167 <p>By default this will include *.pm and *.pl and the files found in
1168 the PMLIBDIRS directories. Defining PM in the
1169 Makefile.PL will override PMLIBDIRS.</p>
1170 </dd>
1171 </li>
1172 <dt><strong><a name="item_pmlibdirs">PMLIBDIRS</a></strong>
1174 <dd>
1175 <p>Ref to array of subdirectories containing library files. Defaults to
1176 [ 'lib', $(BASEEXT) ]. The directories will be scanned and <em>any</em> files
1177 they contain will be installed in the corresponding location in the
1178 library. A <code>libscan()</code> method can be used to alter the behaviour.
1179 Defining PM in the Makefile.PL will override PMLIBDIRS.</p>
1180 </dd>
1181 <dd>
1182 <p>(Where BASEEXT is the last component of NAME.)</p>
1183 </dd>
1184 </li>
1185 <dt><strong><a name="item_pm_filter">PM_FILTER</a></strong>
1187 <dd>
1188 <p>A filter program, in the traditional Unix sense (input from stdin, output
1189 to stdout) that is passed on each .pm file during the build (in the
1190 <code>pm_to_blib()</code> phase). It is empty by default, meaning no filtering is done.</p>
1191 </dd>
1192 <dd>
1193 <p>Great care is necessary when defining the command if quoting needs to be
1194 done. For instance, you would need to say:</p>
1195 </dd>
1196 <dd>
1197 <pre>
1198 {'PM_FILTER' =&gt; 'grep -v \\&quot;^\\#\\&quot;'}</pre>
1199 </dd>
1200 <dd>
1201 <p>to remove all the leading coments on the fly during the build. The
1202 extra \\ are necessary, unfortunately, because this variable is interpolated
1203 within the context of a Perl program built on the command line, and double
1204 quotes are what is used with the -e switch to build that command line. The
1205 # is escaped for the Makefile, since what is going to be generated will then
1206 be:</p>
1207 </dd>
1208 <dd>
1209 <pre>
1210 PM_FILTER = grep -v \&quot;^\#\&quot;</pre>
1211 </dd>
1212 <dd>
1213 <p>Without the \\ before the #, we'd have the start of a Makefile comment,
1214 and the macro would be incorrectly defined.</p>
1215 </dd>
1216 </li>
1217 <dt><strong><a name="item_pollute">POLLUTE</a></strong>
1219 <dd>
1220 <p>Release 5.005 grandfathered old global symbol names by providing preprocessor
1221 macros for extension source compatibility. As of release 5.6, these
1222 preprocessor definitions are not available by default. The POLLUTE flag
1223 specifies that the old names should still be defined:</p>
1224 </dd>
1225 <dd>
1226 <pre>
1227 perl Makefile.PL POLLUTE=1</pre>
1228 </dd>
1229 <dd>
1230 <p>Please inform the module author if this is necessary to successfully install
1231 a module under 5.6 or later.</p>
1232 </dd>
1233 </li>
1234 <dt><strong><a name="item_ppm_install_exec">PPM_INSTALL_EXEC</a></strong>
1236 <dd>
1237 <p>Name of the executable used to run <a href="#item_ppm_install_script"><code>PPM_INSTALL_SCRIPT</code></a> below. (e.g. perl)</p>
1238 </dd>
1239 </li>
1240 <dt><strong><a name="item_ppm_install_script">PPM_INSTALL_SCRIPT</a></strong>
1242 <dd>
1243 <p>Name of the script that gets executed by the Perl Package Manager after
1244 the installation of a package.</p>
1245 </dd>
1246 </li>
1247 <dt><strong><a name="item_prefix">PREFIX</a></strong>
1249 <dd>
1250 <p>This overrides all the default install locations. Man pages,
1251 libraries, scripts, etc... MakeMaker will try to make an educated
1252 guess about where to place things under the new PREFIX based on your
1253 Config defaults. Failing that, it will fall back to a structure
1254 which should be sensible for your platform.</p>
1255 </dd>
1256 <dd>
1257 <p>If you specify LIB or any INSTALL* variables they will not be effected
1258 by the PREFIX.</p>
1259 </dd>
1260 </li>
1261 <dt><strong><a name="item_prereq_fatal">PREREQ_FATAL</a></strong>
1263 <dd>
1264 <p>Bool. If this parameter is true, failing to have the required modules
1265 (or the right versions thereof) will be fatal. perl Makefile.PL will die
1266 with the proper message.</p>
1267 </dd>
1268 <dd>
1269 <p>Note: see <a href="file://C|\msysgit\mingw\html/lib/Test/Harness.html">the Test::Harness manpage</a> for a shortcut for stopping tests early if
1270 you are missing dependencies.</p>
1271 </dd>
1272 <dd>
1273 <p>Do <em>not</em> use this parameter for simple requirements, which could be resolved
1274 at a later time, e.g. after an unsuccessful <strong>make test</strong> of your module.</p>
1275 </dd>
1276 <dd>
1277 <p>It is <em>extremely</em> rare to have to use <a href="#item_prereq_fatal"><code>PREREQ_FATAL</code></a> at all!</p>
1278 </dd>
1279 </li>
1280 <dt><strong><a name="item_prereq_pm">PREREQ_PM</a></strong>
1282 <dd>
1283 <p>Hashref: Names of modules that need to be available to run this
1284 extension (e.g. Fcntl for SDBM_File) are the keys of the hash and the
1285 desired version is the value. If the required version number is 0, we
1286 only check if any version is installed already.</p>
1287 </dd>
1288 </li>
1289 <dt><strong><a name="item_prereq_print">PREREQ_PRINT</a></strong>
1291 <dd>
1292 <p>Bool. If this parameter is true, the prerequisites will be printed to
1293 stdout and MakeMaker will exit. The output format is an evalable hash
1294 ref.</p>
1295 </dd>
1296 <dd>
1297 <p>$PREREQ_PM = {
1298 'A::B' =&gt; Vers1,
1299 'C::D' =&gt; Vers2,
1301 };</p>
1302 </dd>
1303 </li>
1304 <dt><strong><a name="item_print_prereq">PRINT_PREREQ</a></strong>
1306 <dd>
1307 <p>RedHatism for <a href="#item_prereq_print"><code>PREREQ_PRINT</code></a>. The output format is different, though:</p>
1308 </dd>
1309 <dd>
1310 <pre>
1311 perl(A::B)&gt;=Vers1 perl(C::D)&gt;=Vers2 ...</pre>
1312 </dd>
1313 </li>
1314 <dt><strong><a name="item_siteprefix">SITEPREFIX</a></strong>
1316 <dd>
1317 <p>Like PERLPREFIX, but only for the site install locations.</p>
1318 </dd>
1319 <dd>
1320 <p>Defaults to $Config{siteprefixexp}. Perls prior to 5.6.0 didn't have
1321 an explicit siteprefix in the Config. In those cases
1322 $Config{installprefix} will be used.</p>
1323 </dd>
1324 <dd>
1325 <p>Overridable by PREFIX</p>
1326 </dd>
1327 </li>
1328 <dt><strong><a name="item_sign">SIGN</a></strong>
1330 <dd>
1331 <p>When true, perform the generation and addition to the MANIFEST of the
1332 SIGNATURE file in the distdir during 'make distdir', via 'cpansign
1333 -s'.</p>
1334 </dd>
1335 <dd>
1336 <p>Note that you need to install the Module::Signature module to
1337 perform this operation.</p>
1338 </dd>
1339 <dd>
1340 <p>Defaults to false.</p>
1341 </dd>
1342 </li>
1343 <dt><strong><a name="item_skip">SKIP</a></strong>
1345 <dd>
1346 <p>Arrayref. E.g. [qw(name1 name2)] skip (do not write) sections of the
1347 Makefile. Caution! Do not use the SKIP attribute for the negligible
1348 speedup. It may seriously damage the resulting Makefile. Only use it
1349 if you really need it.</p>
1350 </dd>
1351 </li>
1352 <dt><strong><a name="item_typemaps">TYPEMAPS</a></strong>
1354 <dd>
1355 <p>Ref to array of typemap file names. Use this when the typemaps are
1356 in some directory other than the current directory or when they are
1357 not named <strong>typemap</strong>. The last typemap in the list takes
1358 precedence. A typemap in the current directory has highest
1359 precedence, even if it isn't listed in TYPEMAPS. The default system
1360 typemap has lowest precedence.</p>
1361 </dd>
1362 </li>
1363 <dt><strong><a name="item_vendorprefix">VENDORPREFIX</a></strong>
1365 <dd>
1366 <p>Like PERLPREFIX, but only for the vendor install locations.</p>
1367 </dd>
1368 <dd>
1369 <p>Defaults to $Config{vendorprefixexp}.</p>
1370 </dd>
1371 <dd>
1372 <p>Overridable by PREFIX</p>
1373 </dd>
1374 </li>
1375 <dt><strong><a name="item_verbinst">VERBINST</a></strong>
1377 <dd>
1378 <p>If true, make install will be verbose</p>
1379 </dd>
1380 </li>
1381 <dt><strong><a name="item_version">VERSION</a></strong>
1383 <dd>
1384 <p>Your version number for distributing the package. This defaults to
1385 0.1.</p>
1386 </dd>
1387 </li>
1388 <dt><strong><a name="item_version_from">VERSION_FROM</a></strong>
1390 <dd>
1391 <p>Instead of specifying the VERSION in the Makefile.PL you can let
1392 MakeMaker parse a file to determine the version number. The parsing
1393 routine requires that the file named by VERSION_FROM contains one
1394 single line to compute the version number. The first line in the file
1395 that contains the regular expression</p>
1396 </dd>
1397 <dd>
1398 <pre>
1399 /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/</pre>
1400 </dd>
1401 <dd>
1402 <p>will be evaluated with <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_eval"><code>eval()</code></a> and the value of the named variable
1403 <strong>after</strong> the <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_eval"><code>eval()</code></a> will be assigned to the VERSION attribute of the
1404 MakeMaker object. The following lines will be parsed o.k.:</p>
1405 </dd>
1406 <dd>
1407 <pre>
1408 $VERSION = '1.00';
1409 *VERSION = \'1.01';
1410 $VERSION = sprintf &quot;%d.%03d&quot;, q$Revision: 4535 $ =~ /(\d+)/g;
1411 $FOO::VERSION = '1.10';
1412 *FOO::VERSION = \'1.11';
1413 our $VERSION = 1.2.3; # new for perl5.6.0</pre>
1414 </dd>
1415 <dd>
1416 <p>but these will fail:</p>
1417 </dd>
1418 <dd>
1419 <pre>
1420 my $VERSION = '1.01';
1421 local $VERSION = '1.02';
1422 local $FOO::VERSION = '1.30';</pre>
1423 </dd>
1424 <dd>
1425 <p>(Putting <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_my"><code>my</code></a> or <code>local</code> on the preceding line will work o.k.)</p>
1426 </dd>
1427 <dd>
1428 <p>The file named in VERSION_FROM is not added as a dependency to
1429 Makefile. This is not really correct, but it would be a major pain
1430 during development to have to rewrite the Makefile for any smallish
1431 change in that file. If you want to make sure that the Makefile
1432 contains the correct VERSION macro after any change of the file, you
1433 would have to do something like</p>
1434 </dd>
1435 <dd>
1436 <pre>
1437 depend =&gt; { Makefile =&gt; '$(VERSION_FROM)' }</pre>
1438 </dd>
1439 <dd>
1440 <p>See attribute <a href="#item_depend"><code>depend</code></a> below.</p>
1441 </dd>
1442 </li>
1443 <dt><strong><a name="item_version_sym">VERSION_SYM</a></strong>
1445 <dd>
1446 <p>A sanitized VERSION with . replaced by _. For places where . has
1447 special meaning (some filesystems, RCS labels, etc...)</p>
1448 </dd>
1449 </li>
1450 <dt><strong><a name="item_xs">XS</a></strong>
1452 <dd>
1453 <p>Hashref of .xs files. MakeMaker will default this. e.g.</p>
1454 </dd>
1455 <dd>
1456 <pre>
1457 {'name_of_file.xs' =&gt; 'name_of_file.c'}</pre>
1458 </dd>
1459 <dd>
1460 <p>The .c files will automatically be included in the list of files
1461 deleted by a make clean.</p>
1462 </dd>
1463 </li>
1464 <dt><strong><a name="item_xsopt">XSOPT</a></strong>
1466 <dd>
1467 <p>String of options to pass to xsubpp. This might include <code>-C++</code> or
1468 <code>-extern</code>. Do not include typemaps here; the TYPEMAP parameter exists for
1469 that purpose.</p>
1470 </dd>
1471 </li>
1472 <dt><strong><a name="item_xsprotoarg">XSPROTOARG</a></strong>
1474 <dd>
1475 <p>May be set to an empty string, which is identical to <code>-prototypes</code>, or
1476 <code>-noprototypes</code>. See the xsubpp documentation for details. MakeMaker
1477 defaults to the empty string.</p>
1478 </dd>
1479 </li>
1480 <dt><strong><a name="item_xs_version">XS_VERSION</a></strong>
1482 <dd>
1483 <p>Your version number for the .xs file of this package. This defaults
1484 to the value of the VERSION attribute.</p>
1485 </dd>
1486 </li>
1487 </dl>
1489 </p>
1490 <h2><a name="additional_lowercase_attributes">Additional lowercase attributes</a></h2>
1491 <p>can be used to pass parameters to the methods which implement that
1492 part of the Makefile. Parameters are specified as a hash ref but are
1493 passed to the method as a hash.</p>
1494 <dl>
1495 <dt><strong><a name="item_clean">clean</a></strong>
1497 <dd>
1498 <pre>
1499 {FILES =&gt; &quot;*.xyz foo&quot;}</pre>
1500 </dd>
1501 <dt><strong><a name="item_depend">depend</a></strong>
1503 <dd>
1504 <pre>
1505 {ANY_TARGET =&gt; ANY_DEPENDECY, ...}</pre>
1506 </dd>
1507 <dd>
1508 <p>(ANY_TARGET must not be given a double-colon rule by MakeMaker.)</p>
1509 </dd>
1510 <dt><strong><a name="item_dist">dist</a></strong>
1512 <dd>
1513 <pre>
1514 {TARFLAGS =&gt; 'cvfF', COMPRESS =&gt; 'gzip', SUFFIX =&gt; '.gz',
1515 SHAR =&gt; 'shar -m', DIST_CP =&gt; 'ln', ZIP =&gt; '/bin/zip',
1516 ZIPFLAGS =&gt; '-rl', DIST_DEFAULT =&gt; 'private tardist' }</pre>
1517 </dd>
1518 <dd>
1519 <p>If you specify COMPRESS, then SUFFIX should also be altered, as it is
1520 needed to tell make the target file of the compression. Setting
1521 DIST_CP to ln can be useful, if you need to preserve the timestamps on
1522 your files. DIST_CP can take the values 'cp', which copies the file,
1523 'ln', which links the file, and 'best' which copies symbolic links and
1524 links the rest. Default is 'best'.</p>
1525 </dd>
1526 <dt><strong><a name="item_dynamic_lib">dynamic_lib</a></strong>
1528 <dd>
1529 <pre>
1530 {ARMAYBE =&gt; 'ar', OTHERLDFLAGS =&gt; '...', INST_DYNAMIC_DEP =&gt; '...'}</pre>
1531 </dd>
1532 <dt><strong><a name="item_linkext">linkext</a></strong>
1534 <dd>
1535 <pre>
1536 {LINKTYPE =&gt; 'static', 'dynamic' or ''}</pre>
1537 </dd>
1538 <dd>
1539 <p>NB: Extensions that have nothing but *.pm files had to say</p>
1540 </dd>
1541 <dd>
1542 <pre>
1543 {LINKTYPE =&gt; ''}</pre>
1544 </dd>
1545 <dd>
1546 <p>with Pre-5.0 MakeMakers. Since version 5.00 of MakeMaker such a line
1547 can be deleted safely. MakeMaker recognizes when there's nothing to
1548 be linked.</p>
1549 </dd>
1550 <dt><strong><a name="item_macro">macro</a></strong>
1552 <dd>
1553 <pre>
1554 {ANY_MACRO =&gt; ANY_VALUE, ...}</pre>
1555 </dd>
1556 <dt><strong><a name="item_postamble">postamble</a></strong>
1558 <dd>
1559 <p>Anything put here will be passed to MY::postamble() if you have one.</p>
1560 </dd>
1561 </li>
1562 <dt><strong><a name="item_realclean">realclean</a></strong>
1564 <dd>
1565 <pre>
1566 {FILES =&gt; '$(INST_ARCHAUTODIR)/*.xyz'}</pre>
1567 </dd>
1568 <dt><strong><a name="item_test">test</a></strong>
1570 <dd>
1571 <pre>
1572 {TESTS =&gt; 't/*.t'}</pre>
1573 </dd>
1574 <dt><strong><a name="item_tool_autosplit">tool_autosplit</a></strong>
1576 <dd>
1577 <pre>
1578 {MAXLEN =&gt; 8}</pre>
1579 </dd>
1580 </dl>
1582 </p>
1583 <h2><a name="overriding_makemaker_methods">Overriding MakeMaker Methods</a></h2>
1584 <p>If you cannot achieve the desired Makefile behaviour by specifying
1585 attributes you may define private subroutines in the Makefile.PL.
1586 Each subroutine returns the text it wishes to have written to
1587 the Makefile. To override a section of the Makefile you can
1588 either say:</p>
1589 <pre>
1590 sub MY::c_o { &quot;new literal text&quot; }</pre>
1591 <p>or you can edit the default by saying something like:</p>
1592 <pre>
1593 package MY; # so that &quot;SUPER&quot; works right
1594 sub c_o {
1595 my $inherited = shift-&gt;SUPER::c_o(@_);
1596 $inherited =~ s/old text/new text/;
1597 $inherited;
1598 }</pre>
1599 <p>If you are running experiments with embedding perl as a library into
1600 other applications, you might find MakeMaker is not sufficient. You'd
1601 better have a look at ExtUtils::Embed which is a collection of utilities
1602 for embedding.</p>
1603 <p>If you still need a different solution, try to develop another
1604 subroutine that fits your needs and submit the diffs to
1605 <code>makemaker@perl.org</code></p>
1606 <p>For a complete description of all MakeMaker methods see
1607 <a href="file://C|\msysgit\mingw\html/lib/ExtUtils/MM_Unix.html">the ExtUtils::MM_Unix manpage</a>.</p>
1608 <p>Here is a simple example of how to add a new target to the generated
1609 Makefile:</p>
1610 <pre>
1611 sub MY::postamble {
1612 return &lt;&lt;'MAKE_FRAG';
1613 $(MYEXTLIB): sdbm/Makefile
1614 cd sdbm &amp;&amp; $(MAKE) all</pre>
1615 <pre>
1616 MAKE_FRAG
1617 }</pre>
1619 </p>
1620 <h2><a name="the_end_of_cargo_cult_programming">The End Of Cargo Cult Programming</a></h2>
1621 <p><code>WriteMakefile()</code> now does some basic sanity checks on its parameters to
1622 protect against typos and malformatted values. This means some things
1623 which happened to work in the past will now throw warnings and
1624 possibly produce internal errors.</p>
1625 <p>Some of the most common mistakes:</p>
1626 <dl>
1627 <dt><strong><a name="item_man3pods__3d_3e__27__27"><code>MAN3PODS =&gt; ' '</code></a></strong>
1629 <dd>
1630 <p>This is commonly used to supress the creation of man pages. MAN3PODS
1631 takes a hash ref not a string, but the above worked by accident in old
1632 versions of MakeMaker.</p>
1633 </dd>
1634 <dd>
1635 <p>The correct code is <code>MAN3PODS =&gt; { }</code>.</p>
1636 </dd>
1637 </li>
1638 </dl>
1640 </p>
1641 <h2><a name="hintsfile_support">Hintsfile support</a></h2>
1642 <p>MakeMaker.pm uses the architecture specific information from
1643 Config.pm. In addition it evaluates architecture specific hints files
1644 in a <code>hints/</code> directory. The hints files are expected to be named
1645 like their counterparts in <code>PERL_SRC/hints</code>, but with an <code>.pl</code> file
1646 name extension (eg. <code>next_3_2.pl</code>). They are simply <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_eval"><code>eval</code></a>ed by
1647 MakeMaker within the <code>WriteMakefile()</code> subroutine, and can be used to
1648 execute commands as well as to include special variables. The rules
1649 which hintsfile is chosen are the same as in Configure.</p>
1650 <p>The hintsfile is eval()ed immediately after the arguments given to
1651 WriteMakefile are stuffed into a hash reference $self but before this
1652 reference becomes blessed. So if you want to do the equivalent to
1653 override or create an attribute you would say something like</p>
1654 <pre>
1655 $self-&gt;{LIBS} = ['-ldbm -lucb -lc'];</pre>
1657 </p>
1658 <h2><a name="distribution_support">Distribution Support</a></h2>
1659 <p>For authors of extensions MakeMaker provides several Makefile
1660 targets. Most of the support comes from the ExtUtils::Manifest module,
1661 where additional documentation can be found.</p>
1662 <dl>
1663 <dt><strong><a name="item_make_distcheck">make distcheck</a></strong>
1665 <dd>
1666 <p>reports which files are below the build directory but not in the
1667 MANIFEST file and vice versa. (See ExtUtils::Manifest::fullcheck() for
1668 details)</p>
1669 </dd>
1670 </li>
1671 <dt><strong><a name="item_make_skipcheck">make skipcheck</a></strong>
1673 <dd>
1674 <p>reports which files are skipped due to the entries in the
1675 <code>MANIFEST.SKIP</code> file (See ExtUtils::Manifest::skipcheck() for
1676 details)</p>
1677 </dd>
1678 </li>
1679 <dt><strong><a name="item_make_distclean">make distclean</a></strong>
1681 <dd>
1682 <p>does a realclean first and then the distcheck. Note that this is not
1683 needed to build a new distribution as long as you are sure that the
1684 MANIFEST file is ok.</p>
1685 </dd>
1686 </li>
1687 <dt><strong><a name="item_make_manifest">make manifest</a></strong>
1689 <dd>
1690 <p>rewrites the MANIFEST file, adding all remaining files found (See
1691 ExtUtils::Manifest::mkmanifest() for details)</p>
1692 </dd>
1693 </li>
1694 <dt><strong><a name="item_make_distdir">make distdir</a></strong>
1696 <dd>
1697 <p>Copies all the files that are in the MANIFEST file to a newly created
1698 directory with the name <code>$(DISTNAME)-$(VERSION)</code>. If that directory
1699 exists, it will be removed first.</p>
1700 </dd>
1701 <dd>
1702 <p>Additionally, it will create a META.yml module meta-data file in the
1703 distdir and add this to the distdir's MANFIEST. You can shut this
1704 behavior off with the NO_META flag.</p>
1705 </dd>
1706 </li>
1707 <dt><strong><a name="item_make_disttest">make disttest</a></strong>
1709 <dd>
1710 <p>Makes a distdir first, and runs a <code>perl Makefile.PL</code>, a make, and
1711 a make test in that directory.</p>
1712 </dd>
1713 </li>
1714 <dt><strong><a name="item_make_tardist">make tardist</a></strong>
1716 <dd>
1717 <p>First does a distdir. Then a command $(PREOP) which defaults to a null
1718 command, followed by $(TOUNIX), which defaults to a null command under
1719 UNIX, and will convert files in distribution directory to UNIX format
1720 otherwise. Next it runs <code>tar</code> on that directory into a tarfile and
1721 deletes the directory. Finishes with a command $(POSTOP) which
1722 defaults to a null command.</p>
1723 </dd>
1724 </li>
1725 <dt><strong><a name="item_make_dist">make dist</a></strong>
1727 <dd>
1728 <p>Defaults to $(DIST_DEFAULT) which in turn defaults to tardist.</p>
1729 </dd>
1730 </li>
1731 <dt><strong><a name="item_make_uutardist">make uutardist</a></strong>
1733 <dd>
1734 <p>Runs a tardist first and uuencodes the tarfile.</p>
1735 </dd>
1736 </li>
1737 <dt><strong><a name="item_make_shdist">make shdist</a></strong>
1739 <dd>
1740 <p>First does a distdir. Then a command $(PREOP) which defaults to a null
1741 command. Next it runs <code>shar</code> on that directory into a sharfile and
1742 deletes the intermediate directory again. Finishes with a command
1743 $(POSTOP) which defaults to a null command. Note: For shdist to work
1744 properly a <code>shar</code> program that can handle directories is mandatory.</p>
1745 </dd>
1746 </li>
1747 <dt><strong><a name="item_make_zipdist">make zipdist</a></strong>
1749 <dd>
1750 <p>First does a distdir. Then a command $(PREOP) which defaults to a null
1751 command. Runs <code>$(ZIP) $(ZIPFLAGS)</code> on that directory into a
1752 zipfile. Then deletes that directory. Finishes with a command
1753 $(POSTOP) which defaults to a null command.</p>
1754 </dd>
1755 </li>
1756 <dt><strong><a name="item_make_ci">make ci</a></strong>
1758 <dd>
1759 <p>Does a $(CI) and a $(RCS_LABEL) on all files in the MANIFEST file.</p>
1760 </dd>
1761 </li>
1762 </dl>
1763 <p>Customization of the dist targets can be done by specifying a hash
1764 reference to the dist attribute of the WriteMakefile call. The
1765 following parameters are recognized:</p>
1766 <pre>
1767 CI ('ci -u')
1768 COMPRESS ('gzip --best')
1769 POSTOP ('@ :')
1770 PREOP ('@ :')
1771 TO_UNIX (depends on the system)
1772 RCS_LABEL ('rcs -q -Nv$(VERSION_SYM):')
1773 SHAR ('shar')
1774 SUFFIX ('.gz')
1775 TAR ('tar')
1776 TARFLAGS ('cvf')
1777 ZIP ('zip')
1778 ZIPFLAGS ('-r')</pre>
1779 <p>An example:</p>
1780 <pre>
1781 WriteMakefile( 'dist' =&gt; { COMPRESS=&gt;&quot;bzip2&quot;, SUFFIX=&gt;&quot;.bz2&quot; })</pre>
1783 </p>
1784 <h2><a name="module_metadata">Module Meta-Data</a></h2>
1785 <p>Long plaguing users of MakeMaker based modules has been the problem of
1786 getting basic information about the module out of the sources
1787 <em>without</em> running the <em>Makefile.PL</em> and doing a bunch of messy
1788 heuristics on the resulting <em>Makefile</em>. To this end a simple module
1789 meta-data file has been introduced, <em>META.yml</em>.</p>
1790 <p><em>META.yml</em> is a YAML document (see <a href="http://www.yaml.org)">http://www.yaml.org)</a> containing
1791 basic information about the module (name, version, prerequisites...)
1792 in an easy to read format. The format is developed and defined by the
1793 Module::Build developers (see
1794 <a href="http://module-build.sourceforge.net/META-spec.html)">http://module-build.sourceforge.net/META-spec.html)</a></p>
1795 <p>MakeMaker will automatically generate a <em>META.yml</em> file for you and
1796 add it to your <em>MANIFEST</em> as part of the 'distdir' target (and thus
1797 the 'dist' target). This is intended to seamlessly and rapidly
1798 populate CPAN with module meta-data. If you wish to shut this feature
1799 off, set the <a href="#item_no_meta"><code>NO_META</code></a> <code>WriteMakefile()</code> flag to true.</p>
1801 </p>
1802 <h2><a name="disabling_an_extension">Disabling an extension</a></h2>
1803 <p>If some events detected in <em>Makefile.PL</em> imply that there is no way
1804 to create the Module, but this is a normal state of things, then you
1805 can create a <em>Makefile</em> which does nothing, but succeeds on all the
1806 ``usual'' build targets. To do so, use</p>
1807 <pre>
1808 ExtUtils::MakeMaker::WriteEmptyMakefile();</pre>
1809 <p>instead of WriteMakefile().</p>
1810 <p>This may be useful if other modules expect this module to be <em>built</em>
1811 OK, as opposed to <em>work</em> OK (say, this system-dependent module builds
1812 in a subdirectory of some other distribution, or is listed as a
1813 dependency in a CPAN::Bundle, but the functionality is supported by
1814 different means on the current architecture).</p>
1816 </p>
1817 <h2><a name="other_handy_functions">Other Handy Functions</a></h2>
1818 <dl>
1819 <dt><strong><a name="item_prompt">prompt</a></strong>
1821 <dd>
1822 <pre>
1823 my $value = prompt($message);
1824 my $value = prompt($message, $default);</pre>
1825 </dd>
1826 <dd>
1827 <p>The <a href="#item_prompt"><code>prompt()</code></a> function provides an easy way to request user input
1828 used to write a makefile. It displays the $message as a prompt for
1829 input. If a $default is provided it will be used as a default. The
1830 function returns the $value selected by the user.</p>
1831 </dd>
1832 <dd>
1833 <p>If <a href="#item_prompt"><code>prompt()</code></a> detects that it is not running interactively and there
1834 is nothing on STDIN or if the PERL_MM_USE_DEFAULT environment variable
1835 is set to true, the $default will be used without prompting. This
1836 prevents automated processes from blocking on user input.</p>
1837 </dd>
1838 <dd>
1839 <p>If no $default is provided an empty string will be used instead.</p>
1840 </dd>
1841 </dl>
1843 </p>
1844 <hr />
1845 <h1><a name="environment">ENVIRONMENT</a></h1>
1846 <dl>
1847 <dt><strong><a name="item_perl_mm_opt">PERL_MM_OPT</a></strong>
1849 <dd>
1850 <p>Command line options used by <code>MakeMaker-&gt;new()</code>, and thus by
1851 <code>WriteMakefile()</code>. The string is split on whitespace, and the result
1852 is processed before any actual command line arguments are processed.</p>
1853 </dd>
1854 </li>
1855 <dt><strong><a name="item_perl_mm_use_default">PERL_MM_USE_DEFAULT</a></strong>
1857 <dd>
1858 <p>If set to a true value then MakeMaker's prompt function will
1859 always return the default without waiting for user input.</p>
1860 </dd>
1861 </li>
1862 <dt><strong>PERL_CORE</strong>
1864 <dd>
1865 <p>Same as the PERL_CORE parameter. The parameter overrides this.</p>
1866 </dd>
1867 </li>
1868 </dl>
1870 </p>
1871 <hr />
1872 <h1><a name="see_also">SEE ALSO</a></h1>
1873 <p>ExtUtils::MM_Unix, ExtUtils::Manifest ExtUtils::Install,
1874 ExtUtils::Embed</p>
1876 </p>
1877 <hr />
1878 <h1><a name="authors">AUTHORS</a></h1>
1879 <p>Andy Dougherty <code>doughera@lafayette.edu</code>, Andreas K&ouml;nig
1880 <code>andreas.koenig@mind.de</code>, Tim Bunce <code>timb@cpan.org</code>. VMS
1881 support by Charles Bailey <code>bailey@newman.upenn.edu</code>. OS/2 support
1882 by Ilya Zakharevich <code>ilya@math.ohio-state.edu</code>.</p>
1883 <p>Currently maintained by Michael G Schwern <code>schwern@pobox.com</code></p>
1884 <p>Send patches and ideas to <code>makemaker@perl.org</code>.</p>
1885 <p>Send bug reports via <a href="http://rt.cpan.org/.">http://rt.cpan.org/.</a> Please send your
1886 generated Makefile along with your report.</p>
1887 <p>For more up-to-date information, see <a href="http://www.makemaker.org">http://www.makemaker.org</a>.</p>
1889 </p>
1890 <hr />
1891 <h1><a name="license">LICENSE</a></h1>
1892 <p>This program is free software; you can redistribute it and/or
1893 modify it under the same terms as Perl itself.</p>
1894 <p>See <a href="http://www.perl.com/perl/misc/Artistic.html">http://www.perl.com/perl/misc/Artistic.html</a></p>
1895 <table border="0" width="100%" cellspacing="0" cellpadding="3">
1896 <tr><td class="block" style="background-color: #cccccc" valign="middle">
1897 <big><strong><span class="block">&nbsp;ExtUtils::MakeMaker - Create a module Makefile</span></strong></big>
1898 </td></tr>
1899 </table>
1901 </body>
1903 </html>