3 # This module doesn't do much of anything itself, it inherits from the
4 # modules that do the real work. The only real thing it has to do is
5 # figure out which OS-specific module to pull in. Many of the
6 # OS-specific modules don't do anything either - most of the work is
7 # done in Module::Build::Base.
12 use File::Basename ();
14 use Module::Build::Base;
16 use vars qw($VERSION @ISA);
17 @ISA = qw(Module::Build::Base);
19 $VERSION = eval $VERSION;
21 # Okay, this is the brute-force method of finding out what kind of
22 # platform we're on. I don't know of a systematic way. These values
23 # came from the latest (bleadperl) perlport.pod.
75 # Inserts the given module into the @ISA hierarchy between
76 # Module::Build and its immediate parent
77 sub _interpose_module {
78 my ($self, $mod) = @_;
84 while (@{"${top_class}::ISA"}) {
85 last if ${"${top_class}::ISA"}[0] eq $ISA[0];
86 $top_class = ${"${top_class}::ISA"}[0];
89 @{"${top_class}::ISA"} = @ISA;
93 if (grep {-e File::Spec->catfile($_, qw(Module Build Platform), $^O) . '.pm'} @INC) {
94 __PACKAGE__->_interpose_module("Module::Build::Platform::$^O");
96 } elsif (exists $OSTYPES{$^O}) {
97 __PACKAGE__->_interpose_module("Module::Build::Platform::$OSTYPES{$^O}");
100 warn "Unknown OS type '$^O' - using default settings\n";
103 sub os_type { $OSTYPES{$^O} }
105 sub is_vmsish { return ((os_type() || '') eq 'VMS') }
106 sub is_windowsish { return ((os_type() || '') eq 'Windows') }
107 sub is_unixish { return ((os_type() || '') eq 'Unix') }
114 bindoc binhtml destdir distcheck distclean distdir distmeta distsign disttest
115 fakeinstall html installdirs installsitebin installsitescript installvendorbin
116 installvendorscript libdoc libhtml pardist ppd ppmdist realclean skipcheck
117 testall testcover testdb testpod testpodcoverage versioninstall
121 Module::Build - Build and install Perl modules
126 Standard process for building & installing modules:
133 Or, if you're on a platform (like DOS or Windows) that doesn't require
134 the "./" notation, you can do this:
144 C<Module::Build> is a system for building, testing, and installing
145 Perl modules. It is meant to be an alternative to
146 C<ExtUtils::MakeMaker>. Developers may alter the behavior of the
147 module through subclassing in a much more straightforward way than
148 with C<MakeMaker>. It also does not require a C<make> on your system
149 - most of the C<Module::Build> code is pure-perl and written in a very
150 cross-platform way. In fact, you don't even need a shell, so even
151 platforms like MacOS (traditional) can use it fairly easily. Its only
152 prerequisites are modules that are included with perl 5.6.0, and it
153 works fine on perl 5.005 if you can install a few additional modules.
155 See L<"MOTIVATIONS"> for more comparisons between C<ExtUtils::MakeMaker>
156 and C<Module::Build>.
158 To install C<Module::Build>, and any other module that uses
159 C<Module::Build> for its installation process, do the following:
161 perl Build.PL # 'Build.PL' script creates the 'Build' script
162 ./Build # Need ./ to ensure we're using this "Build" script
163 ./Build test # and not another one that happens to be in the PATH
166 This illustrates initial configuration and the running of three
167 'actions'. In this case the actions run are 'build' (the default
168 action), 'test', and 'install'. Other actions defined so far include:
176 distcheck pure_install
186 install versioninstall
190 You can run the 'help' action for a complete list of actions.
193 =head1 GUIDE TO DOCUMENTATION
195 The documentation for C<Module::Build> is broken up into three sections:
199 =item General Usage (L<Module::Build>)
201 This is the document you are currently reading. It describes basic
202 usage and background information. Its main purpose is to assist the
203 user who wants to learn how to invoke and control C<Module::Build>
204 scripts at the command line.
206 =item Authoring Reference (L<Module::Build::Authoring>)
208 This document describes the structure and organization of
209 C<Module::Build>, and the relevant concepts needed by authors who are
210 writing F<Build.PL> scripts for a distribution or controlling
211 C<Module::Build> processes programmatically.
213 =item API Reference (L<Module::Build::API>)
215 This is a reference to the C<Module::Build> API.
217 =item Cookbook (L<Module::Build::Cookbook>)
219 This document demonstrates how to accomplish many common tasks. It
220 covers general command line usage and authoring of F<Build.PL>
221 scripts. Includes working examples.
228 There are some general principles at work here. First, each task when
229 building a module is called an "action". These actions are listed
230 above; they correspond to the building, testing, installing,
231 packaging, etc., tasks.
233 Second, arguments are processed in a very systematic way. Arguments
234 are always key=value pairs. They may be specified at C<perl Build.PL>
235 time (i.e. C<perl Build.PL destdir=/my/secret/place>), in which case
236 their values last for the lifetime of the C<Build> script. They may
237 also be specified when executing a particular action (i.e.
238 C<Build test verbose=1>), in which case their values last only for the
239 lifetime of that command. Per-action command line parameters take
240 precedence over parameters specified at C<perl Build.PL> time.
242 The build process also relies heavily on the C<Config.pm> module.
243 If the user wishes to override any of the
244 values in C<Config.pm>, she may specify them like so:
246 perl Build.PL --config cc=gcc --config ld=gcc
248 The following build actions are provided by default.
256 If you run the C<Build> script without any arguments, it runs the
257 C<build> action, which in turn runs the C<code> and C<docs> actions.
259 This is analogous to the C<MakeMaker> I<make all> target.
265 This action will clean up any files that the build process may have
266 created, including the C<blib/> directory (but not including the
267 C<_build/> directory and the C<Build> script itself).
273 This action builds your code base.
275 By default it just creates a C<blib/> directory and copies any C<.pm>
276 and C<.pod> files from your C<lib/> directory into the C<blib/>
277 directory. It also compiles any C<.xs> files from C<lib/> and places
278 them in C<blib/>. Of course, you need a working C compiler (probably
279 the same one that built perl itself) for the compilation to work
282 The C<code> action also runs any C<.PL> files in your F<lib/>
283 directory. Typically these create other files, named the same but
284 without the C<.PL> ending. For example, a file F<lib/Foo/Bar.pm.PL>
285 could create the file F<lib/Foo/Bar.pm>. The C<.PL> files are
286 processed first, so any C<.pm> files (or other kinds that we deal
287 with) will get copied correctly.
299 This action will compare the files about to be installed with their
300 installed counterparts. For .pm and .pod files, a diff will be shown
301 (this currently requires a 'diff' program to be in your PATH). For
302 other files like compiled binary files, we simply report whether they
305 A C<flags> parameter may be passed to the action, which will be passed
306 to the 'diff' program. Consult your 'diff' documentation for the
307 parameters it will accept - a good one is C<-u>:
309 ./Build diff flags=-u
315 This action is helpful for module authors who want to package up their
316 module for source distribution through a medium like CPAN. It will create a
317 tarball of the files listed in F<MANIFEST> and compress the tarball using
320 By default, this action will use the C<Archive::Tar> module. However, you can
321 force it to use binary "tar" and "gzip" executables by supplying an explicit
322 C<tar> (and optional C<gzip>) parameter:
324 ./Build dist --tar C:\path\to\tar.exe --gzip C:\path\to\zip.exe
330 Reports which files are in the build directory but not in the
331 F<MANIFEST> file, and vice versa. (See L<manifest> for details.)
337 Performs the 'realclean' action and then the 'distcheck' action.
343 Creates a "distribution directory" named C<$dist_name-$dist_version>
344 (if that directory already exists, it will be removed first), then
345 copies all the files listed in the F<MANIFEST> file to that directory.
346 This directory is what the distribution tarball is created from.
352 Creates the F<META.yml> file that describes the distribution.
354 F<META.yml> is a file containing various bits of I<metadata> about the
355 distribution. The metadata includes the distribution name, version,
356 abstract, prerequisites, license, and various other data about the
357 distribution. This file is created as F<META.yml> in YAML format.
358 It is recommended that the C<YAML> module be installed to create it.
359 If the C<YAML> module is not installed, an internal module supplied
360 with Module::Build will be used to write the META.yml file, and this
361 will most likely be fine.
363 F<META.yml> file must also be listed in F<MANIFEST> - if it's not, a
364 warning will be issued.
366 The current version of the F<META.yml> specification can be found at
367 L<http://module-build.sourceforge.net/META-spec-current.html>
373 Uses C<Module::Signature> to create a SIGNATURE file for your
374 distribution, and adds the SIGNATURE file to the distribution's
381 Performs the 'distdir' action, then switches into that directory and
382 runs a C<perl Build.PL>, followed by the 'build' and 'test' actions in
389 This will generate documentation (e.g. Unix man pages and HTML
390 documents) for any installable items under B<blib/> that
391 contain POD. If there are no C<bindoc> or C<libdoc> installation
392 targets defined (as will be the case on systems that don't support
393 Unix manpages) no action is taken for manpages. If there are no
394 C<binhtml> or C<libhtml> installation targets defined no action is
395 taken for HTML documents.
401 This is just like the C<install> action, but it won't actually do
402 anything, it will just report what it I<would> have done if you had
403 actually run the C<install> action.
409 This action will simply print out a message that is meant to help you
410 use the build process. It will show you a list of available build
413 With an optional argument specifying an action name (e.g. C<Build help
414 test>), the 'help' action will show you any POD documentation it can
415 find for that action.
421 This will generate HTML documentation for any binary or library files
422 under B<blib/> that contain POD. The HTML documentation will only be
423 installed if the install paths can be determined from values in
424 C<Config.pm>. You can also supply or override install paths on the
425 command line by specifying C<install_path> values for the C<binhtml>
426 and/or C<libhtml> installation targets.
432 This action will use C<ExtUtils::Install> to install the files from
433 C<blib/> into the system. See L<"INSTALL PATHS">
434 for details about how Module::Build determines where to install
435 things, and how to influence this process.
437 If you want the installation process to look around in C<@INC> for
438 other versions of the stuff you're installing and try to delete it,
439 you can use the C<uninst> parameter, which tells C<ExtUtils::Install> to
442 ./Build install uninst=1
444 This can be a good idea, as it helps prevent multiple versions of a
445 module from being present on your system, which can be a confusing
452 This is an action intended for use by module authors, not people
453 installing modules. It will bring the F<MANIFEST> up to date with the
454 files currently present in the distribution. You may use a
455 F<MANIFEST.SKIP> file to exclude certain files or directories from
456 inclusion in the F<MANIFEST>. F<MANIFEST.SKIP> should contain a bunch
457 of regular expressions, one per line. If a file in the distribution
458 directory matches any of the regular expressions, it won't be included
461 The following is a reasonable F<MANIFEST.SKIP> starting point, you can
462 add your own stuff to it:
472 See the L<distcheck> and L<skipcheck> actions if you want to find out
473 what the C<manifest> action would do, without actually doing anything.
479 This will generate man pages for any binary or library files under
480 B<blib/> that contain POD. The man pages will only be installed if the
481 install paths can be determined from values in C<Config.pm>. You can
482 also supply or override install paths by specifying there values on
483 the command line with the C<bindoc> and C<libdoc> installation
490 Generates a PAR binary distribution for use with L<PAR> or L<PAR::Dist>.
492 It requires that the PAR::Dist module (version 0.17 and up) is
493 installed on your system.
499 Build a PPD file for your distribution.
501 This action takes an optional argument C<codebase> which is used in
502 the generated PPD file to specify the (usually relative) URL of the
503 distribution. By default, this value is the distribution name without
504 any path information.
508 ./Build ppd --codebase "MSWin32-x86-multi-thread/Module-Build-0.21.tar.gz"
514 Generates a PPM binary distribution and a PPD description file. This
515 action also invokes the C<ppd> action, so it can accept the same
516 C<codebase> argument described under that action.
518 This uses the same mechanism as the C<dist> action to tar & zip its
519 output, so you can supply C<tar> and/or C<gzip> parameters to affect
526 This action prints out a Perl data structure of all prerequisites and the versions
527 required. The output can be loaded again using C<eval()>. This can be useful for
528 external tools that wish to query a Build script for prerequisites.
534 This action prints out a list of all prerequisites, the versions required, and
535 the versions actually installed. This can be useful for reviewing the
536 configuration of your system prior to a build, or when compiling data to send
543 This action is identical to the C<install> action. In the future,
544 though, when C<install> starts writing to the file
545 F<$(INSTALLARCHLIB)/perllocal.pod>, C<pure_install> won't, and that
546 will be the only difference between them.
552 This action is just like the C<clean> action, but also removes the
553 C<_build> directory and the C<Build> script. If you run the
554 C<realclean> action, you are essentially starting over, so you will
555 have to re-create the C<Build> script again.
561 This is just like the C<test> action, but doesn't actually build the
562 distribution first, and doesn't add F<blib/> to the load path, and
563 therefore will test against a I<previously> installed version of the
564 distribution. This can be used to verify that a certain installed
565 distribution still works, or to see whether newer versions of a
566 distribution still pass the old regression tests, and so on.
572 Reports which files are skipped due to the entries in the
573 F<MANIFEST.SKIP> file (See L<manifest> for details)
579 This will use C<Test::Harness> or C<TAP::Harness> to run any regression
580 tests and report their results. Tests can be defined in the standard
581 places: a file called C<test.pl> in the top-level directory, or several
582 files ending with C<.t> in a C<t/> directory.
584 If you want tests to be 'verbose', i.e. show details of test execution
585 rather than just summary information, pass the argument C<verbose=1>.
587 If you want to run tests under the perl debugger, pass the argument
590 If you want to have Module::Build find test files with different file
591 name extensions, pass the C<test_file_exts> argument with an array
592 of extensions, such as C<[qw( .t .s .z )]>.
594 If you want test to be run by C<TAP::Harness>, rather than C<Test::Harness>,
595 pass the argument C<tap_harness_args> as an array reference of arguments to
596 pass to the TAP::Harness constructor.
598 In addition, if a file called C<visual.pl> exists in the top-level
599 directory, this file will be executed as a Perl script and its output
600 will be shown to the user. This is a good place to put speed tests or
601 other tests that don't use the C<Test::Harness> format for output.
603 To override the choice of tests to run, you may pass a C<test_files>
604 argument whose value is a whitespace-separated list of test scripts to
605 run. This is especially useful in development, when you only want to
606 run a single test to see whether you've squashed a certain bug yet:
608 ./Build test --test_files t/something_failing.t
610 You may also pass several C<test_files> arguments separately:
612 ./Build test --test_files t/one.t --test_files t/two.t
614 or use a C<glob()>-style pattern:
616 ./Build test --test_files 't/01-*.t'
622 [Note: the 'testall' action and the code snippets below are currently
624 L<"http://www.nntp.perl.org/group/perl.module.build/2007/03/msg584.html"> ]
626 Runs the C<test> action plus each of the C<test$type> actions defined by
627 the keys of the C<test_types> parameter.
629 Currently, you need to define the ACTION_test$type method yourself and
630 enumerate them in the test_types parameter.
632 my $mb = Module::Build->subclass(
634 sub ACTION_testspecial { shift->generic_test(type => 'special'); }
635 sub ACTION_testauthor { shift->generic_test(type => 'author'); }
641 author => ['.at', '.pt' ],
649 Runs the C<test> action using C<Devel::Cover>, generating a
650 code-coverage report showing which parts of the code were actually
651 exercised during the tests.
653 To pass options to C<Devel::Cover>, set the C<$DEVEL_COVER_OPTIONS>
654 environment variable:
656 DEVEL_COVER_OPTIONS=-ignore,Build ./Build testcover
662 This is a synonym for the 'test' action with the C<debugger=1>
669 This checks all the files described in the C<docs> action and
670 produces C<Test::Harness>-style output. If you are a module author,
671 this is useful to run before creating a new release.
673 =item testpodcoverage
677 This checks the pod coverage of the distribution and
678 produces C<Test::Harness>-style output. If you are a module author,
679 this is useful to run before creating a new release.
685 ** Note: since C<only.pm> is so new, and since we just recently added
686 support for it here too, this feature is to be considered
689 If you have the C<only.pm> module installed on your system, you can
690 use this action to install a module into the version-specific library
691 trees. This means that you can have several versions of the same
692 module installed and C<use> a specific one like this:
694 use only MyModule => 0.55;
696 To override the default installation libraries in C<only::config>,
697 specify the C<versionlib> parameter when you run the C<Build.PL> script:
699 perl Build.PL --versionlib /my/version/place/
701 To override which version the module is installed as, specify the
702 C<versionlib> parameter when you run the C<Build.PL> script:
704 perl Build.PL --version 0.50
706 See the C<only.pm> documentation for more information on
707 version-specific installs.
714 =head2 Command Line Options
716 The following options can be used during any invocation of C<Build.PL>
717 or the Build script, during any action. For information on other
718 options specific to an action, see the documentation for the
721 NOTE: There is some preliminary support for options to use the more
722 familiar long option style. Most options can be preceded with the
723 C<--> long option prefix, and the underscores changed to dashes
724 (e.g. C<--use-rcfile>). Additionally, the argument to boolean options is
725 optional, and boolean options can be negated by prefixing them with
726 C<no> or C<no-> (e.g. C<--noverbose> or C<--no-verbose>).
732 Suppress informative messages on output.
736 Load the F<~/.modulebuildrc> option file. This option can be set to
737 false to prevent the custom resource file from being loaded.
741 Display extra information about the Build on output.
743 =item allow_mb_mismatch
745 Suppresses the check upon startup that the version of Module::Build
746 we're now running under is the same version that was initially invoked
747 when building the distribution (i.e. when the C<Build.PL> script was
748 first run). Use with caution.
752 Prints Module::Build debugging information to STDOUT, such as a trace of
753 executed build actions.
758 =head2 Default Options File (F<.modulebuildrc>)
762 When Module::Build starts up, it will look first for a file,
763 F<$ENV{HOME}/.modulebuildrc>. If it's not found there, it will look
764 in the the F<.modulebuildrc> file in the directories referred to by
765 the environment variables C<HOMEDRIVE> + C<HOMEDIR>, C<USERPROFILE>,
766 C<APPDATA>, C<WINDIR>, C<SYS$LOGIN>. If the file exists, the options
767 specified there will be used as defaults, as if they were typed on the
768 command line. The defaults can be overridden by specifying new values
771 The action name must come at the beginning of the line, followed by any
772 amount of whitespace and then the options. Options are given the same
773 as they would be on the command line. They can be separated by any
774 amount of whitespace, including newlines, as long there is whitespace at
775 the beginning of each continued line. Anything following a hash mark (C<#>)
776 is considered a comment, and is stripped before parsing. If more than
777 one line begins with the same action name, those lines are merged into
780 Besides the regular actions, there are two special pseudo-actions: the
781 key C<*> (asterisk) denotes any global options that should be applied
782 to all actions, and the key 'Build_PL' specifies options to be applied
783 when you invoke C<perl Build.PL>.
785 * verbose=1 # global options
787 install --install_base /home/ken
788 --install_path html=/home/ken/docs/html
790 If you wish to locate your resource file in a different location, you
791 can set the environment variable C<MODULEBUILDRC> to the complete
792 absolute path of the file containing your options.
799 When you invoke Module::Build's C<build> action, it needs to figure
800 out where to install things. The nutshell version of how this works
801 is that default installation locations are determined from
802 F<Config.pm>, and they may be overridden by using the C<install_path>
803 parameter. An C<install_base> parameter lets you specify an
804 alternative installation root like F</home/foo>, and a C<destdir> lets
805 you specify a temporary installation directory like F</tmp/install> in
806 case you want to create bundled-up installable packages.
808 Natively, Module::Build provides default installation locations for
809 the following types of installable items:
815 Usually pure-Perl module files ending in F<.pm>.
819 "Architecture-dependent" module files, usually produced by compiling
820 XS, L<Inline>, or similar code.
824 Programs written in pure Perl. In order to improve reuse, try to make
825 these as small as possible - put the code into modules whenever
830 "Architecture-dependent" executable programs, i.e. compiled C code or
831 something. Pretty rare to see this in a perl distribution, but it
836 Documentation for the stuff in C<script> and C<bin>. Usually
837 generated from the POD in those files. Under Unix, these are manual
838 pages belonging to the 'man1' category.
842 Documentation for the stuff in C<lib> and C<arch>. This is usually
843 generated from the POD in F<.pm> files. Under Unix, these are manual
844 pages belonging to the 'man3' category.
848 This is the same as C<bindoc> above, but applies to HTML documents.
852 This is the same as C<bindoc> above, but applies to HTML documents.
856 Four other parameters let you control various aspects of how
857 installation paths are determined:
863 The default destinations for these installable things come from
864 entries in your system's C<Config.pm>. You can select from three
865 different sets of default locations by setting the C<installdirs>
866 parameter as follows:
868 'installdirs' set to:
871 uses the following defaults from Config.pm:
873 lib => installprivlib installsitelib installvendorlib
874 arch => installarchlib installsitearch installvendorarch
875 script => installscript installsitebin installvendorbin
876 bin => installbin installsitebin installvendorbin
877 bindoc => installman1dir installsiteman1dir installvendorman1dir
878 libdoc => installman3dir installsiteman3dir installvendorman3dir
879 binhtml => installhtml1dir installsitehtml1dir installvendorhtml1dir [*]
880 libhtml => installhtml3dir installsitehtml3dir installvendorhtml3dir [*]
882 * Under some OS (eg. MSWin32) the destination for HTML documents is
883 determined by the C<Config.pm> entry C<installhtmldir>.
885 The default value of C<installdirs> is "site". If you're creating
886 vendor distributions of module packages, you may want to do something
889 perl Build.PL --installdirs vendor
893 ./Build install --installdirs vendor
895 If you're installing an updated version of a module that was included
896 with perl itself (i.e. a "core module"), then you may set
897 C<installdirs> to "core" to overwrite the module in its present
900 (Note that the 'script' line is different from C<MakeMaker> -
901 unfortunately there's no such thing as "installsitescript" or
902 "installvendorscript" entry in C<Config.pm>, so we use the
903 "installsitebin" and "installvendorbin" entries to at least get the
904 general location right. In the future, if C<Config.pm> adds some more
905 appropriate entries, we'll start using those.)
909 Once the defaults have been set, you can override them.
911 On the command line, that would look like this:
913 perl Build.PL --install_path lib=/foo/lib --install_path arch=/foo/lib/arch
917 ./Build install --install_path lib=/foo/lib --install_path arch=/foo/lib/arch
921 You can also set the whole bunch of installation paths by supplying the
922 C<install_base> parameter to point to a directory on your system. For
923 instance, if you set C<install_base> to "/home/ken" on a Linux
924 system, you'll install as follows:
926 lib => /home/ken/lib/perl5
927 arch => /home/ken/lib/perl5/i386-linux
928 script => /home/ken/bin
930 bindoc => /home/ken/man/man1
931 libdoc => /home/ken/man/man3
932 binhtml => /home/ken/html
933 libhtml => /home/ken/html
935 Note that this is I<different> from how C<MakeMaker>'s C<PREFIX>
936 parameter works. C<install_base> just gives you a default layout under the
937 directory you specify, which may have little to do with the
938 C<installdirs=site> layout.
940 The exact layout under the directory you specify may vary by system -
941 we try to do the "sensible" thing on each platform.
945 If you want to install everything into a temporary directory first
946 (for instance, if you want to create a directory tree that a package
947 manager like C<rpm> or C<dpkg> could create a package from), you can
948 use the C<destdir> parameter:
950 perl Build.PL --destdir /tmp/foo
954 ./Build install --destdir /tmp/foo
956 This will effectively install to "/tmp/foo/$sitelib",
957 "/tmp/foo/$sitearch", and the like, except that it will use
958 C<File::Spec> to make the pathnames work correctly on whatever
959 platform you're installing on.
963 Provided for compatibility with C<ExtUtils::MakeMaker>'s PREFIX argument.
964 C<prefix> should be used when you wish Module::Build to install your
965 modules, documentation and scripts in the same place
966 C<ExtUtils::MakeMaker> does.
968 The following are equivalent.
970 perl Build.PL --prefix /tmp/foo
971 perl Makefile.PL PREFIX=/tmp/foo
973 Because of the very complex nature of the prefixification logic, the
974 behavior of PREFIX in C<MakeMaker> has changed subtly over time.
975 Module::Build's --prefix logic is equivalent to the PREFIX logic found
976 in C<ExtUtils::MakeMaker> 6.30.
978 If you do not need to retain compatibility with C<ExtUtils::MakeMaker> or
979 are starting a fresh Perl installation we recommend you use
980 C<install_base> instead (and C<INSTALL_BASE> in C<ExtUtils::MakeMaker>).
981 See L<Module::Build::Cookbook/Instaling in the same location as
982 ExtUtils::MakeMaker> for further information.
990 There are several reasons I wanted to start over, and not just fix
991 what I didn't like about C<MakeMaker>:
997 I don't like the core idea of C<MakeMaker>, namely that C<make> should be
998 involved in the build process. Here are my reasons:
1004 When a person is installing a Perl module, what can you assume about
1005 their environment? Can you assume they have C<make>? No, but you can
1006 assume they have some version of Perl.
1010 When a person is writing a Perl module for intended distribution, can
1011 you assume that they know how to build a Makefile, so they can
1012 customize their build process? No, but you can assume they know Perl,
1013 and could customize that way.
1017 For years, these things have been a barrier to people getting the
1018 build/install process to do what they want.
1022 There are several architectural decisions in C<MakeMaker> that make it
1023 very difficult to customize its behavior. For instance, when using
1024 C<MakeMaker> you do C<use ExtUtils::MakeMaker>, but the object created in
1025 C<WriteMakefile()> is actually blessed into a package name that's
1026 created on the fly, so you can't simply subclass
1027 C<ExtUtils::MakeMaker>. There is a workaround C<MY> package that lets
1028 you override certain C<MakeMaker> methods, but only certain explicitly
1029 preselected (by C<MakeMaker>) methods can be overridden. Also, the method
1030 of customization is very crude: you have to modify a string containing
1031 the Makefile text for the particular target. Since these strings
1032 aren't documented, and I<can't> be documented (they take on different
1033 values depending on the platform, version of perl, version of
1034 C<MakeMaker>, etc.), you have no guarantee that your modifications will
1035 work on someone else's machine or after an upgrade of C<MakeMaker> or
1040 It is risky to make major changes to C<MakeMaker>, since it does so many
1041 things, is so important, and generally works. C<Module::Build> is an
1042 entirely separate package so that I can work on it all I want, without
1043 worrying about backward compatibility.
1047 Finally, Perl is said to be a language for system administration.
1048 Could it really be the case that Perl isn't up to the task of building
1049 and installing software? Even if that software is a bunch of stupid
1050 little C<.pm> files that just need to be copied from one place to
1051 another? My sense was that we could design a system to accomplish
1052 this in a flexible, extensible, and friendly manner. Or die trying.
1059 The current method of relying on time stamps to determine whether a
1060 derived file is out of date isn't likely to scale well, since it
1061 requires tracing all dependencies backward, it runs into problems on
1062 NFS, and it's just generally flimsy. It would be better to use an MD5
1063 signature or the like, if available. See C<cons> for an example.
1065 - append to perllocal.pod
1066 - add a 'plugin' functionality
1071 Ken Williams <kwilliams@cpan.org>
1073 Development questions, bug reports, and patches should be sent to the
1074 Module-Build mailing list at <module-build@perl.org>.
1076 Bug reports are also welcome at
1077 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build>.
1079 The latest development version is available from the Subversion
1080 repository at <https://svn.perl.org/modules/Module-Build/trunk/>
1085 Copyright (c) 2001-2006 Ken Williams. All rights reserved.
1087 This library is free software; you can redistribute it and/or
1088 modify it under the same terms as Perl itself.
1093 perl(1), L<Module::Build::Cookbook>, L<Module::Build::Authoring>,
1094 L<Module::Build::API>, L<ExtUtils::MakeMaker>, L<YAML>
1096 F<META.yml> Specification:
1097 L<http://module-build.sourceforge.net/META-spec-current.html>
1099 L<http://www.dsmit.com/cons/>
1101 L<http://search.cpan.org/dist/PerlBuildSystem/>