📄 makemaker.pm
字号:
make perlThat produces a new perl binary in the current directory with allextensions linked in that can be found in INST_ARCHLIB, SITELIBEXP,and PERL_ARCHLIB. To do that, MakeMaker writes a new Makefile, onUNIX, this is called Makefile.aperl (may be system dependent). If youwant to force the creation of a new perl, it is recommended, that youdelete this Makefile.aperl, so the directories are searched-throughfor linkable libraries again.The binary can be installed into the directory where perl normallyresides on your machine with make inst_perlTo produce a perl binary with a different name than C<perl>, either say perl Makefile.PL MAP_TARGET=myperl make myperl make inst_perlor say perl Makefile.PL make myperl MAP_TARGET=myperl make inst_perl MAP_TARGET=myperlIn any case you will be prompted with the correct invocation of theC<inst_perl> target that installs the new binary into INSTALLBIN.make inst_perl per default writes some documentation of what has beendone into the file C<$(INSTALLARCHLIB)/perllocal.pod>. Thiscan be bypassed by calling make pure_inst_perl.Warning: the inst_perl: target will most probably overwrite yourexisting perl binary. Use with care!Sometimes you might want to build a statically linked perl althoughyour system supports dynamic loading. In this case you may explicitlyset the linktype with the invocation of the Makefile.PL or make: perl Makefile.PL LINKTYPE=static # recommendedor make LINKTYPE=static # works on most systems=head2 Determination of Perl Library and Installation LocationsMakeMaker needs to know, or to guess, where certain things arelocated. Especially INST_LIB and INST_ARCHLIB (where to put the filesduring the make(1) run), PERL_LIB and PERL_ARCHLIB (where to readexisting modules from), and PERL_INC (header files and C<libperl*.*>).Extensions may be built either using the contents of the perl sourcedirectory tree or from the installed perl library. The recommended wayis to build extensions after you have run 'make install' on perlitself. You can do that in any directory on your hard disk that is notbelow the perl source tree. The support for extensions below the extdirectory of the perl distribution is only good for the standardextensions that come with perl.If an extension is being built below the C<ext/> directory of the perlsource then MakeMaker will set PERL_SRC automatically (e.g.,C<../..>). If PERL_SRC is defined and the extension is recognized asa standard extension, then other variables default to the following: PERL_INC = PERL_SRC PERL_LIB = PERL_SRC/lib PERL_ARCHLIB = PERL_SRC/lib INST_LIB = PERL_LIB INST_ARCHLIB = PERL_ARCHLIBIf an extension is being built away from the perl source then MakeMakerwill leave PERL_SRC undefined and default to using the installed copyof the perl library. The other variables default to the following: PERL_INC = $archlibexp/CORE PERL_LIB = $privlibexp PERL_ARCHLIB = $archlibexp INST_LIB = ./blib/lib INST_ARCHLIB = ./blib/archIf perl has not yet been installed then PERL_SRC can be defined on thecommand line as shown in the previous section.=head2 Which architecture dependent directory?If you don't want to keep the defaults for the INSTALL* macros,MakeMaker helps you to minimize the typing needed: the usualrelationship between INSTALLPRIVLIB and INSTALLARCHLIB is determinedby Configure at perl compilation time. MakeMaker supports the user whosets INSTALLPRIVLIB. If INSTALLPRIVLIB is set, but INSTALLARCHLIB not,then MakeMaker defaults the latter to be the same subdirectory ofINSTALLPRIVLIB as Configure decided for the counterparts in %Config ,otherwise it defaults to INSTALLPRIVLIB. The same relationship holdsfor INSTALLSITELIB and INSTALLSITEARCH.MakeMaker gives you much more freedom than needed to configureinternal variables and get different results. It is worth to mention,that make(1) also lets you configure most of the variables that areused in the Makefile. But in the majority of situations this will notbe necessary, and should only be done if the author of a packagerecommends it (or you know what you're doing).=head2 Using Attributes and ParametersThe following attributes may be specified as arguments to WriteMakefile()or as NAME=VALUE pairs on the command line.=over 2=item ABSTRACTOne line description of the module. Will be included in PPD file.=item ABSTRACT_FROMName of the file that contains the package description. MakeMaker looksfor a line in the POD matching /^($package\s-\s)(.*)/. This is typicallythe first line in the "=head1 NAME" section. $2 becomes the abstract.=item AUTHORString containing name (and email address) of package author(s). Is usedin PPD (Perl Package Description) files for PPM (Perl Package Manager).=item BINARY_LOCATIONUsed when creating PPD files for binary packages. It can be set to afull or relative path or URL to the binary archive for a particulararchitecture. For example: perl Makefile.PL BINARY_LOCATION=x86/Agent.tar.gzbuilds a PPD package that references a binary of the C<Agent> package,located in the C<x86> directory relative to the PPD itself.=item CRef to array of *.c file names. Initialised from a directory scanand the values portion of the XS attribute hash. This is notcurrently used by MakeMaker but may be handy in Makefile.PLs.=item CCFLAGSString that will be included in the compiler call command line betweenthe arguments INC and OPTIMIZE.=item CONFIGArrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT fromconfig.sh. MakeMaker will add to CONFIG the following values anyway:arcccccdlflagsccdlflagsdlextdlsrcldlddlflagsldflagslibclib_extobj_extranlibsitelibexpsitearchexpso=item CONFIGURECODE reference. The subroutine should return a hash reference. Thehash may contain further attributes, e.g. {LIBS =E<gt> ...}, that have tobe determined by some evaluation method.=item DEFINESomething like C<"-DHAVE_UNISTD_H">=item DESTDIRThis is the root directory into which the code will be installed. ItI<prepends itself to the normal prefix>. For example, if your codewould normally go into F</usr/local/lib/perl> you could set DESTDIR=~/tmp/and installation would go into F<~/tmp/usr/local/lib/perl>.This is primarily of use for people who repackage Perl modules.NOTE: Due to the nature of make, it is important that you put the trailingslash on your DESTDIR. F<~/tmp/> not F<~/tmp>.=item DIRRef to array of subdirectories containing Makefile.PLs e.g. [ 'sdbm'] in ext/SDBM_File=item DISTNAMEA safe filename for the package. Defaults to NAME above but with :: replaced with -.For example, Foo::Bar becomes Foo-Bar.=item DISTVNAMEYour name for distributing the package with the version numberincluded. This is used by 'make dist' to name the resulting archivefile.Defaults to DISTNAME-VERSION.For example, version 1.04 of Foo::Bar becomes Foo-Bar-1.04.On some OS's where . has special meaning VERSION_SYM may be used inplace of VERSION.=item DL_FUNCSHashref of symbol names for routines to be made available as universalsymbols. Each key/value pair consists of the package name and anarray of routine names in that package. Used only under AIX, OS/2,VMS and Win32 at present. The routine names supplied will be expandedin the same way as XSUB names are expanded by the XS() macro.Defaults to {"$(NAME)" => ["boot_$(NAME)" ] }e.g. {"RPC" => [qw( boot_rpcb rpcb_gettime getnetconfigent )], "NetconfigPtr" => [ 'DESTROY'] }Please see the L<ExtUtils::Mksymlists> documentation for more informationabout the DL_FUNCS, DL_VARS and FUNCLIST attributes.=item DL_VARSArray of symbol names for variables to be made available as universal symbols.Used only under AIX, OS/2, VMS and Win32 at present. Defaults to [].(e.g. [ qw(Foo_version Foo_numstreams Foo_tree ) ])=item EXCLUDE_EXTArray of extension names to exclude when doing a static build. Thisis ignored if INCLUDE_EXT is present. Consult INCLUDE_EXT for moredetails. (e.g. [ qw( Socket POSIX ) ] )This attribute may be most useful when specified as a string on thecommand line: perl Makefile.PL EXCLUDE_EXT='Socket Safe'=item EXE_FILESRef to array of executable files. The files will be copied to theINST_SCRIPT directory. Make realclean will delete them from thereagain.If your executables start with something like #!perl or#!/usr/bin/perl MakeMaker will change this to the path of the perl'Makefile.PL' was invoked with so the programs will be sure to runproperly even if perl is not in /usr/bin/perl.=item FIRST_MAKEFILEThe name of the Makefile to be produced. This is used for the secondMakefile that will be produced for the MAP_TARGET.Defaults to 'Makefile' or 'Descrip.MMS' on VMS.(Note: we couldn't use MAKEFILE because dmake uses this for somethingelse).=item FULLPERLPerl binary able to run this extension, load XS modules, etc...=item FULLPERLRUNLike PERLRUN, except it uses FULLPERL.=item FULLPERLRUNINSTLike PERLRUNINST, except it uses FULLPERL.=item FUNCLISTThis provides an alternate means to specify function names to beexported from the extension. Its value is a reference to anarray of function names to be exported by the extension. Thesenames are passed through unaltered to the linker options file.=item HRef to array of *.h file names. Similar to C.=item IMPORTSThis attribute is used to specify names to be imported into theextension. Takes a hash ref.It is only used on OS/2 and Win32.=item INCInclude file dirs eg: C<"-I/usr/5include -I/path/to/inc">=item INCLUDE_EXTArray of extension names to be included when doing a static build.MakeMaker will normally build with all of the installed extensions whendoing a static build, and that is usually the desired behavior. IfINCLUDE_EXT is present then MakeMaker will build only with those extensionswhich are explicitly mentioned. (e.g. [ qw( Socket POSIX ) ])It is not necessary to mention DynaLoader or the current extension whenfilling in INCLUDE_EXT. If the INCLUDE_EXT is mentioned but is empty thenonly DynaLoader and the current extension will be included in the build.This attribute may be most useful when specified as a string on thecommand line: perl Makefile.PL INCLUDE_EXT='POSIX Socket Devel::Peek'=item INSTALLARCHLIBUsed by 'make install', which copies files from INST_ARCHLIB to thisdirectory if INSTALLDIRS is set to perl.=item INSTALLBINDirectory to install binary files (e.g. tkperl) into ifINSTALLDIRS=perl.=item INSTALLDIRSDetermines which of the sets of installation directories to choose:perl, site or vendor. Defaults to site.=item INSTALLMAN1DIR=item INSTALLMAN3DIRThese directories get the man pages at 'make install' time ifINSTALLDIRS=perl. Defaults to $Config{installman*dir}.If set to 'none', no man pages will be installed.=item INSTALLPRIVLIBUsed by 'make install', which copies files from INST_LIB to thisdirectory if INSTALLDIRS is set to perl.Defaults to $Config{installprivlib}.=item INSTALLSCRIPTUsed by 'make install' which copies files from INST_SCRIPT to thisdirectory if INSTALLDIRS=perl.=item INSTALLSITEARCHUsed by 'make install', which copies files from INST_ARCHLIB to thisdirectory if INSTALLDIRS is set to site (default).=item INSTALLSITEBINUsed by 'make install', which copies files from INST_BIN to thisdirectory if INSTALLDIRS is set to site (default).=item INSTALLSITELIBUsed by 'make install', which copies files from INST_LIB to thisdirectory if INSTALLDIRS is set to site (default).=item INSTALLSITEMAN1DIR=item INSTALLSITEMAN3DIRThese directories get the man pages at 'make install' time ifINSTALLDIRS=site (default). Defaults to $(SITEPREFIX)/man/man$(MAN*EXT).If set to 'none', no man pages will be installed.=item INSTALLSITESCRIPTUsed by 'make install' which copies files from INST_SCRIPT to thisdirectory if INSTALLDIRS is set to site (default).=item INSTALLVENDORARCHUsed by 'make install', which copies files from INST_ARCHLIB to thisdirectory if INSTALLDIRS is set to vendor.=item INSTALLVENDORBINUsed by 'make install', which copies files from INST_BIN to thisdirectory if INSTALLDIRS is set to vendor.=item INSTALLVENDORLIBUsed by 'make install', which copies files from INST_LIB to thisdirectory if INSTALLDIRS is set to vendor.=item INSTALLVENDORMAN1DIR=item INSTALLVENDORMAN3DIRThese directories get the man pages at 'make install' time ifINSTALLDIRS=vendor. Defaults to $(VENDORPREFIX)/man/man$(MAN*EXT).If set to 'none', no man pages will be installed.=item INSTALLVENDORSCRIPTUsed by 'make install' which copies files from INST_SCRIPT to this
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -