.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Module::Build::Compat 3"
.TH Module::Build::Compat 3 "2019-10-13" "perl v5.26.3" "User Contributed Perl Documentation"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Module::Build::Compat \- Compatibility with ExtUtils::MakeMaker
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 7
\&  # In a Build.PL :
\&  use Module::Build;
\&  my $build = Module::Build\->new
\&    ( module_name => \*(AqFoo::Bar\*(Aq,
\&      license     => \*(Aqperl\*(Aq,
\&      create_makefile_pl => \*(Aqtraditional\*(Aq );
\&  ...
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Because \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR has been the standard way to distribute
modules for a long time, many tools (\s-1CPAN\s0.pm, or your system
administrator) may expect to find a working \fIMakefile.PL\fR in every
distribution they download from \s-1CPAN.\s0  If you want to throw them a
bone, you can use \f(CW\*(C`Module::Build::Compat\*(C'\fR to automatically generate a
\&\fIMakefile.PL\fR for you, in one of several different styles.
.PP
\&\f(CW\*(C`Module::Build::Compat\*(C'\fR also provides some code that helps out the
\&\fIMakefile.PL\fR at runtime.
.SH "METHODS"
.IX Header "METHODS"
.ie n .IP "create_makefile_pl($style, $build)" 4
.el .IP "create_makefile_pl($style, \f(CW$build\fR)" 4
.IX Item "create_makefile_pl($style, $build)"
Creates a \fIMakefile.PL\fR in the current directory in one of several
styles, based on the supplied \f(CW\*(C`Module::Build\*(C'\fR object \f(CW$build\fR.  This is
typically controlled by passing the desired style as the
\&\f(CW\*(C`create_makefile_pl\*(C'\fR parameter to \f(CW\*(C`Module::Build\*(C'\fR's \f(CW\*(C`new()\*(C'\fR method;
the \fIMakefile.PL\fR will then be automatically created during the
\&\f(CW\*(C`distdir\*(C'\fR action.
.Sp
The currently supported styles are:
.RS 4
.IP "traditional" 4
.IX Item "traditional"
A \fIMakefile.PL\fR will be created in the \*(L"traditional\*(R" style, i.e. it will
use \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR and won't rely on \f(CW\*(C`Module::Build\*(C'\fR at all.
In order to create the \fIMakefile.PL\fR, we'll include the \f(CW\*(C`requires\*(C'\fR and
\&\f(CW\*(C`build_requires\*(C'\fR dependencies as the \f(CW\*(C`PREREQ_PM\*(C'\fR parameter.
.Sp
You don't want to use this style if during the \f(CW\*(C`perl Build.PL\*(C'\fR stage
you ask the user questions, or do some auto-sensing about the user's
environment, or if you subclass \f(CW\*(C`Module::Build\*(C'\fR to do some
customization, because the vanilla \fIMakefile.PL\fR won't do any of that.
.IP "small" 4
.IX Item "small"
A small \fIMakefile.PL\fR will be created that passes all functionality
through to the \fIBuild.PL\fR script in the same directory.  The user must
already have \f(CW\*(C`Module::Build\*(C'\fR installed in order to use this, or else
they'll get a module-not-found error.
.IP "passthrough (\s-1DEPRECATED\s0)" 4
.IX Item "passthrough (DEPRECATED)"
This is just like the \f(CW\*(C`small\*(C'\fR option above, but if \f(CW\*(C`Module::Build\*(C'\fR is
not already installed on the user's system, the script will offer to
use \f(CW\*(C`CPAN.pm\*(C'\fR to download it and install it before continuing with
the build.
.Sp
This option has been deprecated and may be removed in a future version
of Module::Build.  Modern \s-1CPAN\s0.pm and \s-1CPANPLUS\s0 will recognize the
\&\f(CW\*(C`configure_requires\*(C'\fR metadata property and install Module::Build before
running Build.PL if Module::Build is listed and Module::Build now
adds itself to configure_requires by default.
.Sp
Perl 5.10.1 includes \f(CW\*(C`configure_requires\*(C'\fR support.  In the future, when
\&\f(CW\*(C`configure_requires\*(C'\fR support is deemed sufficiently widespread, the
\&\f(CW\*(C`passthrough\*(C'\fR style will be removed.
.RE
.RS 4
.RE
.IP "run_build_pl(args => \e@ARGV)" 4
.IX Item "run_build_pl(args => @ARGV)"
This method runs the \fIBuild.PL\fR script, passing it any arguments the
user may have supplied to the \f(CW\*(C`perl Makefile.PL\*(C'\fR command.  Because
\&\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR and \f(CW\*(C`Module::Build\*(C'\fR accept different arguments, this
method also performs some translation between the two.
.Sp
\&\f(CW\*(C`run_build_pl()\*(C'\fR accepts the following named parameters:
.RS 4
.IP "args" 4
.IX Item "args"
The \f(CW\*(C`args\*(C'\fR parameter specifies the parameters that would usually
appear on the command line of the \f(CW\*(C`perl Makefile.PL\*(C'\fR command \-
typically you'll just pass a reference to \f(CW@ARGV\fR.
.IP "script" 4
.IX Item "script"
This is the filename of the script to run \- it defaults to \f(CW\*(C`Build.PL\*(C'\fR.
.RE
.RS 4
.RE
.IP "\fBwrite_makefile()\fR" 4
.IX Item "write_makefile()"
This method writes a 'dummy' \fIMakefile\fR that will pass all commands
through to the corresponding \f(CW\*(C`Module::Build\*(C'\fR actions.
.Sp
\&\f(CW\*(C`write_makefile()\*(C'\fR accepts the following named parameters:
.RS 4
.IP "makefile" 4
.IX Item "makefile"
The name of the file to write \- defaults to the string \f(CW\*(C`Makefile\*(C'\fR.
.RE
.RS 4
.RE
.SH "SCENARIOS"
.IX Header "SCENARIOS"
So, some common scenarios are:
.IP "1." 4
Just include a \fIBuild.PL\fR script (without a \fIMakefile.PL\fR
script), and give installation directions in a \fI\s-1README\s0\fR or \fI\s-1INSTALL\s0\fR
document explaining how to install the module.  In particular, explain
that the user must install \f(CW\*(C`Module::Build\*(C'\fR before installing your
module.
.Sp
Note that if you do this, you may make things easier for yourself, but
harder for people with older versions of \s-1CPAN\s0 or \s-1CPANPLUS\s0 on their
system, because those tools generally only understand the
\&\fIMakefile.PL\fR/\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR way of doing things.
.IP "2." 4
Include a \fIBuild.PL\fR script and a \*(L"traditional\*(R" \fIMakefile.PL\fR,
created either manually or with \f(CW\*(C`create_makefile_pl()\*(C'\fR.  Users won't
ever have to install \f(CW\*(C`Module::Build\*(C'\fR if they use the \fIMakefile.PL\fR, but
they won't get to take advantage of \f(CW\*(C`Module::Build\*(C'\fR's extra features
either.
.Sp
For good measure, of course, test both the \fIMakefile.PL\fR and the
\&\fIBuild.PL\fR before shipping.
.IP "3." 4
Include a \fIBuild.PL\fR script and a \*(L"pass-through\*(R" \fIMakefile.PL\fR
built using \f(CW\*(C`Module::Build::Compat\*(C'\fR.  This will mean that people can
continue to use the \*(L"old\*(R" installation commands, and they may never
notice that it's actually doing something else behind the scenes.  It
will also mean that your installation process is compatible with older
versions of tools like \s-1CPAN\s0 and \s-1CPANPLUS.\s0
.SH "AUTHOR"
.IX Header "AUTHOR"
Ken Williams <kwilliams@cpan.org>
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 2001\-2006 Ken Williams.  All rights reserved.
.PP
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Module::Build(3), ExtUtils::MakeMaker(3)
