makemaker.html
来自「perl教程」· HTML 代码 · 共 1,694 行 · 第 1/5 页
HTML
1,694 行
<p>
</p>
<h2><a name="using_attributes_and_parameters">Using Attributes and Parameters</a></h2>
<p>The following attributes may be specified as arguments to <code>WriteMakefile()</code>
or as NAME=VALUE pairs on the command line.</p>
<dl>
<dt><strong><a name="item_abstract">ABSTRACT</a></strong>
<dd>
<p>One line description of the module. Will be included in PPD file.</p>
</dd>
</li>
<dt><strong><a name="item_abstract_from">ABSTRACT_FROM</a></strong>
<dd>
<p>Name of the file that contains the package description. MakeMaker looks
for a line in the POD matching /^($package\s-\s)(.*)/. This is typically
the first line in the "=head1 NAME" section. $2 becomes the abstract.</p>
</dd>
</li>
<dt><strong><a name="item_author">AUTHOR</a></strong>
<dd>
<p>String containing name (and email address) of package author(s). Is used
in PPD (Perl Package Description) files for PPM (Perl Package Manager).</p>
</dd>
</li>
<dt><strong><a name="item_binary_location">BINARY_LOCATION</a></strong>
<dd>
<p>Used when creating PPD files for binary packages. It can be set to a
full or relative path or URL to the binary archive for a particular
architecture. For example:</p>
</dd>
<dd>
<pre>
perl Makefile.PL BINARY_LOCATION=x86/Agent.tar.gz</pre>
</dd>
<dd>
<p>builds a PPD package that references a binary of the <code>Agent</code> package,
located in the <code>x86</code> directory relative to the PPD itself.</p>
</dd>
</li>
<dt><strong><a name="item_c">C</a></strong>
<dd>
<p>Ref to array of *.c file names. Initialised from a directory scan
and the values portion of the XS attribute hash. This is not
currently used by MakeMaker but may be handy in Makefile.PLs.</p>
</dd>
</li>
<dt><strong><a name="item_ccflags">CCFLAGS</a></strong>
<dd>
<p>String that will be included in the compiler call command line between
the arguments INC and OPTIMIZE.</p>
</dd>
</li>
<dt><strong><a name="item_config">CONFIG</a></strong>
<dd>
<p>Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from
config.sh. MakeMaker will add to CONFIG the following values anyway:
ar
cc
cccdlflags
ccdlflags
dlext
dlsrc
ld
lddlflags
ldflags
libc
lib_ext
obj_ext
ranlib
sitelibexp
sitearchexp
so</p>
</dd>
</li>
<dt><strong><a name="item_configure">CONFIGURE</a></strong>
<dd>
<p>CODE reference. The subroutine should return a hash reference. The
hash may contain further attributes, e.g. {LIBS => ...}, that have to
be determined by some evaluation method.</p>
</dd>
</li>
<dt><strong><a name="item_define">DEFINE</a></strong>
<dd>
<p>Something like <code>"-DHAVE_UNISTD_H"</code></p>
</dd>
</li>
<dt><strong><a name="item_destdir">DESTDIR</a></strong>
<dd>
<p>This is the root directory into which the code will be installed. It
<em>prepends itself to the normal prefix</em>. For example, if your code
would normally go into <em>/usr/local/lib/perl</em> you could set DESTDIR=~/tmp/
and installation would go into <em>~/tmp/usr/local/lib/perl</em>.</p>
</dd>
<dd>
<p>This is primarily of use for people who repackage Perl modules.</p>
</dd>
<dd>
<p>NOTE: Due to the nature of make, it is important that you put the trailing
slash on your DESTDIR. <em>~/tmp/</em> not <em>~/tmp</em>.</p>
</dd>
</li>
<dt><strong><a name="item_dir">DIR</a></strong>
<dd>
<p>Ref to array of subdirectories containing Makefile.PLs e.g. [ 'sdbm'
] in ext/SDBM_File</p>
</dd>
</li>
<dt><strong><a name="item_distname">DISTNAME</a></strong>
<dd>
<p>A safe filename for the package.</p>
</dd>
<dd>
<p>Defaults to NAME above but with :: replaced with -.</p>
</dd>
<dd>
<p>For example, Foo::Bar becomes Foo-Bar.</p>
</dd>
</li>
<dt><strong><a name="item_distvname">DISTVNAME</a></strong>
<dd>
<p>Your name for distributing the package with the version number
included. This is used by 'make dist' to name the resulting archive
file.</p>
</dd>
<dd>
<p>Defaults to DISTNAME-VERSION.</p>
</dd>
<dd>
<p>For example, version 1.04 of Foo::Bar becomes Foo-Bar-1.04.</p>
</dd>
<dd>
<p>On some OS's where . has special meaning VERSION_SYM may be used in
place of VERSION.</p>
</dd>
</li>
<dt><strong><a name="item_dl_funcs">DL_FUNCS</a></strong>
<dd>
<p>Hashref of symbol names for routines to be made available as universal
symbols. Each key/value pair consists of the package name and an
array of routine names in that package. Used only under AIX, OS/2,
VMS and Win32 at present. The routine names supplied will be expanded
in the same way as XSUB names are expanded by the <a href="#item_xs"><code>XS()</code></a> macro.
Defaults to</p>
</dd>
<dd>
<pre>
<span class="operator">{</span><span class="string">"$(NAME)"</span> <span class="operator">=></span> <span class="operator">[</span><span class="string">"boot_$(NAME)"</span> <span class="operator">]</span> <span class="operator">}</span>
</pre>
</dd>
<dd>
<p>e.g.</p>
</dd>
<dd>
<pre>
<span class="operator">{</span><span class="string">"RPC"</span> <span class="operator">=></span> <span class="operator">[</span><span class="string">qw( boot_rpcb rpcb_gettime getnetconfigent )</span><span class="operator">]</span><span class="operator">,</span>
<span class="string">"NetconfigPtr"</span> <span class="operator">=></span> <span class="operator">[</span> <span class="string">'DESTROY'</span><span class="operator">]</span> <span class="operator">}</span>
</pre>
</dd>
<dd>
<p>Please see the <a href="../../lib/ExtUtils/Mksymlists.html">the ExtUtils::Mksymlists manpage</a> documentation for more information
about the DL_FUNCS, DL_VARS and FUNCLIST attributes.</p>
</dd>
</li>
<dt><strong><a name="item_dl_vars">DL_VARS</a></strong>
<dd>
<p>Array 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 ) ])</p>
</dd>
</li>
<dt><strong><a name="item_exclude_ext">EXCLUDE_EXT</a></strong>
<dd>
<p>Array of extension names to exclude when doing a static build. This
is ignored if INCLUDE_EXT is present. Consult INCLUDE_EXT for more
details. (e.g. [ qw( Socket POSIX ) ] )</p>
</dd>
<dd>
<p>This attribute may be most useful when specified as a string on the
command line: perl Makefile.PL EXCLUDE_EXT='Socket Safe'</p>
</dd>
</li>
<dt><strong><a name="item_exe_files">EXE_FILES</a></strong>
<dd>
<p>Ref to array of executable files. The files will be copied to the
INST_SCRIPT directory. Make realclean will delete them from there
again.</p>
</dd>
<dd>
<p>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 run
properly even if perl is not in /usr/bin/perl.</p>
</dd>
</li>
<dt><strong><a name="item_first_makefile">FIRST_MAKEFILE</a></strong>
<dd>
<p>The name of the Makefile to be produced. This is used for the second
Makefile that will be produced for the MAP_TARGET.</p>
</dd>
<dd>
<p>Defaults to 'Makefile' or 'Descrip.MMS' on VMS.</p>
</dd>
<dd>
<p>(Note: we couldn't use MAKEFILE because dmake uses this for something
else).</p>
</dd>
</li>
<dt><strong><a name="item_fullperl">FULLPERL</a></strong>
<dd>
<p>Perl binary able to run this extension, load XS modules, etc...</p>
</dd>
</li>
<dt><strong><a name="item_fullperlrun">FULLPERLRUN</a></strong>
<dd>
<p>Like PERLRUN, except it uses FULLPERL.</p>
</dd>
</li>
<dt><strong><a name="item_fullperlruninst">FULLPERLRUNINST</a></strong>
<dd>
<p>Like PERLRUNINST, except it uses FULLPERL.</p>
</dd>
</li>
<dt><strong><a name="item_funclist">FUNCLIST</a></strong>
<dd>
<p>This provides an alternate means to specify function names to be
exported from the extension. Its value is a reference to an
array of function names to be exported by the extension. These
names are passed through unaltered to the linker options file.</p>
</dd>
</li>
<dt><strong><a name="item_h">H</a></strong>
<dd>
<p>Ref to array of *.h file names. Similar to C.</p>
</dd>
</li>
<dt><strong><a name="item_imports">IMPORTS</a></strong>
<dd>
<p>This attribute is used to specify names to be imported into the
extension. Takes a hash ref.</p>
</dd>
<dd>
<p>It is only used on OS/2 and Win32.</p>
</dd>
</li>
<dt><strong><a name="item_inc">INC</a></strong>
<dd>
<p>Include file dirs eg: <code>"-I/usr/5include -I/path/to/inc"</code></p>
</dd>
</li>
<dt><strong><a name="item_include_ext">INCLUDE_EXT</a></strong>
<dd>
<p>Array of extension names to be included when doing a static build.
MakeMaker will normally build with all of the installed extensions when
doing a static build, and that is usually the desired behavior. If
INCLUDE_EXT is present then MakeMaker will build only with those extensions
which are explicitly mentioned. (e.g. [ qw( Socket POSIX ) ])</p>
</dd>
<dd>
<p>It is not necessary to mention DynaLoader or the current extension when
filling in INCLUDE_EXT. If the INCLUDE_EXT is mentioned but is empty then
only DynaLoader and the current extension will be included in the build.</p>
</dd>
<dd>
<p>This attribute may be most useful when specified as a string on the
command line: perl Makefile.PL INCLUDE_EXT='POSIX Socket Devel::Peek'</p>
</dd>
</li>
<dt><strong><a name="item_installarchlib">INSTALLARCHLIB</a></strong>
<dd>
<p>Used by 'make install', which copies files from INST_ARCHLIB to this
directory if INSTALLDIRS is set to perl.</p>
</dd>
</li>
<dt><strong><a name="item_installbin">INSTALLBIN</a></strong>
<dd>
<p>Directory to install binary files (e.g. tkperl) into if
INSTALLDIRS=perl.</p>
</dd>
</li>
<dt><strong><a name="item_installdirs">INSTALLDIRS</a></strong>
<dd>
<p>Determines which of the sets of installation directories to choose:
perl, site or vendor. Defaults to site.</p>
</dd>
</li>
<dt><strong><a name="item_installman1dir">INSTALLMAN1DIR</a></strong>
<dt><strong><a name="item_installman3dir">INSTALLMAN3DIR</a></strong>
<dd>
<p>These directories get the man pages at 'make install' time if
INSTALLDIRS=perl. Defaults to $Config{installman*dir}.</p>
</dd>
<dd>
<p>If set to 'none', no man pages will be installed.</p>
</dd>
</li>
<dt><strong><a name="item_installprivlib">INSTALLPRIVLIB</a></strong>
<dd>
<p>Used by 'make install', which copies files from INST_LIB to this
directory if INSTALLDIRS is set to perl.</p>
</dd>
<dd>
<p>Defaults to $Config{installprivlib}.</p>
</dd>
</li>
<dt><strong><a name="item_installscript">INSTALLSCRIPT</a></strong>
<dd>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?