1Module::Build(3pm) Perl Programmers Reference Guide Module::Build(3pm)
2
3
4
6 Module::Build - Build and install Perl modules
7
9 Standard process for building & installing modules:
10
11 perl Build.PL
12 ./Build
13 ./Build test
14 ./Build install
15
16 Or, if you're on a platform (like DOS or Windows) that doesn't require
17 the "./" notation, you can do this:
18
19 perl Build.PL
20 Build
21 Build test
22 Build install
23
25 "Module::Build" is a system for building, testing, and installing Perl
26 modules. It is meant to be an alternative to "ExtUtils::MakeMaker".
27 Developers may alter the behavior of the module through subclassing in
28 a much more straightforward way than with "MakeMaker". It also does
29 not require a "make" on your system - most of the "Module::Build" code
30 is pure-perl and written in a very cross-platform way. In fact, you
31 don't even need a shell, so even platforms like MacOS (traditional) can
32 use it fairly easily. Its only prerequisites are modules that are
33 included with perl 5.6.0, and it works fine on perl 5.005 if you can
34 install a few additional modules.
35
36 See "MOTIVATIONS" for more comparisons between "ExtUtils::MakeMaker"
37 and "Module::Build".
38
39 To install "Module::Build", and any other module that uses
40 "Module::Build" for its installation process, do the following:
41
42 perl Build.PL # 'Build.PL' script creates the 'Build' script
43 ./Build # Need ./ to ensure we're using this "Build" script
44 ./Build test # and not another one that happens to be in the PATH
45 ./Build install
46
47 This illustrates initial configuration and the running of three
48 'actions'. In this case the actions run are 'build' (the default
49 action), 'test', and 'install'. Other actions defined so far include:
50
51 build manpages
52 clean pardist
53 code ppd
54 config_data ppmdist
55 diff prereq_data
56 dist prereq_report
57 distcheck pure_install
58 distclean realclean
59 distdir retest
60 distmeta skipcheck
61 distsign test
62 disttest testall
63 docs testcover
64 fakeinstall testdb
65 help testpod
66 html testpodcoverage
67 install versioninstall
68 manifest
69
70 You can run the 'help' action for a complete list of actions.
71
73 The documentation for "Module::Build" is broken up into three sections:
74
75 General Usage (Module::Build)
76 This is the document you are currently reading. It describes basic
77 usage and background information. Its main purpose is to assist
78 the user who wants to learn how to invoke and control
79 "Module::Build" scripts at the command line.
80
81 Authoring Reference (Module::Build::Authoring)
82 This document describes the structure and organization of
83 "Module::Build", and the relevant concepts needed by authors who
84 are writing Build.PL scripts for a distribution or controlling
85 "Module::Build" processes programmatically.
86
87 API Reference (Module::Build::API)
88 This is a reference to the "Module::Build" API.
89
90 Cookbook (Module::Build::Cookbook)
91 This document demonstrates how to accomplish many common tasks. It
92 covers general command line usage and authoring of Build.PL
93 scripts. Includes working examples.
94
96 There are some general principles at work here. First, each task when
97 building a module is called an "action". These actions are listed
98 above; they correspond to the building, testing, installing, packaging,
99 etc., tasks.
100
101 Second, arguments are processed in a very systematic way. Arguments
102 are always key=value pairs. They may be specified at "perl Build.PL"
103 time (i.e. "perl Build.PL destdir=/my/secret/place"), in which case
104 their values last for the lifetime of the "Build" script. They may
105 also be specified when executing a particular action (i.e. "Build test
106 verbose=1"), in which case their values last only for the lifetime of
107 that command. Per-action command line parameters take precedence over
108 parameters specified at "perl Build.PL" time.
109
110 The build process also relies heavily on the "Config.pm" module. If
111 the user wishes to override any of the values in "Config.pm", she may
112 specify them like so:
113
114 perl Build.PL --config cc=gcc --config ld=gcc
115
116 The following build actions are provided by default.
117
118 build
119 [version 0.01]
120
121 If you run the "Build" script without any arguments, it runs the
122 "build" action, which in turn runs the "code" and "docs" actions.
123
124 This is analogous to the "MakeMaker" make all target.
125
126 clean
127 [version 0.01]
128
129 This action will clean up any files that the build process may have
130 created, including the "blib/" directory (but not including the
131 "_build/" directory and the "Build" script itself).
132
133 code
134 [version 0.20]
135
136 This action builds your code base.
137
138 By default it just creates a "blib/" directory and copies any ".pm"
139 and ".pod" files from your "lib/" directory into the "blib/"
140 directory. It also compiles any ".xs" files from "lib/" and places
141 them in "blib/". Of course, you need a working C compiler
142 (probably the same one that built perl itself) for the compilation
143 to work properly.
144
145 The "code" action also runs any ".PL" files in your lib/ directory.
146 Typically these create other files, named the same but without the
147 ".PL" ending. For example, a file lib/Foo/Bar.pm.PL could create
148 the file lib/Foo/Bar.pm. The ".PL" files are processed first, so
149 any ".pm" files (or other kinds that we deal with) will get copied
150 correctly.
151
152 config_data
153 [version 0.26]
154
155 ...
156
157 diff
158 [version 0.14]
159
160 This action will compare the files about to be installed with their
161 installed counterparts. For .pm and .pod files, a diff will be
162 shown (this currently requires a 'diff' program to be in your
163 PATH). For other files like compiled binary files, we simply
164 report whether they differ.
165
166 A "flags" parameter may be passed to the action, which will be
167 passed to the 'diff' program. Consult your 'diff' documentation
168 for the parameters it will accept - a good one is "-u":
169
170 ./Build diff flags=-u
171
172 dist
173 [version 0.02]
174
175 This action is helpful for module authors who want to package up
176 their module for source distribution through a medium like CPAN.
177 It will create a tarball of the files listed in MANIFEST and
178 compress the tarball using GZIP compression.
179
180 By default, this action will use the "Archive::Tar" module.
181 However, you can force it to use binary "tar" and "gzip"
182 executables by supplying an explicit "tar" (and optional "gzip")
183 parameter:
184
185 ./Build dist --tar C:\path\to\tar.exe --gzip C:\path\to\zip.exe
186
187 distcheck
188 [version 0.05]
189
190 Reports which files are in the build directory but not in the
191 MANIFEST file, and vice versa. (See manifest for details.)
192
193 distclean
194 [version 0.05]
195
196 Performs the 'realclean' action and then the 'distcheck' action.
197
198 distdir
199 [version 0.05]
200
201 Creates a "distribution directory" named "$dist_name-$dist_version"
202 (if that directory already exists, it will be removed first), then
203 copies all the files listed in the MANIFEST file to that directory.
204 This directory is what the distribution tarball is created from.
205
206 distmeta
207 [version 0.21]
208
209 Creates the META.yml file that describes the distribution.
210
211 META.yml is a file containing various bits of metadata about the
212 distribution. The metadata includes the distribution name,
213 version, abstract, prerequisites, license, and various other data
214 about the distribution. This file is created as META.yml in YAML
215 format. It is recommended that the "YAML" module be installed to
216 create it. If the "YAML" module is not installed, an internal
217 module supplied with Module::Build will be used to write the
218 META.yml file, and this will most likely be fine.
219
220 META.yml file must also be listed in MANIFEST - if it's not, a
221 warning will be issued.
222
223 The current version of the META.yml specification can be found at
224 <http://module-build.sourceforge.net/META-spec-current.html>
225
226 distsign
227 [version 0.16]
228
229 Uses "Module::Signature" to create a SIGNATURE file for your
230 distribution, and adds the SIGNATURE file to the distribution's
231 MANIFEST.
232
233 disttest
234 [version 0.05]
235
236 Performs the 'distdir' action, then switches into that directory
237 and runs a "perl Build.PL", followed by the 'build' and 'test'
238 actions in that directory.
239
240 docs
241 [version 0.20]
242
243 This will generate documentation (e.g. Unix man pages and HTML
244 documents) for any installable items under blib/ that contain POD.
245 If there are no "bindoc" or "libdoc" installation targets defined
246 (as will be the case on systems that don't support Unix manpages)
247 no action is taken for manpages. If there are no "binhtml" or
248 "libhtml" installation targets defined no action is taken for HTML
249 documents.
250
251 fakeinstall
252 [version 0.02]
253
254 This is just like the "install" action, but it won't actually do
255 anything, it will just report what it would have done if you had
256 actually run the "install" action.
257
258 help
259 [version 0.03]
260
261 This action will simply print out a message that is meant to help
262 you use the build process. It will show you a list of available
263 build actions too.
264
265 With an optional argument specifying an action name (e.g. "Build
266 help test"), the 'help' action will show you any POD documentation
267 it can find for that action.
268
269 html
270 [version 0.26]
271
272 This will generate HTML documentation for any binary or library
273 files under blib/ that contain POD. The HTML documentation will
274 only be installed if the install paths can be determined from
275 values in "Config.pm". You can also supply or override install
276 paths on the command line by specifying "install_path" values for
277 the "binhtml" and/or "libhtml" installation targets.
278
279 install
280 [version 0.01]
281
282 This action will use "ExtUtils::Install" to install the files from
283 "blib/" into the system. See "INSTALL PATHS" for details about how
284 Module::Build determines where to install things, and how to
285 influence this process.
286
287 If you want the installation process to look around in @INC for
288 other versions of the stuff you're installing and try to delete it,
289 you can use the "uninst" parameter, which tells "ExtUtils::Install"
290 to do so:
291
292 ./Build install uninst=1
293
294 This can be a good idea, as it helps prevent multiple versions of a
295 module from being present on your system, which can be a confusing
296 situation indeed.
297
298 manifest
299 [version 0.05]
300
301 This is an action intended for use by module authors, not people
302 installing modules. It will bring the MANIFEST up to date with the
303 files currently present in the distribution. You may use a
304 MANIFEST.SKIP file to exclude certain files or directories from
305 inclusion in the MANIFEST. MANIFEST.SKIP should contain a bunch of
306 regular expressions, one per line. If a file in the distribution
307 directory matches any of the regular expressions, it won't be
308 included in the MANIFEST.
309
310 The following is a reasonable MANIFEST.SKIP starting point, you can
311 add your own stuff to it:
312
313 ^_build
314 ^Build$
315 ^blib
316 ~$
317 \.bak$
318 ^MANIFEST\.SKIP$
319 CVS
320
321 See the distcheck and skipcheck actions if you want to find out
322 what the "manifest" action would do, without actually doing
323 anything.
324
325 manpages
326 [version 0.28]
327
328 This will generate man pages for any binary or library files under
329 blib/ that contain POD. The man pages will only be installed if
330 the install paths can be determined from values in "Config.pm".
331 You can also supply or override install paths by specifying there
332 values on the command line with the "bindoc" and "libdoc"
333 installation targets.
334
335 pardist
336 [version 0.2806]
337
338 Generates a PAR binary distribution for use with PAR or PAR::Dist.
339
340 It requires that the PAR::Dist module (version 0.17 and up) is
341 installed on your system.
342
343 ppd [version 0.20]
344
345 Build a PPD file for your distribution.
346
347 This action takes an optional argument "codebase" which is used in
348 the generated PPD file to specify the (usually relative) URL of the
349 distribution. By default, this value is the distribution name
350 without any path information.
351
352 Example:
353
354 ./Build ppd --codebase "MSWin32-x86-multi-thread/Module-Build-0.21.tar.gz"
355
356 ppmdist
357 [version 0.23]
358
359 Generates a PPM binary distribution and a PPD description file.
360 This action also invokes the "ppd" action, so it can accept the
361 same "codebase" argument described under that action.
362
363 This uses the same mechanism as the "dist" action to tar & zip its
364 output, so you can supply "tar" and/or "gzip" parameters to affect
365 the result.
366
367 prereq_data
368 [version 0.32]
369
370 This action prints out a Perl data structure of all prerequisites
371 and the versions required. The output can be loaded again using
372 "eval()". This can be useful for external tools that wish to query
373 a Build script for prerequisites.
374
375 prereq_report
376 [version 0.28]
377
378 This action prints out a list of all prerequisites, the versions
379 required, and the versions actually installed. This can be useful
380 for reviewing the configuration of your system prior to a build, or
381 when compiling data to send for a bug report.
382
383 pure_install
384 [version 0.28]
385
386 This action is identical to the "install" action. In the future,
387 though, when "install" starts writing to the file
388 $(INSTALLARCHLIB)/perllocal.pod, "pure_install" won't, and that
389 will be the only difference between them.
390
391 realclean
392 [version 0.01]
393
394 This action is just like the "clean" action, but also removes the
395 "_build" directory and the "Build" script. If you run the
396 "realclean" action, you are essentially starting over, so you will
397 have to re-create the "Build" script again.
398
399 retest
400 [version 0.2806]
401
402 This is just like the "test" action, but doesn't actually build the
403 distribution first, and doesn't add blib/ to the load path, and
404 therefore will test against a previously installed version of the
405 distribution. This can be used to verify that a certain installed
406 distribution still works, or to see whether newer versions of a
407 distribution still pass the old regression tests, and so on.
408
409 skipcheck
410 [version 0.05]
411
412 Reports which files are skipped due to the entries in the
413 MANIFEST.SKIP file (See manifest for details)
414
415 test
416 [version 0.01]
417
418 This will use "Test::Harness" or "TAP::Harness" to run any
419 regression tests and report their results. Tests can be defined in
420 the standard places: a file called "test.pl" in the top-level
421 directory, or several files ending with ".t" in a "t/" directory.
422
423 If you want tests to be 'verbose', i.e. show details of test
424 execution rather than just summary information, pass the argument
425 "verbose=1".
426
427 If you want to run tests under the perl debugger, pass the argument
428 "debugger=1".
429
430 If you want to have Module::Build find test files with different
431 file name extensions, pass the "test_file_exts" argument with an
432 array of extensions, such as "[qw( .t .s .z )]".
433
434 If you want test to be run by "TAP::Harness", rather than
435 "Test::Harness", pass the argument "tap_harness_args" as an array
436 reference of arguments to pass to the TAP::Harness constructor.
437
438 In addition, if a file called "visual.pl" exists in the top-level
439 directory, this file will be executed as a Perl script and its
440 output will be shown to the user. This is a good place to put
441 speed tests or other tests that don't use the "Test::Harness"
442 format for output.
443
444 To override the choice of tests to run, you may pass a "test_files"
445 argument whose value is a whitespace-separated list of test scripts
446 to run. This is especially useful in development, when you only
447 want to run a single test to see whether you've squashed a certain
448 bug yet:
449
450 ./Build test --test_files t/something_failing.t
451
452 You may also pass several "test_files" arguments separately:
453
454 ./Build test --test_files t/one.t --test_files t/two.t
455
456 or use a "glob()"-style pattern:
457
458 ./Build test --test_files 't/01-*.t'
459
460 testall
461 [version 0.2807]
462
463 [Note: the 'testall' action and the code snippets below are
464 currently in alpha stage, see
465 "/www.nntp.perl.org/group/perl.module.build/2007/03/msg584.html""
466 in "http: ]
467
468 Runs the "test" action plus each of the "test$type" actions defined
469 by the keys of the "test_types" parameter.
470
471 Currently, you need to define the ACTION_test$type method yourself
472 and enumerate them in the test_types parameter.
473
474 my $mb = Module::Build->subclass(
475 code => q(
476 sub ACTION_testspecial { shift->generic_test(type => 'special'); }
477 sub ACTION_testauthor { shift->generic_test(type => 'author'); }
478 )
479 )->new(
480 ...
481 test_types => {
482 special => '.st',
483 author => ['.at', '.pt' ],
484 },
485 ...
486
487 testcover
488 [version 0.26]
489
490 Runs the "test" action using "Devel::Cover", generating a code-
491 coverage report showing which parts of the code were actually
492 exercised during the tests.
493
494 To pass options to "Devel::Cover", set the $DEVEL_COVER_OPTIONS
495 environment variable:
496
497 DEVEL_COVER_OPTIONS=-ignore,Build ./Build testcover
498
499 testdb
500 [version 0.05]
501
502 This is a synonym for the 'test' action with the "debugger=1"
503 argument.
504
505 testpod
506 [version 0.25]
507
508 This checks all the files described in the "docs" action and
509 produces "Test::Harness"-style output. If you are a module author,
510 this is useful to run before creating a new release.
511
512 testpodcoverage
513 [version 0.28]
514
515 This checks the pod coverage of the distribution and produces
516 "Test::Harness"-style output. If you are a module author, this is
517 useful to run before creating a new release.
518
519 versioninstall
520 [version 0.16]
521
522 ** Note: since "only.pm" is so new, and since we just recently
523 added support for it here too, this feature is to be considered
524 experimental. **
525
526 If you have the "only.pm" module installed on your system, you can
527 use this action to install a module into the version-specific
528 library trees. This means that you can have several versions of
529 the same module installed and "use" a specific one like this:
530
531 use only MyModule => 0.55;
532
533 To override the default installation libraries in "only::config",
534 specify the "versionlib" parameter when you run the "Build.PL"
535 script:
536
537 perl Build.PL --versionlib /my/version/place/
538
539 To override which version the module is installed as, specify the
540 "versionlib" parameter when you run the "Build.PL" script:
541
542 perl Build.PL --version 0.50
543
544 See the "only.pm" documentation for more information on version-
545 specific installs.
546
548 Command Line Options
549 The following options can be used during any invocation of "Build.PL"
550 or the Build script, during any action. For information on other
551 options specific to an action, see the documentation for the respective
552 action.
553
554 NOTE: There is some preliminary support for options to use the more
555 familiar long option style. Most options can be preceded with the "--"
556 long option prefix, and the underscores changed to dashes (e.g.
557 "--use-rcfile"). Additionally, the argument to boolean options is
558 optional, and boolean options can be negated by prefixing them with
559 "no" or "no-" (e.g. "--noverbose" or "--no-verbose").
560
561 quiet
562 Suppress informative messages on output.
563
564 use_rcfile
565 Load the ~/.modulebuildrc option file. This option can be set to
566 false to prevent the custom resource file from being loaded.
567
568 verbose
569 Display extra information about the Build on output.
570
571 allow_mb_mismatch
572 Suppresses the check upon startup that the version of Module::Build
573 we're now running under is the same version that was initially
574 invoked when building the distribution (i.e. when the "Build.PL"
575 script was first run). Use with caution.
576
577 debug
578 Prints Module::Build debugging information to STDOUT, such as a
579 trace of executed build actions.
580
581 Default Options File (.modulebuildrc)
582 [version 0.28]
583
584 When Module::Build starts up, it will look first for a file,
585 $ENV{HOME}/.modulebuildrc. If it's not found there, it will look in
586 the the .modulebuildrc file in the directories referred to by the
587 environment variables "HOMEDRIVE" + "HOMEDIR", "USERPROFILE",
588 "APPDATA", "WINDIR", "SYS$LOGIN". If the file exists, the options
589 specified there will be used as defaults, as if they were typed on the
590 command line. The defaults can be overridden by specifying new values
591 on the command line.
592
593 The action name must come at the beginning of the line, followed by any
594 amount of whitespace and then the options. Options are given the same
595 as they would be on the command line. They can be separated by any
596 amount of whitespace, including newlines, as long there is whitespace
597 at the beginning of each continued line. Anything following a hash
598 mark ("#") is considered a comment, and is stripped before parsing. If
599 more than one line begins with the same action name, those lines are
600 merged into one set of options.
601
602 Besides the regular actions, there are two special pseudo-actions: the
603 key "*" (asterisk) denotes any global options that should be applied to
604 all actions, and the key 'Build_PL' specifies options to be applied
605 when you invoke "perl Build.PL".
606
607 * verbose=1 # global options
608 diff flags=-u
609 install --install_base /home/ken
610 --install_path html=/home/ken/docs/html
611
612 If you wish to locate your resource file in a different location, you
613 can set the environment variable "MODULEBUILDRC" to the complete
614 absolute path of the file containing your options.
615
617 [version 0.19]
618
619 When you invoke Module::Build's "build" action, it needs to figure out
620 where to install things. The nutshell version of how this works is
621 that default installation locations are determined from Config.pm, and
622 they may be overridden by using the "install_path" parameter. An
623 "install_base" parameter lets you specify an alternative installation
624 root like /home/foo, and a "destdir" lets you specify a temporary
625 installation directory like /tmp/install in case you want to create
626 bundled-up installable packages.
627
628 Natively, Module::Build provides default installation locations for the
629 following types of installable items:
630
631 lib Usually pure-Perl module files ending in .pm.
632
633 arch
634 "Architecture-dependent" module files, usually produced by
635 compiling XS, Inline, or similar code.
636
637 script
638 Programs written in pure Perl. In order to improve reuse, try to
639 make these as small as possible - put the code into modules
640 whenever possible.
641
642 bin "Architecture-dependent" executable programs, i.e. compiled C code
643 or something. Pretty rare to see this in a perl distribution, but
644 it happens.
645
646 bindoc
647 Documentation for the stuff in "script" and "bin". Usually
648 generated from the POD in those files. Under Unix, these are
649 manual pages belonging to the 'man1' category.
650
651 libdoc
652 Documentation for the stuff in "lib" and "arch". This is usually
653 generated from the POD in .pm files. Under Unix, these are manual
654 pages belonging to the 'man3' category.
655
656 binhtml
657 This is the same as "bindoc" above, but applies to HTML documents.
658
659 libhtml
660 This is the same as "bindoc" above, but applies to HTML documents.
661
662 Four other parameters let you control various aspects of how
663 installation paths are determined:
664
665 installdirs
666 The default destinations for these installable things come from
667 entries in your system's "Config.pm". You can select from three
668 different sets of default locations by setting the "installdirs"
669 parameter as follows:
670
671 'installdirs' set to:
672 core site vendor
673
674 uses the following defaults from Config.pm:
675
676 lib => installprivlib installsitelib installvendorlib
677 arch => installarchlib installsitearch installvendorarch
678 script => installscript installsitebin installvendorbin
679 bin => installbin installsitebin installvendorbin
680 bindoc => installman1dir installsiteman1dir installvendorman1dir
681 libdoc => installman3dir installsiteman3dir installvendorman3dir
682 binhtml => installhtml1dir installsitehtml1dir installvendorhtml1dir [*]
683 libhtml => installhtml3dir installsitehtml3dir installvendorhtml3dir [*]
684
685 * Under some OS (eg. MSWin32) the destination for HTML documents is
686 determined by the C<Config.pm> entry C<installhtmldir>.
687
688 The default value of "installdirs" is "site". If you're creating
689 vendor distributions of module packages, you may want to do
690 something like this:
691
692 perl Build.PL --installdirs vendor
693
694 or
695
696 ./Build install --installdirs vendor
697
698 If you're installing an updated version of a module that was
699 included with perl itself (i.e. a "core module"), then you may set
700 "installdirs" to "core" to overwrite the module in its present
701 location.
702
703 (Note that the 'script' line is different from "MakeMaker" -
704 unfortunately there's no such thing as "installsitescript" or
705 "installvendorscript" entry in "Config.pm", so we use the
706 "installsitebin" and "installvendorbin" entries to at least get the
707 general location right. In the future, if "Config.pm" adds some
708 more appropriate entries, we'll start using those.)
709
710 install_path
711 Once the defaults have been set, you can override them.
712
713 On the command line, that would look like this:
714
715 perl Build.PL --install_path lib=/foo/lib --install_path arch=/foo/lib/arch
716
717 or this:
718
719 ./Build install --install_path lib=/foo/lib --install_path arch=/foo/lib/arch
720
721 install_base
722 You can also set the whole bunch of installation paths by supplying
723 the "install_base" parameter to point to a directory on your
724 system. For instance, if you set "install_base" to "/home/ken" on
725 a Linux system, you'll install as follows:
726
727 lib => /home/ken/lib/perl5
728 arch => /home/ken/lib/perl5/i386-linux
729 script => /home/ken/bin
730 bin => /home/ken/bin
731 bindoc => /home/ken/man/man1
732 libdoc => /home/ken/man/man3
733 binhtml => /home/ken/html
734 libhtml => /home/ken/html
735
736 Note that this is different from how "MakeMaker"'s "PREFIX"
737 parameter works. "install_base" just gives you a default layout
738 under the directory you specify, which may have little to do with
739 the "installdirs=site" layout.
740
741 The exact layout under the directory you specify may vary by system
742 - we try to do the "sensible" thing on each platform.
743
744 destdir
745 If you want to install everything into a temporary directory first
746 (for instance, if you want to create a directory tree that a
747 package manager like "rpm" or "dpkg" could create a package from),
748 you can use the "destdir" parameter:
749
750 perl Build.PL --destdir /tmp/foo
751
752 or
753
754 ./Build install --destdir /tmp/foo
755
756 This will effectively install to "/tmp/foo/$sitelib",
757 "/tmp/foo/$sitearch", and the like, except that it will use
758 "File::Spec" to make the pathnames work correctly on whatever
759 platform you're installing on.
760
761 prefix
762 Provided for compatibility with "ExtUtils::MakeMaker"'s PREFIX
763 argument. "prefix" should be used when you wish Module::Build to
764 install your modules, documentation and scripts in the same place
765 "ExtUtils::MakeMaker" does.
766
767 The following are equivalent.
768
769 perl Build.PL --prefix /tmp/foo
770 perl Makefile.PL PREFIX=/tmp/foo
771
772 Because of the very complex nature of the prefixification logic,
773 the behavior of PREFIX in "MakeMaker" has changed subtly over time.
774 Module::Build's --prefix logic is equivalent to the PREFIX logic
775 found in "ExtUtils::MakeMaker" 6.30.
776
777 If you do not need to retain compatibility with
778 "ExtUtils::MakeMaker" or are starting a fresh Perl installation we
779 recommend you use "install_base" instead (and "INSTALL_BASE" in
780 "ExtUtils::MakeMaker"). See "Instaling in the same location as
781 ExtUtils::MakeMaker" in Module::Build::Cookbook for further
782 information.
783
785 There are several reasons I wanted to start over, and not just fix what
786 I didn't like about "MakeMaker":
787
788 · I don't like the core idea of "MakeMaker", namely that "make"
789 should be involved in the build process. Here are my reasons:
790
791 + When a person is installing a Perl module, what can you assume
792 about their environment? Can you assume they have "make"? No,
793 but you can assume they have some version of Perl.
794
795 + When a person is writing a Perl module for intended
796 distribution, can you assume that they know how to build a
797 Makefile, so they can customize their build process? No, but
798 you can assume they know Perl, and could customize that way.
799
800 For years, these things have been a barrier to people getting the
801 build/install process to do what they want.
802
803 · There are several architectural decisions in "MakeMaker" that make
804 it very difficult to customize its behavior. For instance, when
805 using "MakeMaker" you do "use ExtUtils::MakeMaker", but the object
806 created in "WriteMakefile()" is actually blessed into a package
807 name that's created on the fly, so you can't simply subclass
808 "ExtUtils::MakeMaker". There is a workaround "MY" package that
809 lets you override certain "MakeMaker" methods, but only certain
810 explicitly preselected (by "MakeMaker") methods can be overridden.
811 Also, the method of customization is very crude: you have to modify
812 a string containing the Makefile text for the particular target.
813 Since these strings aren't documented, and can't be documented
814 (they take on different values depending on the platform, version
815 of perl, version of "MakeMaker", etc.), you have no guarantee that
816 your modifications will work on someone else's machine or after an
817 upgrade of "MakeMaker" or perl.
818
819 · It is risky to make major changes to "MakeMaker", since it does so
820 many things, is so important, and generally works. "Module::Build"
821 is an entirely separate package so that I can work on it all I
822 want, without worrying about backward compatibility.
823
824 · Finally, Perl is said to be a language for system administration.
825 Could it really be the case that Perl isn't up to the task of
826 building and installing software? Even if that software is a bunch
827 of stupid little ".pm" files that just need to be copied from one
828 place to another? My sense was that we could design a system to
829 accomplish this in a flexible, extensible, and friendly manner. Or
830 die trying.
831
833 The current method of relying on time stamps to determine whether a
834 derived file is out of date isn't likely to scale well, since it
835 requires tracing all dependencies backward, it runs into problems on
836 NFS, and it's just generally flimsy. It would be better to use an MD5
837 signature or the like, if available. See "cons" for an example.
838
839 - append to perllocal.pod
840 - add a 'plugin' functionality
841
843 Ken Williams <kwilliams@cpan.org>
844
845 Development questions, bug reports, and patches should be sent to the
846 Module-Build mailing list at <module-build@perl.org>.
847
848 Bug reports are also welcome at
849 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build>.
850
851 The latest development version is available from the Subversion
852 repository at <https://svn.perl.org/modules/Module-Build/trunk/>
853
855 Copyright (c) 2001-2006 Ken Williams. All rights reserved.
856
857 This library is free software; you can redistribute it and/or modify it
858 under the same terms as Perl itself.
859
861 perl(1), Module::Build::Cookbook, Module::Build::Authoring,
862 Module::Build::API, ExtUtils::MakeMaker, YAML
863
864 META.yml Specification:
865 <http://module-build.sourceforge.net/META-spec-current.html>
866
867 <http://www.dsmit.com/cons/>
868
869 <http://search.cpan.org/dist/PerlBuildSystem/>
870
871
872
873perl v5.10.1 2017-03-22 Module::Build(3pm)