📄 extutils::makemaker.3
字号:
.PPNote, that in both cases the tilde expansion is done by MakeMaker, notby perl by default, nor by make..PPConflicts between parameters \s-1LIB\s0, \s-1PREFIX\s0 and the various INSTALL*arguments are resolved so that:.IP "\(bu" 4setting \s-1LIB\s0 overrides any setting of \s-1INSTALLPRIVLIB\s0, \s-1INSTALLARCHLIB\s0,\&\s-1INSTALLSITELIB\s0, \s-1INSTALLSITEARCH\s0 (and they are not affected by \s-1PREFIX\s0);.IP "\(bu" 4without \s-1LIB\s0, setting \s-1PREFIX\s0 replaces the initial \f(CW$Config{prefix}\fRpart of those INSTALL* arguments, even if the latter are explicitlyset (but are set to still start with \f(CW$Config{prefix}\fR)..PPIf the user has superuser privileges, and is not working on \s-1AFS\s0 orrelatives, then the defaults for \s-1INSTALLPRIVLIB\s0, \s-1INSTALLARCHLIB\s0,\&\s-1INSTALLSCRIPT\s0, etc. will be appropriate, and this incantation will bethe best:.PP.Vb 4\& perl Makefile.PL; \& make; \& make test\& make install.Ve.PPmake install per default writes some documentation of what has beendone into the file \f(CW\*(C`$(INSTALLARCHLIB)/perllocal.pod\*(C'\fR. This featurecan be bypassed by calling make pure_install..Sh "\s-1AFS\s0 users".IX Subsection "AFS users"will have to specify the installation directories as these mostprobably have changed since perl itself has been installed. They willhave to do this by calling.PP.Vb 3\& perl Makefile.PL INSTALLSITELIB=/afs/here/today \e\& INSTALLSCRIPT=/afs/there/now INSTALLMAN3DIR=/afs/for/manpages\& make.Ve.PPBe careful to repeat this procedure every time you recompile anextension, unless you are sure the \s-1AFS\s0 installation directories arestill valid..Sh "Static Linking of a new Perl Binary".IX Subsection "Static Linking of a new Perl Binary"An extension that is built with the above steps is ready to use onsystems supporting dynamic loading. On systems that do not supportdynamic loading, any newly created extension has to be linked togetherwith the available resources. MakeMaker supports the linking processby creating appropriate targets in the Makefile whenever an extensionis built. You can invoke the corresponding section of the makefile with.PP.Vb 1\& make perl.Ve.PPThat produces a new perl binary in the current directory with allextensions linked in that can be found in \s-1INST_ARCHLIB\s0, \s-1SITELIBEXP\s0,and \s-1PERL_ARCHLIB\s0. To do that, MakeMaker writes a new Makefile, on\&\s-1UNIX\s0, 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..PPThe binary can be installed into the directory where perl normallyresides on your machine with.PP.Vb 1\& make inst_perl.Ve.PPTo produce a perl binary with a different name than \f(CW\*(C`perl\*(C'\fR, either say.PP.Vb 3\& perl Makefile.PL MAP_TARGET=myperl\& make myperl\& make inst_perl.Ve.PPor say.PP.Vb 3\& perl Makefile.PL\& make myperl MAP_TARGET=myperl\& make inst_perl MAP_TARGET=myperl.Ve.PPIn any case you will be prompted with the correct invocation of the\&\f(CW\*(C`inst_perl\*(C'\fR target that installs the new binary into \s-1INSTALLBIN\s0..PPmake inst_perl per default writes some documentation of what has beendone into the file \f(CW\*(C`$(INSTALLARCHLIB)/perllocal.pod\*(C'\fR. Thiscan be bypassed by calling make pure_inst_perl..PPWarning: the inst_perl: target will most probably overwrite yourexisting perl binary. Use with care!.PPSometimes 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:.PP.Vb 1\& perl Makefile.PL LINKTYPE=static # recommended.Ve.PPor.PP.Vb 1\& make LINKTYPE=static # works on most systems.Ve.Sh "Determination of Perl Library and Installation Locations".IX Subsection "Determination of Perl Library and Installation Locations"MakeMaker needs to know, or to guess, where certain things arelocated. Especially \s-1INST_LIB\s0 and \s-1INST_ARCHLIB\s0 (where to put the filesduring the \fImake\fR\|(1) run), \s-1PERL_LIB\s0 and \s-1PERL_ARCHLIB\s0 (where to readexisting modules from), and \s-1PERL_INC\s0 (header files and \f(CW\*(C`libperl*.*\*(C'\fR)..PPExtensions 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..PPIf an extension is being built below the \f(CW\*(C`ext/\*(C'\fR directory of the perlsource then MakeMaker will set \s-1PERL_SRC\s0 automatically (e.g.,\&\f(CW\*(C`../..\*(C'\fR). If \s-1PERL_SRC\s0 is defined and the extension is recognized asa standard extension, then other variables default to the following:.PP.Vb 5\& PERL_INC = PERL_SRC\& PERL_LIB = PERL_SRC/lib\& PERL_ARCHLIB = PERL_SRC/lib\& INST_LIB = PERL_LIB\& INST_ARCHLIB = PERL_ARCHLIB.Ve.PPIf an extension is being built away from the perl source then MakeMakerwill leave \s-1PERL_SRC\s0 undefined and default to using the installed copyof the perl library. The other variables default to the following:.PP.Vb 5\& PERL_INC = $archlibexp/CORE\& PERL_LIB = $privlibexp\& PERL_ARCHLIB = $archlibexp\& INST_LIB = ./blib/lib\& INST_ARCHLIB = ./blib/arch.Ve.PPIf perl has not yet been installed then \s-1PERL_SRC\s0 can be defined on thecommand line as shown in the previous section..Sh "Which architecture dependent directory?".IX Subsection "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 \s-1INSTALLPRIVLIB\s0 and \s-1INSTALLARCHLIB\s0 is determinedby Configure at perl compilation time. MakeMaker supports the user whosets \s-1INSTALLPRIVLIB\s0. If \s-1INSTALLPRIVLIB\s0 is set, but \s-1INSTALLARCHLIB\s0 not,then MakeMaker defaults the latter to be the same subdirectory of\&\s-1INSTALLPRIVLIB\s0 as Configure decided for the counterparts in \f(CW%Config\fR ,otherwise it defaults to \s-1INSTALLPRIVLIB\s0. The same relationship holdsfor \s-1INSTALLSITELIB\s0 and \s-1INSTALLSITEARCH\s0..PPMakeMaker gives you much more freedom than needed to configureinternal variables and get different results. It is worth to mention,that \fImake\fR\|(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)..Sh "Using Attributes and Parameters".IX Subsection "Using Attributes and Parameters"The following attributes may be specified as arguments to \fIWriteMakefile()\fRor as NAME=VALUE pairs on the command line..IP "\s-1ABSTRACT\s0" 2.IX Item "ABSTRACT"One line description of the module. Will be included in \s-1PPD\s0 file..IP "\s-1ABSTRACT_FROM\s0" 2.IX Item "ABSTRACT_FROM"Name of the file that contains the package description. MakeMaker looksfor a line in the \s-1POD\s0 matching /^($package\es\-\es)(.*)/. This is typicallythe first line in the \*(L"=head1 \s-1NAME\s0\*(R" section. \f(CW$2\fR becomes the abstract..IP "\s-1AUTHOR\s0" 2.IX Item "AUTHOR"String containing name (and email address) of package author(s). Is usedin \s-1PPD\s0 (Perl Package Description) files for \s-1PPM\s0 (Perl Package Manager)..IP "\s-1BINARY_LOCATION\s0" 2.IX Item "BINARY_LOCATION"Used when creating \s-1PPD\s0 files for binary packages. It can be set to afull or relative path or \s-1URL\s0 to the binary archive for a particulararchitecture. For example:.Sp.Vb 1\& perl Makefile.PL BINARY_LOCATION=x86/Agent.tar.gz.Ve.Spbuilds a \s-1PPD\s0 package that references a binary of the \f(CW\*(C`Agent\*(C'\fR package,located in the \f(CW\*(C`x86\*(C'\fR directory relative to the \s-1PPD\s0 itself..IP "C" 2.IX Item "C"Ref to array of *.c file names. Initialised from a directory scanand the values portion of the \s-1XS\s0 attribute hash. This is notcurrently used by MakeMaker but may be handy in Makefile.PLs..IP "\s-1CCFLAGS\s0" 2.IX Item "CCFLAGS"String that will be included in the compiler call command line betweenthe arguments \s-1INC\s0 and \s-1OPTIMIZE\s0..IP "\s-1CONFIG\s0" 2.IX Item "CONFIG"Arrayref. E.g. [qw(archname manext)] defines \s-1ARCHNAME\s0 & \s-1MANEXT\s0 fromconfig.sh. MakeMaker will add to \s-1CONFIG\s0 the following values anyway:arcccccdlflagsccdlflagsdlextdlsrcldlddlflagsldflagslibclib_extobj_extranlibsitelibexpsitearchexpso.IP "\s-1CONFIGURE\s0" 2.IX Item "CONFIGURE"\&\s-1CODE\s0 reference. The subroutine should return a hash reference. Thehash may contain further attributes, e.g. {\s-1LIBS\s0 => ...}, that have tobe determined by some evaluation method..IP "\s-1DEFINE\s0" 2.IX Item "DEFINE"Something like \f(CW"\-DHAVE_UNISTD_H"\fR.IP "\s-1DESTDIR\s0" 2.IX Item "DESTDIR"This is the root directory into which the code will be installed. It\&\fIprepends itself to the normal prefix\fR. For example, if your codewould normally go into \fI/usr/local/lib/perl\fR you could set DESTDIR=~/tmp/and installation would go into \fI~/tmp/usr/local/lib/perl\fR..SpThis is primarily of use for people who repackage Perl modules..Sp\&\s-1NOTE:\s0 Due to the nature of make, it is important that you put the trailingslash on your \s-1DESTDIR\s0. \fI~/tmp/\fR not \fI~/tmp\fR..IP "\s-1DIR\s0" 2.IX Item "DIR"Ref to array of subdirectories containing Makefile.PLs e.g. [ 'sdbm'] in ext/SDBM_File.IP "\s-1DISTNAME\s0" 2.IX Item "DISTNAME"A safe filename for the package..SpDefaults to \s-1NAME\s0 above but with :: replaced with \-..SpFor example, Foo::Bar becomes Foo-Bar..IP "\s-1DISTVNAME\s0" 2.IX Item "DISTVNAME"Your name for distributing the package with the version numberincluded. This is used by 'make dist' to name the resulting archivefile..SpDefaults to DISTNAME-VERSION..SpFor example, version 1.04 of Foo::Bar becomes Foo\-Bar\-1.04..SpOn some \s-1OS\s0's where . has special meaning \s-1VERSION_SYM\s0 may be used inplace of \s-1VERSION\s0..IP "\s-1DL_FUNCS\s0" 2.IX Item "DL_FUNCS"Hashref 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 \s-1AIX\s0, \s-1OS/2\s0,\&\s-1VMS\s0 and Win32 at present. The routine names supplied will be expandedin the same way as \s-1XSUB\s0 names are expanded by the \s-1\fIXS\s0()\fR macro.Defaults to.Sp.Vb 1\& {"$(NAME)" => ["boot_$(NAME)" ] }.Ve.Spe.g..Sp.Vb 2\& {"RPC" => [qw( boot_rpcb rpcb_gettime getnetconfigent )],\& "NetconfigPtr" => [ \*(AqDESTROY\*(Aq] }.Ve.SpPlease see the ExtUtils::Mksymlists documentation for more informationabout the \s-1DL_FUNCS\s0, \s-1DL_VARS\s0 and \s-1FUNCLIST\s0 attributes..IP "\s-1DL_VARS\s0" 2.IX Item "DL_VARS"Array of symbol names for variables to be made available as universal symbols.Used only under \s-1AIX\s0, \s-1OS/2\s0, \s-1VMS\s0 and Win32 at present. Defaults to [].(e.g. [ qw(Foo_version Foo_numstreams Foo_tree ) ]).IP "\s-1EXCLUDE_EXT\s0" 2.IX Item "EXCLUDE_EXT"Array of extension names to exclude when doing a static build. Thisis ignored if \s-1INCLUDE_EXT\s0 is present. Consult \s-1INCLUDE_EXT\s0 for moredetails. (e.g. [ qw( Socket \s-1POSIX\s0 ) ] ).SpThis attribute may be most useful when specified as a string on thecommand line: perl Makefile.PL EXCLUDE_EXT='Socket Safe'.IP "\s-1EXE_FILES\s0" 2.IX Item "EXE_FILES"Ref to array of executable files. The files will be copied to the\&\s-1INST_SCRIPT\s0 directory. Make realclean will delete them from thereagain..SpIf 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..IP "\s-1FIRST_MAKEFILE\s0" 2.IX Item "FIRST_MAKEFILE"The name of the Makefile to be produced. This is used for the secondMakefile that will be produced for the \s-1MAP_TARGET\s0..SpDefaults to 'Makefile' or 'Descrip.MMS' on \s-1VMS\s0..Sp(Note: we couldn't use \s-1MAKEFILE\s0 because dmake uses this for somethingelse)..IP "\s-1FULLPERL\s0" 2.IX Item "FULLPERL"Perl binary able to run this extension, load \s-1XS\s0 modules, etc....IP "\s-1FULLPERLRUN\s0" 2.IX Item "FULLPERLRUN"Like \s-1PERLRUN\s0, except it uses \s-1FULLPERL\s0..IP "\s-1FULLPERLRUNINST\s0" 2.IX Item "FULLPERLRUNINST"Like \s-1PERLRUNINST\s0, except it uses \s-1FULLPERL\s0..IP "\s-1FUNCLIST\s0" 2.IX Item "FUNCLIST"This 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..IP "H" 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -