📄 extutils::liblist.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::Liblist 3".TH ExtUtils::Liblist 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::Liblist \- determine libraries to use and how to use them.SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 1\& require ExtUtils::Liblist;\&\& $MM\->ext($potential_libs, $verbose, $need_names);\&\& # Usually you can get away with:\& ExtUtils::Liblist\->ext($potential_libs, $verbose, $need_names).Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"This utility takes a list of libraries in the form \f(CW\*(C`\-llib1 \-llib2\&\-llib3\*(C'\fR and returns lines suitable for inclusion in an extensionMakefile. Extra library paths may be included with the form\&\f(CW\*(C`\-L/another/path\*(C'\fR this will affect the searches for all subsequentlibraries..PPIt returns an array of four or five scalar values: \s-1EXTRALIBS\s0,\&\s-1BSLOADLIBS\s0, \s-1LDLOADLIBS\s0, \s-1LD_RUN_PATH\s0, and, optionally, a reference tothe array of the filenames of actual libraries. Some of these don'tmean anything unless on Unix. See the details about those platformspecifics below. The list of the filenames is returned only if\&\f(CW$need_names\fR argument is true..PPDependent libraries can be linked in one of three ways:.IP "\(bu" 2For static extensions.Spby the ld command when the perl binary is linked with the extensionlibrary. See \s-1EXTRALIBS\s0 below..IP "\(bu" 2For dynamic extensions at build/link time.Spby the ld command when the shared object is built/linked. See\&\s-1LDLOADLIBS\s0 below..IP "\(bu" 2For dynamic extensions at load time.Spby the DynaLoader when the shared object is loaded. See \s-1BSLOADLIBS\s0below..Sh "\s-1EXTRALIBS\s0".IX Subsection "EXTRALIBS"List of libraries that need to be linked with when linking a perlbinary which includes this extension. Only those libraries thatactually exist are included. These are written to a file and usedwhen linking perl..Sh "\s-1LDLOADLIBS\s0 and \s-1LD_RUN_PATH\s0".IX Subsection "LDLOADLIBS and LD_RUN_PATH"List of those libraries which can or must be linked into the sharedlibrary when created using ld. These may be static or dynamiclibraries. \s-1LD_RUN_PATH\s0 is a colon separated list of the directoriesin \s-1LDLOADLIBS\s0. It is passed as an environment variable to the processthat links the shared library..Sh "\s-1BSLOADLIBS\s0".IX Subsection "BSLOADLIBS"List of those libraries that are needed but can be linked indynamically at run time on this platform. SunOS/Solaris does not needthis because ld records the information (from \s-1LDLOADLIBS\s0) into theobject file. This list is used to create a .bs (bootstrap) file..SH "PORTABILITY".IX Header "PORTABILITY"This module deals with a lot of system dependencies and has quite afew architecture specific \f(CW\*(C`if\*(C'\fRs in the code..Sh "\s-1VMS\s0 implementation".IX Subsection "VMS implementation"The version of \fIext()\fR which is executed under \s-1VMS\s0 differs from theUnix\-OS/2 version in several respects:.IP "\(bu" 2Input library and path specifications are accepted with or without the\&\f(CW\*(C`\-l\*(C'\fR and \f(CW\*(C`\-L\*(C'\fR prefixes used by Unix linkers. If neither prefix ispresent, a token is considered a directory to search if it is in facta directory, and a library to search for otherwise. Authors who wishtheir extensions to be portable to Unix or \s-1OS/2\s0 should use the Unixprefixes, since the Unix\-OS/2 version of \fIext()\fR requires them..IP "\(bu" 2Wherever possible, shareable images are preferred to object libraries,and object libraries to plain object files. In accordance with \s-1VMS\s0naming conventions, \fIext()\fR looks for files named \fIlib\fRshr and \fIlib\fRrtl;it also looks for \fIlib\fRlib and lib\fIlib\fR to accommodate Unix conventionsused in some ported software..IP "\(bu" 2For each library that is found, an appropriate directive for a linker optionsfile is generated. The return values are space-separated strings ofthese directives, rather than elements used on the linker command line..IP "\(bu" 2\&\s-1LDLOADLIBS\s0 contains both the libraries found based on \f(CW$potential_libs\fR andthe CRTLs, if any, specified in Config.pm. \s-1EXTRALIBS\s0 contains just thoselibraries found based on \f(CW$potential_libs\fR. \s-1BSLOADLIBS\s0 and \s-1LD_RUN_PATH\s0are always empty..PPIn addition, an attempt is made to recognize several common Unix librarynames, and filter them out or convert them to their \s-1VMS\s0 equivalents, asappropriate..PPIn general, the \s-1VMS\s0 version of \fIext()\fR should properly handle input fromextensions originally designed for a Unix or \s-1VMS\s0 environment. If youencounter problems, or discover cases where the search could be improved,please let us know..Sh "Win32 implementation".IX Subsection "Win32 implementation"The version of \fIext()\fR which is executed under Win32 differs from theUnix\-OS/2 version in several respects:.IP "\(bu" 2If \f(CW$potential_libs\fR is empty, the return value will be empty.Otherwise, the libraries specified by \f(CW$Config{perllibs}\fR (see Config.pm)will be appended to the list of \f(CW$potential_libs\fR. The librarieswill be searched for in the directories specified in \f(CW$potential_libs\fR,\&\f(CW$Config{libpth}\fR, and in \f(CW\*(C`$Config{installarchlib}/CORE\*(C'\fR.For each library that is found, a space-separated list of fully qualifiedlibrary pathnames is generated..IP "\(bu" 2Input library and path specifications are accepted with or without the\&\f(CW\*(C`\-l\*(C'\fR and \f(CW\*(C`\-L\*(C'\fR prefixes used by Unix linkers..SpAn entry of the form \f(CW\*(C`\-La:\efoo\*(C'\fR specifies the \f(CW\*(C`a:\efoo\*(C'\fR directory to lookfor the libraries that follow..SpAn entry of the form \f(CW\*(C`\-lfoo\*(C'\fR specifies the library \f(CW\*(C`foo\*(C'\fR, which may bespelled differently depending on what kind of compiler you are using. Ifyou are using \s-1GCC\s0, it gets translated to \f(CW\*(C`libfoo.a\*(C'\fR, but for other win32compilers, it becomes \f(CW\*(C`foo.lib\*(C'\fR. If no files are found by those translatednames, one more attempt is made to find them using either \f(CW\*(C`foo.a\*(C'\fR or\&\f(CW\*(C`libfoo.lib\*(C'\fR, depending on whether \s-1GCC\s0 or some other win32 compiler isbeing used, respectively..SpIf neither the \f(CW\*(C`\-L\*(C'\fR or \f(CW\*(C`\-l\*(C'\fR prefix is present in an entry, the entry isconsidered a directory to search if it is in fact a directory, and alibrary to search for otherwise. The \f(CW$Config{lib_ext}\fR suffix willbe appended to any entries that are not directories and don't already havethe suffix..SpNote that the \f(CW\*(C`\-L\*(C'\fR and \f(CW\*(C`\-l\*(C'\fR prefixes are \fBnot required\fR, but authorswho wish their extensions to be portable to Unix or \s-1OS/2\s0 should use theprefixes, since the Unix\-OS/2 version of \fIext()\fR requires them..IP "\(bu" 2Entries cannot be plain object files, as many Win32 compilers willnot handle object files in the place of libraries..IP "\(bu" 2Entries in \f(CW$potential_libs\fR beginning with a colon and followed byalphanumeric characters are treated as flags. Unknown flags will be ignored..SpAn entry that matches \f(CW\*(C`/:nodefault/i\*(C'\fR disables the appending of defaultlibraries found in \f(CW$Config{perllibs}\fR (this should be only needed very rarely)..SpAn entry that matches \f(CW\*(C`/:nosearch/i\*(C'\fR disables all searching forthe libraries specified after it. Translation of \f(CW\*(C`\-Lfoo\*(C'\fR and\&\f(CW\*(C`\-lfoo\*(C'\fR still happens as appropriate (depending on compiler being used,as reflected by \f(CW$Config{cc}\fR), but the entries are not verified to bevalid files or directories..SpAn entry that matches \f(CW\*(C`/:search/i\*(C'\fR reenables searching forthe libraries specified after it. You can put it at the end toenable searching for default libraries specified by \f(CW$Config{perllibs}\fR..IP "\(bu" 2The libraries specified may be a mixture of static libraries andimport libraries (to link with DLLs). Since both kinds are usedpretty transparently on the Win32 platform, we do not attempt todistinguish between them..IP "\(bu" 2\&\s-1LDLOADLIBS\s0 and \s-1EXTRALIBS\s0 are always identical under Win32, and \s-1BSLOADLIBS\s0and \s-1LD_RUN_PATH\s0 are always empty (this may change in future)..IP "\(bu" 2You must make sure that any paths and path components are properlysurrounded with double-quotes if they contain spaces. For example,\&\f(CW$potential_libs\fR could be (literally):.Sp.Vb 1\& "\-Lc:\eProgram Files\evc\elib" msvcrt.lib "la test\efoo bar.lib".Ve.SpNote how the first and last entries are protected by quotes in orderto protect the spaces..IP "\(bu" 2Since this module is most often used only indirectly from extension\&\f(CW\*(C`Makefile.PL\*(C'\fR files, here is an example \f(CW\*(C`Makefile.PL\*(C'\fR entry to adda library to the build process for an extension:.Sp.Vb 1\& LIBS => [\*(Aq\-lgl\*(Aq].Ve.SpWhen using \s-1GCC\s0, that entry specifies that MakeMaker should first lookfor \f(CW\*(C`libgl.a\*(C'\fR (followed by \f(CW\*(C`gl.a\*(C'\fR) in all the locations specified by\&\f(CW$Config{libpth}\fR..SpWhen using a compiler other than \s-1GCC\s0, the above entry will search for\&\f(CW\*(C`gl.lib\*(C'\fR (followed by \f(CW\*(C`libgl.lib\*(C'\fR)..SpIf the library happens to be in a location not in \f(CW$Config{libpth}\fR,you need:.Sp.Vb 1\& LIBS => [\*(Aq\-Lc:\egllibs \-lgl\*(Aq].Ve.SpHere is a less often used example:.Sp.Vb 1\& LIBS => [\*(Aq\-lgl\*(Aq, \*(Aq:nosearch \-Ld:\emesalibs \-lmesa \-luser32\*(Aq].Ve.SpThis specifies a search for library \f(CW\*(C`gl\*(C'\fR as before. If that searchfails to find the library, it looks at the next item in the list. The\&\f(CW\*(C`:nosearch\*(C'\fR flag will prevent searching for the libraries that follow,so it simply returns the value as \f(CW\*(C`\-Ld:\emesalibs \-lmesa \-luser32\*(C'\fR,since \s-1GCC\s0 can use that value as is with its linker..SpWhen using the Visual C compiler, the second item is returned as\&\f(CW\*(C`\-libpath:d:\emesalibs mesa.lib user32.lib\*(C'\fR..SpWhen using the Borland compiler, the second item is returned as\&\f(CW\*(C`\-Ld:\emesalibs mesa.lib user32.lib\*(C'\fR, and MakeMaker takes care ofmoving the \f(CW\*(C`\-Ld:\emesalibs\*(C'\fR to the correct place in the linkercommand line..SH "SEE ALSO".IX Header "SEE ALSO"ExtUtils::MakeMaker
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -