⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makemaker.pm

📁 MSYS在windows下模拟了一个类unix的终端
💻 PM
📖 第 1 页 / 共 5 页
字号:
=item PM_FILTERA filter program, in the traditional Unix sense (input from stdin, outputto stdout) that is passed on each .pm file during the build (in thepm_to_blib() phase).  It is empty by default, meaning no filtering is done.Great care is necessary when defining the command if quoting needs to bedone.  For instance, you would need to say:  {'PM_FILTER' => 'grep -v \\"^\\#\\"'}to remove all the leading coments on the fly during the build.  Theextra \\ are necessary, unfortunately, because this variable is interpolatedwithin the context of a Perl program built on the command line, and doublequotes are what is used with the -e switch to build that command line.  The# is escaped for the Makefile, since what is going to be generated will thenbe:  PM_FILTER = grep -v \"^\#\"Without the \\ before the #, we'd have the start of a Makefile comment,and the macro would be incorrectly defined.=item POLLUTERelease 5.005 grandfathered old global symbol names by providing preprocessormacros for extension source compatibility.  As of release 5.6, thesepreprocessor definitions are not available by default.  The POLLUTE flagspecifies that the old names should still be defined:  perl Makefile.PL POLLUTE=1Please inform the module author if this is necessary to successfully installa module under 5.6 or later.=item PPM_INSTALL_EXECName of the executable used to run C<PPM_INSTALL_SCRIPT> below. (e.g. perl)=item PPM_INSTALL_SCRIPTName of the script that gets executed by the Perl Package Manager afterthe installation of a package.=item PREFIXCan be used to set the three INSTALL* attributes in one go (except forprobably INSTALLMAN1DIR, if it is not below PREFIX according to%Config).  They will have PREFIX as a common directory node and willbranch from that node into lib/, lib/ARCHNAME or whatever Configuredecided at the build time of your perl (unless you override one ofthem, of course).=item PREREQ_PMHashref: Names of modules that need to be available to run thisextension (e.g. Fcntl for SDBM_File) are the keys of the hash and thedesired version is the value. If the required version number is 0, weonly check if any version is installed already.=item SKIPArryref. E.g. [qw(name1 name2)] skip (do not write) sections of theMakefile. Caution! Do not use the SKIP attribute for the negligiblespeedup. It may seriously damage the resulting Makefile. Only use itif you really need it.=item TYPEMAPSRef to array of typemap file names.  Use this when the typemaps arein some directory other than the current directory or when they arenot named B<typemap>.  The last typemap in the list takesprecedence.  A typemap in the current directory has highestprecedence, even if it isn't listed in TYPEMAPS.  The default systemtypemap has lowest precedence.=item VERSIONYour version number for distributing the package.  This defaults to0.1.=item VERSION_FROMInstead of specifying the VERSION in the Makefile.PL you can letMakeMaker parse a file to determine the version number. The parsingroutine requires that the file named by VERSION_FROM contains onesingle line to compute the version number. The first line in the filethat contains the regular expression    /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/will be evaluated with eval() and the value of the named variableB<after> the eval() will be assigned to the VERSION attribute of theMakeMaker object. The following lines will be parsed o.k.:    $VERSION = '1.00';    *VERSION = \'1.01';    ( $VERSION ) = '$Revision: 1.222 $ ' =~ /\$Revision:\s+([^\s]+)/;    $FOO::VERSION = '1.10';    *FOO::VERSION = \'1.11';    our $VERSION = 1.2.3;	# new for perl5.6.0 but these will fail:    my $VERSION = '1.01';    local $VERSION = '1.02';    local $FOO::VERSION = '1.30';(Putting C<my> or C<local> on the preceding line will work o.k.)The file named in VERSION_FROM is not added as a dependency toMakefile. This is not really correct, but it would be a major painduring development to have to rewrite the Makefile for any smallishchange in that file. If you want to make sure that the Makefilecontains the correct VERSION macro after any change of the file, youwould have to do something like    depend => { Makefile => '$(VERSION_FROM)' }See attribute C<depend> below.=item XSHashref of .xs files. MakeMaker will default this.  e.g.  {'name_of_file.xs' => 'name_of_file.c'}The .c files will automatically be included in the list of filesdeleted by a make clean.=item XSOPTString of options to pass to xsubpp.  This might include C<-C++> orC<-extern>.  Do not include typemaps here; the TYPEMAP parameter exists forthat purpose.=item XSPROTOARGMay be set to an empty string, which is identical to C<-prototypes>, orC<-noprototypes>. See the xsubpp documentation for details. MakeMakerdefaults to the empty string.=item XS_VERSIONYour version number for the .xs file of this package.  This defaultsto the value of the VERSION attribute.=back=head2 Additional lowercase attributescan be used to pass parameters to the methods which implement thatpart of the Makefile.=over 2=item clean  {FILES => "*.xyz foo"}=item depend  {ANY_TARGET => ANY_DEPENDECY, ...}(ANY_TARGET must not be given a double-colon rule by MakeMaker.)=item dist  {TARFLAGS => 'cvfF', COMPRESS => 'gzip', SUFFIX => '.gz',  SHAR => 'shar -m', DIST_CP => 'ln', ZIP => '/bin/zip',  ZIPFLAGS => '-rl', DIST_DEFAULT => 'private tardist' }If you specify COMPRESS, then SUFFIX should also be altered, as it isneeded to tell make the target file of the compression. SettingDIST_CP to ln can be useful, if you need to preserve the timestamps onyour files. DIST_CP can take the values 'cp', which copies the file,'ln', which links the file, and 'best' which copies symbolic links andlinks the rest. Default is 'best'.=item dynamic_lib  {ARMAYBE => 'ar', OTHERLDFLAGS => '...', INST_DYNAMIC_DEP => '...'}=item linkext  {LINKTYPE => 'static', 'dynamic' or ''}NB: Extensions that have nothing but *.pm files had to say  {LINKTYPE => ''}with Pre-5.0 MakeMakers. Since version 5.00 of MakeMaker such a linecan be deleted safely. MakeMaker recognizes when there's nothing tobe linked.=item macro  {ANY_MACRO => ANY_VALUE, ...}=item realclean  {FILES => '$(INST_ARCHAUTODIR)/*.xyz'}=item test  {TESTS => 't/*.t'}=item tool_autosplit  {MAXLEN => 8}=back=head2 Overriding MakeMaker MethodsIf you cannot achieve the desired Makefile behaviour by specifyingattributes you may define private subroutines in the Makefile.PL.Each subroutines returns the text it wishes to have written tothe Makefile. To override a section of the Makefile you caneither say:	sub MY::c_o { "new literal text" }or you can edit the default by saying something like:	sub MY::c_o {	    package MY;	# so that "SUPER" works right	    my $inherited = shift->SUPER::c_o(@_);	    $inherited =~ s/old text/new text/;	    $inherited;	}If you are running experiments with embedding perl as a library intoother applications, you might find MakeMaker is not sufficient. You'dbetter have a look at ExtUtils::Embed which is a collection of utilitiesfor embedding.If you still need a different solution, try to develop anothersubroutine that fits your needs and submit the diffs toF<perl5-porters@perl.org> or F<comp.lang.perl.moderated> as appropriate.For a complete description of all MakeMaker methods see L<ExtUtils::MM_Unix>.Here is a simple example of how to add a new target to the generatedMakefile:    sub MY::postamble {	'    $(MYEXTLIB): sdbm/Makefile	    cd sdbm && $(MAKE) all    ';    }=head2 Hintsfile supportMakeMaker.pm uses the architecture specific information fromConfig.pm. In addition it evaluates architecture specific hints filesin a C<hints/> directory. The hints files are expected to be namedlike their counterparts in C<PERL_SRC/hints>, but with an C<.pl> filename extension (eg. C<next_3_2.pl>). They are simply C<eval>ed byMakeMaker within the WriteMakefile() subroutine, and can be used toexecute commands as well as to include special variables. The ruleswhich hintsfile is chosen are the same as in Configure.The hintsfile is eval()ed immediately after the arguments given toWriteMakefile are stuffed into a hash reference $self but before thisreference becomes blessed. So if you want to do the equivalent tooverride or create an attribute you would say something like    $self->{LIBS} = ['-ldbm -lucb -lc'];=head2 Distribution SupportFor authors of extensions MakeMaker provides several Makefiletargets. Most of the support comes from the ExtUtils::Manifest module,where additional documentation can be found.=over 4=item    make distcheckreports which files are below the build directory but not in theMANIFEST file and vice versa. (See ExtUtils::Manifest::fullcheck() fordetails)=item    make skipcheckreports which files are skipped due to the entries in theC<MANIFEST.SKIP> file (See ExtUtils::Manifest::skipcheck() fordetails)=item    make distcleandoes a realclean first and then the distcheck. Note that this is notneeded to build a new distribution as long as you are sure that theMANIFEST file is ok.=item    make manifestrewrites the MANIFEST file, adding all remaining files found (SeeExtUtils::Manifest::mkmanifest() for details)=item    make distdirCopies all the files that are in the MANIFEST file to a newly createddirectory with the name C<$(DISTNAME)-$(VERSION)>. If that directoryexists, it will be removed first.=item	make disttestMakes a distdir first, and runs a C<perl Makefile.PL>, a make, anda make test in that directory.=item    make tardistFirst does a distdir. Then a command $(PREOP) which defaults to a nullcommand, followed by $(TOUNIX), which defaults to a null command underUNIX, and will convert files in distribution directory to UNIX formatotherwise. Next it runs C<tar> on that directory into a tarfile anddeletes the directory. Finishes with a command $(POSTOP) whichdefaults to a null command.=item    make distDefaults to $(DIST_DEFAULT) which in turn defaults to tardist.=item    make uutardistRuns a tardist first and uuencodes the tarfile.=item    make shdistFirst does a distdir. Then a command $(PREOP) which defaults to a nullcommand. Next it runs C<shar> on that directory into a sharfile anddeletes the intermediate directory again. Finishes with a command$(POSTOP) which defaults to a null command.  Note: For shdist to workproperly a C<shar> program that can handle directories is mandatory.=item    make zipdistFirst does a distdir. Then a command $(PREOP) which defaults to a nullcommand. Runs C<$(ZIP) $(ZIPFLAGS)> on that directory into azipfile. Then deletes that directory. Finishes with a command$(POSTOP) which defaults to a null command.=item    make ciDoes a $(CI) and a $(RCS_LABEL) on all files in the MANIFEST file.=backCustomization of the dist targets can be done by specifying a hashreference to the dist attribute of the WriteMakefile call. Thefollowing parameters are recognized:    CI           ('ci -u')    COMPRESS     ('gzip --best')    POSTOP       ('@ :')    PREOP        ('@ :')    TO_UNIX      (depends on the system)    RCS_LABEL    ('rcs -q -Nv$(VERSION_SYM):')    SHAR         ('shar')    SUFFIX       ('.gz')    TAR          ('tar')    TARFLAGS     ('cvf')    ZIP          ('zip')    ZIPFLAGS     ('-r')An example:    WriteMakefile( 'dist' => { COMPRESS=>"bzip2", SUFFIX=>".bz2" })=head2 Disabling an extensionIf some events detected in F<Makefile.PL> imply that there is no wayto create the Module, but this is a normal state of things, then youcan create a F<Makefile> which does nothing, but succeeds on all the"usual" build targets.  To do so, use   ExtUtils::MakeMaker::WriteEmptyMakefile();instead of WriteMakefile().This may be useful if other modules expect this module to be I<built>OK, as opposed to I<work> OK (say, this system-dependent module buildsin a subdirectory of some other distribution, or is listed as adependency in a CPAN::Bundle, but the functionality is supported bydifferent means on the current architecture).=head1 ENVIRONMENT=over 8=item PERL_MM_OPTCommand line options used by C<MakeMaker-E<gt>new()>, and thus byC<WriteMakefile()>.  The string is split on whitespace, and the resultis processed before any actual command line arguments are processed.=back=head1 SEE ALSOExtUtils::MM_Unix, ExtUtils::Manifest, ExtUtils::testlib,ExtUtils::Install, ExtUtils::Embed=head1 AUTHORSAndy Dougherty <F<doughera@lafcol.lafayette.edu>>, Andreas KE<ouml>nig<F<A.Koenig@franz.ww.TU-Berlin.DE>>, Tim Bunce <F<Tim.Bunce@ig.co.uk>>.VMS support by Charles Bailey <F<bailey@newman.upenn.edu>>.  OS/2support by Ilya Zakharevich <F<ilya@math.ohio-state.edu>>.  Contact themakemaker mailing list C<mailto:makemaker@franz.ww.tu-berlin.de>, ifyou have any questions.=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -