Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / man / man3 / ExtUtils::Liblist.3
CommitLineData
920dae64
AT
1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "ExtUtils::Liblist 3"
132.TH ExtUtils::Liblist 3 "2001-09-21" "perl v5.8.8" "Perl Programmers Reference Guide"
133.SH "NAME"
134ExtUtils::Liblist \- determine libraries to use and how to use them
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137.Vb 1
138\& require ExtUtils::Liblist;
139.Ve
140.PP
141.Vb 1
142\& $MM->ext($potential_libs, $verbose, $need_names);
143.Ve
144.PP
145.Vb 2
146\& # Usually you can get away with:
147\& ExtUtils::Liblist->ext($potential_libs, $verbose, $need_names)
148.Ve
149.SH "DESCRIPTION"
150.IX Header "DESCRIPTION"
151This utility takes a list of libraries in the form \f(CW\*(C`\-llib1 \-llib2
152\&\-llib3\*(C'\fR and returns lines suitable for inclusion in an extension
153Makefile. Extra library paths may be included with the form
154\&\f(CW\*(C`\-L/another/path\*(C'\fR this will affect the searches for all subsequent
155libraries.
156.PP
157It returns an array of four or five scalar values: \s-1EXTRALIBS\s0,
158\&\s-1BSLOADLIBS\s0, \s-1LDLOADLIBS\s0, \s-1LD_RUN_PATH\s0, and, optionally, a reference to
159the array of the filenames of actual libraries. Some of these don't
160mean anything unless on Unix. See the details about those platform
161specifics below. The list of the filenames is returned only if
162\&\f(CW$need_names\fR argument is true.
163.PP
164Dependent libraries can be linked in one of three ways:
165.IP "* For static extensions" 2
166.IX Item "For static extensions"
167by the ld command when the perl binary is linked with the extension
168library. See \s-1EXTRALIBS\s0 below.
169.IP "* For dynamic extensions at build/link time" 2
170.IX Item "For dynamic extensions at build/link time"
171by the ld command when the shared object is built/linked. See
172\&\s-1LDLOADLIBS\s0 below.
173.IP "* For dynamic extensions at load time" 2
174.IX Item "For dynamic extensions at load time"
175by the DynaLoader when the shared object is loaded. See \s-1BSLOADLIBS\s0
176below.
177.Sh "\s-1EXTRALIBS\s0"
178.IX Subsection "EXTRALIBS"
179List of libraries that need to be linked with when linking a perl
180binary which includes this extension. Only those libraries that
181actually exist are included. These are written to a file and used
182when linking perl.
183.Sh "\s-1LDLOADLIBS\s0 and \s-1LD_RUN_PATH\s0"
184.IX Subsection "LDLOADLIBS and LD_RUN_PATH"
185List of those libraries which can or must be linked into the shared
186library when created using ld. These may be static or dynamic
187libraries. \s-1LD_RUN_PATH\s0 is a colon separated list of the directories
188in \s-1LDLOADLIBS\s0. It is passed as an environment variable to the process
189that links the shared library.
190.Sh "\s-1BSLOADLIBS\s0"
191.IX Subsection "BSLOADLIBS"
192List of those libraries that are needed but can be linked in
193dynamically at run time on this platform. SunOS/Solaris does not need
194this because ld records the information (from \s-1LDLOADLIBS\s0) into the
195object file. This list is used to create a .bs (bootstrap) file.
196.SH "PORTABILITY"
197.IX Header "PORTABILITY"
198This module deals with a lot of system dependencies and has quite a
199few architecture specific \f(CW\*(C`if\*(C'\fRs in the code.
200.Sh "\s-1VMS\s0 implementation"
201.IX Subsection "VMS implementation"
202The version of \fIext()\fR which is executed under \s-1VMS\s0 differs from the
203Unix\-OS/2 version in several respects:
204.IP "\(bu" 2
205Input library and path specifications are accepted with or without the
206\&\f(CW\*(C`\-l\*(C'\fR and \f(CW\*(C`\-L\*(C'\fR prefixes used by Unix linkers. If neither prefix is
207present, a token is considered a directory to search if it is in fact
208a directory, and a library to search for otherwise. Authors who wish
209their extensions to be portable to Unix or \s-1OS/2\s0 should use the Unix
210prefixes, since the Unix\-OS/2 version of \fIext()\fR requires them.
211.IP "\(bu" 2
212Wherever possible, shareable images are preferred to object libraries,
213and object libraries to plain object files. In accordance with \s-1VMS\s0
214naming conventions, \fIext()\fR looks for files named \fIlib\fRshr and \fIlib\fRrtl;
215it also looks for \fIlib\fRlib and lib\fIlib\fR to accommodate Unix conventions
216used in some ported software.
217.IP "\(bu" 2
218For each library that is found, an appropriate directive for a linker options
219file is generated. The return values are space-separated strings of
220these directives, rather than elements used on the linker command line.
221.IP "\(bu" 2
222\&\s-1LDLOADLIBS\s0 contains both the libraries found based on \f(CW$potential_libs\fR and
223the CRTLs, if any, specified in Config.pm. \s-1EXTRALIBS\s0 contains just those
224libraries found based on \f(CW$potential_libs\fR. \s-1BSLOADLIBS\s0 and \s-1LD_RUN_PATH\s0
225are always empty.
226.PP
227In addition, an attempt is made to recognize several common Unix library
228names, and filter them out or convert them to their \s-1VMS\s0 equivalents, as
229appropriate.
230.PP
231In general, the \s-1VMS\s0 version of \fIext()\fR should properly handle input from
232extensions originally designed for a Unix or \s-1VMS\s0 environment. If you
233encounter problems, or discover cases where the search could be improved,
234please let us know.
235.Sh "Win32 implementation"
236.IX Subsection "Win32 implementation"
237The version of \fIext()\fR which is executed under Win32 differs from the
238Unix\-OS/2 version in several respects:
239.IP "\(bu" 2
240If \f(CW$potential_libs\fR is empty, the return value will be empty.
241Otherwise, the libraries specified by \f(CW$Config{perllibs}\fR (see Config.pm)
242will be appended to the list of \f(CW$potential_libs\fR. The libraries
243will be searched for in the directories specified in \f(CW$potential_libs\fR,
244\&\f(CW$Config{libpth}\fR, and in \f(CW\*(C`$Config{installarchlib}/CORE\*(C'\fR.
245For each library that is found, a space-separated list of fully qualified
246library pathnames is generated.
247.IP "\(bu" 2
248Input library and path specifications are accepted with or without the
249\&\f(CW\*(C`\-l\*(C'\fR and \f(CW\*(C`\-L\*(C'\fR prefixes used by Unix linkers.
250.Sp
251An entry of the form \f(CW\*(C`\-La:\efoo\*(C'\fR specifies the \f(CW\*(C`a:\efoo\*(C'\fR directory to look
252for the libraries that follow.
253.Sp
254An entry of the form \f(CW\*(C`\-lfoo\*(C'\fR specifies the library \f(CW\*(C`foo\*(C'\fR, which may be
255spelled differently depending on what kind of compiler you are using. If
256you are using \s-1GCC\s0, it gets translated to \f(CW\*(C`libfoo.a\*(C'\fR, but for other win32
257compilers, it becomes \f(CW\*(C`foo.lib\*(C'\fR. If no files are found by those translated
258names, one more attempt is made to find them using either \f(CW\*(C`foo.a\*(C'\fR or
259\&\f(CW\*(C`libfoo.lib\*(C'\fR, depending on whether \s-1GCC\s0 or some other win32 compiler is
260being used, respectively.
261.Sp
262If neither the \f(CW\*(C`\-L\*(C'\fR or \f(CW\*(C`\-l\*(C'\fR prefix is present in an entry, the entry is
263considered a directory to search if it is in fact a directory, and a
264library to search for otherwise. The \f(CW$Config{lib_ext}\fR suffix will
265be appended to any entries that are not directories and don't already have
266the suffix.
267.Sp
268Note that the \f(CW\*(C`\-L\*(C'\fR and \f(CW\*(C`\-l\*(C'\fR prefixes are \fBnot required\fR, but authors
269who wish their extensions to be portable to Unix or \s-1OS/2\s0 should use the
270prefixes, since the Unix\-OS/2 version of \fIext()\fR requires them.
271.IP "\(bu" 2
272Entries cannot be plain object files, as many Win32 compilers will
273not handle object files in the place of libraries.
274.IP "\(bu" 2
275Entries in \f(CW$potential_libs\fR beginning with a colon and followed by
276alphanumeric characters are treated as flags. Unknown flags will be ignored.
277.Sp
278An entry that matches \f(CW\*(C`/:nodefault/i\*(C'\fR disables the appending of default
279libraries found in \f(CW$Config{perllibs}\fR (this should be only needed very rarely).
280.Sp
281An entry that matches \f(CW\*(C`/:nosearch/i\*(C'\fR disables all searching for
282the libraries specified after it. Translation of \f(CW\*(C`\-Lfoo\*(C'\fR and
283\&\f(CW\*(C`\-lfoo\*(C'\fR still happens as appropriate (depending on compiler being used,
284as reflected by \f(CW$Config{cc}\fR), but the entries are not verified to be
285valid files or directories.
286.Sp
287An entry that matches \f(CW\*(C`/:search/i\*(C'\fR reenables searching for
288the libraries specified after it. You can put it at the end to
289enable searching for default libraries specified by \f(CW$Config{perllibs}\fR.
290.IP "\(bu" 2
291The libraries specified may be a mixture of static libraries and
292import libraries (to link with DLLs). Since both kinds are used
293pretty transparently on the Win32 platform, we do not attempt to
294distinguish between them.
295.IP "\(bu" 2
296\&\s-1LDLOADLIBS\s0 and \s-1EXTRALIBS\s0 are always identical under Win32, and \s-1BSLOADLIBS\s0
297and \s-1LD_RUN_PATH\s0 are always empty (this may change in future).
298.IP "\(bu" 2
299You must make sure that any paths and path components are properly
300surrounded with double-quotes if they contain spaces. For example,
301\&\f(CW$potential_libs\fR could be (literally):
302.Sp
303.Vb 1
304\& "-Lc:\eProgram Files\evc\elib" msvcrt.lib "la test\efoo bar.lib"
305.Ve
306.Sp
307Note how the first and last entries are protected by quotes in order
308to protect the spaces.
309.IP "\(bu" 2
310Since this module is most often used only indirectly from extension
311\&\f(CW\*(C`Makefile.PL\*(C'\fR files, here is an example \f(CW\*(C`Makefile.PL\*(C'\fR entry to add
312a library to the build process for an extension:
313.Sp
314.Vb 1
315\& LIBS => ['-lgl']
316.Ve
317.Sp
318When using \s-1GCC\s0, that entry specifies that MakeMaker should first look
319for \f(CW\*(C`libgl.a\*(C'\fR (followed by \f(CW\*(C`gl.a\*(C'\fR) in all the locations specified by
320\&\f(CW$Config{libpth}\fR.
321.Sp
322When using a compiler other than \s-1GCC\s0, the above entry will search for
323\&\f(CW\*(C`gl.lib\*(C'\fR (followed by \f(CW\*(C`libgl.lib\*(C'\fR).
324.Sp
325If the library happens to be in a location not in \f(CW$Config{libpth}\fR,
326you need:
327.Sp
328.Vb 1
329\& LIBS => ['-Lc:\egllibs -lgl']
330.Ve
331.Sp
332Here is a less often used example:
333.Sp
334.Vb 1
335\& LIBS => ['-lgl', ':nosearch -Ld:\emesalibs -lmesa -luser32']
336.Ve
337.Sp
338This specifies a search for library \f(CW\*(C`gl\*(C'\fR as before. If that search
339fails to find the library, it looks at the next item in the list. The
340\&\f(CW\*(C`:nosearch\*(C'\fR flag will prevent searching for the libraries that follow,
341so it simply returns the value as \f(CW\*(C`\-Ld:\emesalibs \-lmesa \-luser32\*(C'\fR,
342since \s-1GCC\s0 can use that value as is with its linker.
343.Sp
344When using the Visual C compiler, the second item is returned as
345\&\f(CW\*(C`\-libpath:d:\emesalibs mesa.lib user32.lib\*(C'\fR.
346.Sp
347When using the Borland compiler, the second item is returned as
348\&\f(CW\*(C`\-Ld:\emesalibs mesa.lib user32.lib\*(C'\fR, and MakeMaker takes care of
349moving the \f(CW\*(C`\-Ld:\emesalibs\*(C'\fR to the correct place in the linker
350command line.
351.SH "SEE ALSO"
352.IX Header "SEE ALSO"
353ExtUtils::MakeMaker