📄 extutils::mm_any.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 "ExtUtils::MM_Any 3".TH ExtUtils::MM_Any 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"ExtUtils::MM_Any \- Platform\-agnostic MM methods.SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 1\& FOR INTERNAL USE ONLY!\&\& package ExtUtils::MM_SomeOS;\&\& # Temporarily, you have to subclass both. Put MM_Any first.\& require ExtUtils::MM_Any;\& require ExtUtils::MM_Unix;\& @ISA = qw(ExtUtils::MM_Any ExtUtils::Unix);.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"\&\fB\s-1FOR\s0 \s-1INTERNAL\s0 \s-1USE\s0 \s-1ONLY\s0!\fR.PPExtUtils::MM_Any is a superclass for the ExtUtils::MM_* set ofmodules. It contains methods which are either inherentlycross-platform or are written in a cross-platform manner..PPSubclass off of ExtUtils::MM_Any \fIand\fR ExtUtils::MM_Unix. This is atemporary solution..PP\&\fB\s-1THIS\s0 \s-1MAY\s0 \s-1BE\s0 \s-1TEMPORARY\s0!\fR.SH "METHODS".IX Header "METHODS"Any methods marked \fIAbstract\fR must be implemented by subclasses..Sh "Cross-platform helper methods".IX Subsection "Cross-platform helper methods"These are methods which help writing cross-platform code..PP\fIos_flavor \fIAbstract\fI\fR.IX Subsection "os_flavor Abstract".PP.Vb 1\& my @os_flavor = $mm\->os_flavor;.Ve.PP\&\f(CW@os_flavor\fR is the style of operating system this is, usuallycorresponding to the MM_*.pm file we're using..PPThe first element of \f(CW@os_flavor\fR is the major family (ie. Unix,Windows, \s-1VMS\s0, \s-1OS/2\s0, etc...) and the rest are sub families..PPSome examples:.PP.Vb 6\& Cygwin98 (\*(AqUnix\*(Aq, \*(AqCygwin\*(Aq, \*(AqCygwin9x\*(Aq)\& Windows NT (\*(AqWin32\*(Aq, \*(AqWinNT\*(Aq)\& Win98 (\*(AqWin32\*(Aq, \*(AqWin9x\*(Aq)\& Linux (\*(AqUnix\*(Aq, \*(AqLinux\*(Aq)\& MacOS X (\*(AqUnix\*(Aq, \*(AqDarwin\*(Aq, \*(AqMacOS\*(Aq, \*(AqMacOS X\*(Aq)\& OS/2 (\*(AqOS/2\*(Aq).Ve.PPThis is used to write code for styles of operating system. See \fIos_flavor_is()\fR for use..PP\fIos_flavor_is\fR.IX Subsection "os_flavor_is".PP.Vb 2\& my $is_this_flavor = $mm\->os_flavor_is($this_flavor);\& my $is_this_flavor = $mm\->os_flavor_is(@one_of_these_flavors);.Ve.PPChecks to see if the current operating system is one of the given flavors..PPThis is useful for code like:.PP.Vb 6\& if( $mm\->os_flavor_is(\*(AqUnix\*(Aq) ) {\& $out = \`foo 2>&1\`;\& }\& else {\& $out = \`foo\`;\& }.Ve.PP\fIsplit_command\fR.IX Subsection "split_command".PP.Vb 1\& my @cmds = $MM\->split_command($cmd, @args);.Ve.PPMost \s-1OS\s0 have a maximum command length they can execute at once. Largemodules can easily generate commands well past that limit. Itsnecessary to split long commands up into a series of shorter commands..PP\&\f(CW\*(C`split_command\*(C'\fR will return a series of \f(CW@cmds\fR each processing part ofthe args. Collectively they will process all the arguments. Eachindividual line in \f(CW@cmds\fR will not be longer than the\&\f(CW$self\fR\->max_exec_len being careful to take into account macro expansion..PP\&\f(CW$cmd\fR should include any switches and repeated initial arguments..PPIf no \f(CW@args\fR are given, no \f(CW@cmds\fR will be returned..PPPairs of arguments will always be preserved in a single command, thisis a heuristic for things like pm_to_blib and pod2man which work onpairs of arguments. This makes things like this safe:.PP.Vb 1\& $self\->split_command($cmd, %pod2man);.Ve.PP\fIecho\fR.IX Subsection "echo".PP.Vb 3\& my @commands = $MM\->echo($text);\& my @commands = $MM\->echo($text, $file);\& my @commands = $MM\->echo($text, $file, $appending);.Ve.PPGenerates a set of \f(CW@commands\fR which print the \f(CW$text\fR to a \f(CW$file\fR..PPIf \f(CW$file\fR is not given, output goes to \s-1STDOUT\s0..PPIf \f(CW$appending\fR is true the \f(CW$file\fR will be appended to rather thanoverwritten..PP\fIwraplist\fR.IX Subsection "wraplist".PP.Vb 1\& my $args = $mm\->wraplist(@list);.Ve.PPTakes an array of items and turns them into a well-formatted list ofarguments. In most cases this is simply something like:.PP.Vb 3\& FOO \e\& BAR \e\& BAZ.Ve.PP\fImaketext_filter\fR.IX Subsection "maketext_filter".PP.Vb 1\& my $filter_make_text = $mm\->maketext_filter($make_text);.Ve.PPThe text of the Makefile is run through this method before writing todisk. It allows systems a chance to make portability fixes to theMakefile..PPBy default it does nothing..PPThis method is protected and not intended to be called outside ofMakeMaker..PP\fIcd \fIAbstract\fI\fR.IX Subsection "cd Abstract".PP.Vb 1\& my $subdir_cmd = $MM\->cd($subdir, @cmds);.Ve.PPThis will generate a make fragment which runs the \f(CW@cmds\fR in the given\&\f(CW$dir\fR. The rough equivalent to this, except cross platform..PP.Vb 1\& cd $subdir && $cmd.Ve.PPCurrently \f(CW$dir\fR can only go down one level. \*(L"foo\*(R" is fine. \*(L"foo/bar\*(R" isnot. \*(L"../foo\*(R" is right out..PPThe resulting \f(CW$subdir_cmd\fR has no leading tab nor trailing newline. Thismakes it easier to embed in a make string. For example..PP.Vb 6\& my $make = sprintf <<\*(AqCODE\*(Aq, $subdir_cmd;\& foo :\& $(ECHO) what\& %s\& $(ECHO) mouche\& CODE.Ve.PP\fIoneliner \fIAbstract\fI\fR.IX Subsection "oneliner Abstract".PP.Vb 2\& my $oneliner = $MM\->oneliner($perl_code);\& my $oneliner = $MM\->oneliner($perl_code, \e@switches);.Ve.PPThis will generate a perl one-liner safe for the particular platformyou're on based on the given \f(CW$perl_code\fR and \f(CW@switches\fR (a \-e isassumed) suitable for using in a make target. It will use the propershell quoting and escapes..PP$(\s-1PERLRUN\s0) will be used as perl..PPAny newlines in \f(CW$perl_code\fR will be escaped. Leading and trailingnewlines will be stripped. Makes this idiom much easier:.PP.Vb 4\& my $code = $MM\->oneliner(<<\*(AqCODE\*(Aq, [...switches...]);\&some code here\&another line here\&CODE.Ve.PPUsage might be something like:.PP.Vb 3\& # an echo emulation\& $oneliner = $MM\->oneliner(\*(Aqprint "Foo\en"\*(Aq);\& $make = \*(Aq$oneliner > somefile\*(Aq;.Ve.PPAll dollar signs must be doubled in the \f(CW$perl_code\fR if you expect themto be interpreted normally, otherwise it will be considered a makemacro. Also remember to quote make macros else it might be used as abareword. For example:.PP.Vb 2\& # Assign the value of the $(VERSION_FROM) make macro to $vf.\& $oneliner = $MM\->oneliner(\*(Aq$$vf = "$(VERSION_FROM)"\*(Aq);.Ve.PPIts currently very simple and may be expanded sometime in the figureto include more flexible code and switches..PP\fIquote_literal \fIAbstract\fI\fR.IX Subsection "quote_literal Abstract".PP.Vb 1\& my $safe_text = $MM\->quote_literal($text);.Ve.PPThis will quote \f(CW$text\fR so it is interpreted literally in the shell..PPFor example, on Unix this would escape any single-quotes in \f(CW$text\fR andput single-quotes around the whole thing..PP\fIescape_newlines \fIAbstract\fI\fR.IX Subsection "escape_newlines Abstract".PP.Vb 1\& my $escaped_text = $MM\->escape_newlines($text);.Ve.PPShell escapes newlines in \f(CW$text\fR..PP\fImax_exec_len \fIAbstract\fI\fR.IX Subsection "max_exec_len Abstract".PP.Vb 1\& my $max_exec_len = $MM\->max_exec_len;.Ve.PPCalculates the maximum command size the \s-1OS\s0 can exec. Effectively,this is the max size of a shell command line..PP\fImake\fR.IX Subsection "make".PP.Vb 1\& my $make = $MM\->make;.Ve.PPReturns the make variant we're generating the Makefile for. This attemptsto do some normalization on the information from \f(CW%Config\fR or the user..Sh "Targets".IX Subsection "Targets"These are methods which produce make targets..PP\fIall_target\fR.IX Subsection "all_target".PPGenerate the default target 'all'..PP\fIblibdirs_target\fR.IX Subsection "blibdirs_target".PP.Vb 1\& my $make_frag = $mm\->blibdirs_target;.Ve.PPCreates the blibdirs target which creates all the directories we usein blib/..PPThe blibdirs.ts target is deprecated. Depend on blibdirs instead..PP\fIclean (o)\fR.IX Subsection "clean (o)".PPDefines the clean target..PP\fIclean_subdirs_target\fR.IX Subsection "clean_subdirs_target".PP.Vb 1\& my $make_frag = $MM\->clean_subdirs_target;.Ve.PPReturns the clean_subdirs target. This is used by the clean target tocall clean on any subdirectories which contain Makefiles..PP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -