📄 module::build::compat.3
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...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" '''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 turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD. Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\. de IX. tm Index:\\$1\t\\n%\t"\\$2"... nr % 0. rr F.\}.el \{\. de IX...\}.\".\" 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 "2007-12-18" "perl v5.10.0" "Perl Programmers Reference Guide".\" 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 => \*(Aqpassthrough\*(Aq );\& ....Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"Because ExtUtils::MakeMaker has been the standard way to distributemodules for a long time, many tools (\s-1CPAN\s0.pm, or your systemadministrator) may expect to find a working Makefile.PL in everydistribution they download from \s-1CPAN\s0. If you want to throw them abone, you can use Module::Build::Compat to automatically generate aMakefile.PL for you, in one of several different styles..PPModule::Build::Compat also provides some code that helps out theMakefile.PL 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 Makefile.PL in the current directory in one of severalstyles, based on the supplied Module::Build object \f(CW$build\fR. This istypically controlled by passing the desired style as the\&\f(CW\*(C`create_makefile_pl\*(C'\fR parameter to Module::Build's \f(CW\*(C`new()\*(C'\fR method;the Makefile.PL will then be automatically created during the\&\f(CW\*(C`distdir\*(C'\fR action..SpThe currently supported styles are:.RS 4.IP "small" 4.IX Item "small"A small Makefile.PL will be created that passes all functionalitythrough to the Build.PL script in the same directory. The user mustalready have Module::Build installed in order to use this, or elsethey'll get a module-not-found error..IP "passthrough" 4.IX Item "passthrough"This is just like the \f(CW\*(C`small\*(C'\fR option above, but if Module::Build isnot already installed on the user's system, the script will offer touse \f(CW\*(C`CPAN.pm\*(C'\fR to download it and install it before continuing withthe build..IP "traditional" 4.IX Item "traditional"A Makefile.PL will be created in the \*(L"traditional\*(R" style, i.e. it willuse \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 Makefile.PL, 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..SpYou don't want to use this style if during the \f(CW\*(C`perl Build.PL\*(C'\fR stageyou ask the user questions, or do some auto-sensing about the user'senvironment, or if you subclass Module::Build to do somecustomization, because the vanilla Makefile.PL won't do any of that..RE.RS 4.RE.IP "run_build_pl(args => \e@ARGV)" 4.IX Item "run_build_pl(args => @ARGV)"This method runs the Build.PL script, passing it any arguments theuser may have supplied to the \f(CW\*(C`perl Makefile.PL\*(C'\fR command. BecauseExtUtils::MakeMaker and Module::Build accept different arguments, thismethod 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 usuallyappear 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 "\fIwrite_makefile()\fR" 4.IX Item "write_makefile()"This method writes a 'dummy' Makefile that will pass all commandsthrough to the corresponding Module::Build 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." 4Just include a Build.PL script (without a Makefile.PLscript), and give installation directions in a \s-1README\s0 or \s-1INSTALL\s0document explaining how to install the module. In particular, explainthat the user must install Module::Build before installing yourmodule..SpNote that if you do this, you may make things easier for yourself, butharder for people with older versions of \s-1CPAN\s0 or \s-1CPANPLUS\s0 on theirsystem, because those tools generally only understand the\&\fIMakefile.PL\fR/\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR way of doing things..IP "2." 4Include a Build.PL script and a \*(L"traditional\*(R" Makefile.PL,created either manually or with \f(CW\*(C`create_makefile_pl()\*(C'\fR. Users won'tever have to install Module::Build if they use the Makefile.PL, butthey won't get to take advantage of Module::Build's extra featureseither..SpIf you go this route, make sure you explicitly set \f(CW\*(C`PL_FILES\*(C'\fR in thecall to \f(CW\*(C`WriteMakefile()\*(C'\fR (probably to an empty hash reference), orelse MakeMaker will mistakenly run the Build.PL and you'll get anerror message about \*(L"Too early to run Build script\*(R" or something. Forgood measure, of course, test both the \fIMakefile.PL\fR and the\&\fIBuild.PL\fR before shipping..IP "3." 4Include a Build.PL script and a \*(L"pass-through\*(R" Makefile.PLbuilt using Module::Build::Compat. This will mean that people cancontinue to use the \*(L"old\*(R" installation commands, and they may nevernotice that it's actually doing something else behind the scenes. Itwill also mean that your installation process is compatible with olderversions 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..PPThis library is free software; you can redistribute it and/ormodify it under the same terms as Perl itself..SH "SEE ALSO".IX Header "SEE ALSO"Module::Build(3), ExtUtils::MakeMaker(3)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -