Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Inline-FAQ.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
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 "Inline-FAQ 3"
132.TH Inline-FAQ 3 "2002-10-28" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134Inline\-FAQ \- The Inline FAQ
135.SH "DESCRIPTION"
136.IX Header "DESCRIPTION"
137Welcome to the official Inline \s-1FAQ\s0. In this case, \fB\s-1FAQ\s0\fR means:
138.PP
139.Vb 1
140\& Formerly Answered Questions
141.Ve
142.PP
143This is a collection of old, long-winded emails that myself and others
144have sent to the Inline mailing list. (inline@perl.org) They have been
145reviewed and edited for general Inline edification. Some of them may be
146related to a specific language. They are presented here in a traditional
147\&\s-1FAQ\s0 layout.
148.SH "General Inline"
149.IX Header "General Inline"
150Since there is only a handful of content so far, all FAQs are currently
151under this heading.
152.Sh "How disposable is a .Inline or _Inline directory?"
153.IX Subsection "How disposable is a .Inline or _Inline directory?"
154I probably need to be more emphatic about the roll of _Inline/ cache
155directories. Since they are created automatically, they are completely
156disposable. I delete them all the time. And it is fine to have a
157different one for each project. In fact as long as you don't have
158~/.Inline/ defined, Inline will create a new ./_Inline directory. You
159can move that to ./.Inline and it will continue to work if you want to
160give it more longevity and hide it from view. There is a long
161complicated list of rules about how [_.]Inline/ directories are
162used/created. But it was designed to give you the most
163flexibility/ease\-of\-use. Never be afraid to nuke 'em. They'll just pop
164right back next time. :)
165.Sh "Whatever happened to the \s-1SITE_INSTALL\s0 option?"
166.IX Subsection "Whatever happened to the SITE_INSTALL option?"
167\&\s-1SITE_INSTALL\s0 is gone. I was going to leave it in and change the
168semantics, but thought it better to remove it, so people wouldn't try to
169use it the old way. There is now _INSTALL_ (but you're not supposed to
170know that :). It works magically through the use of Inline::MakeMaker. I
171explained this earlier but it's worth going through again because it's
172the biggest change for 0.40. Here's how to 'permanently' install an
173Inline extension (Inline based module) with 0.40:
174.PP
175.Vb 11
176\& 1) Create a module with Inline.
177\& 2) Test it using the normal/local _Inline/ cache.
178\& 3) Create a Makefile.PL (like the one produced by h2xs)
179\& 4) Change 'use ExtUtils::MakeMaker' to 'use Inline::MakeMaker'
180\& 5) Change your 'use Inline C => DATA' to 'use Inline C => DATA => NAME
181\& => Foo => VERSION => 1.23'
182\& 6) Make sure NAME matches your package name ('Foo'), or begins with
183\& 'Foo::'.
184\& 7) Make sure VERSION matches $Foo::VERSION. This must be a string (not a
185\& number) matching /^\ed\e.\ed\ed$/
186\& 8) Do the perl/make/test/install dance (thanks binkley :)
187.Ve
188.PP
189With Inline 0.41 (or thereabouts) you can skip steps 3 & 4, and just
190say 'perl \-MInline=INSTALL ./Foo.pm'. This will work for non-Inline
191modules too. It will become the defacto standard (since there is no easy
192standard) way of installing a Perl module. It will allow Makefile.PL
193parameters 'perl \-MInline=INSTALL ./Foo.pm \- PREFIX=/home/ingy/perl' and
194things like that. It will also make use of a \s-1MANIFEST\s0 if you provide
195one.
196.Sh "How do I create a binary distribution using Inline?"
197.IX Subsection "How do I create a binary distribution using Inline?"
198I've figured out how to create and install a \s-1PPM\s0 binary distribution;
199with or without distributing the C code! And I've decided to share it
200with all of you :)
201.PP
202\&\s-1NOTE:\s0 Future versions of Inline will make this process a one line
203command. But for now just use this simple recipe.
204.PP
205\&\-\-\-
206.PP
207The Inline 0.40 distribution comes with a sample extension module called
208Math::Simple. Theoretically you could distribute this module on \s-1CPAN\s0. It
209has all the necessary support for installation. You can find it in
210Inline\-0.40/modules/Math/Simple/. Here are the steps for converting this
211into a binary distribution *without* C source code.
212.PP
213\&\s-1NOTE:\s0 The recipient of this binary distribution will need to have the
214\&\s-1PPM\s0.pm module installed. This module requires a lot of other \s-1CPAN\s0
215modules. ActivePerl (available for Win32, Linux, and Solaris) has all of
216these bundled. While ActivePerl isn't required, it makes things (a
217lot) easier.
218.PP
2191) cd Inline\-0.40/Math/Simple/
220.PP
2212) Divide Simple.pm into two files:
222.PP
223.Vb 7
224\& ---8<--- (Simple.pm)
225\& package Math::Simple;
226\& use strict;
227\& require Exporter;
228\& @Math::Simple::ISA = qw(Exporter);
229\& @Math::Simple::EXPORT = qw(add subtract);
230\& $Math::Simple::VERSION = '1.23';
231.Ve
232.PP
233.Vb 10
234\& use Inline (C => 'src/Simple.c' =>
235\& NAME => 'Math::Simple',
236\& VERSION => '1.23',
237\& );
238\& 1;
239\& ---8<---
240\& ---8<--- (src/Simple.c)
241\& int add (int x, int y) {
242\& return x + y;
243\& }
244.Ve
245.PP
246.Vb 4
247\& int subtract (int x, int y) {
248\& return x - y;
249\& }
250\& ---8<---
251.Ve
252.PP
253So now you have the Perl in one file and the C in the other. The C code
254must be in a subdirectory.
255.PP
2563)
257Note that I also changed the term '\s-1DATA\s0' to the name of the C file. This
258will work just as if the C were still inline.
259.PP
2604) Run 'perl Makefile.PL'
261.PP
2625) Run 'make test'
263.PP
2646) Get the \s-1MD5\s0 key from 'blib/arch/auto/Math/Simple/Simple.inl'
265.PP
2667)
267Edit 'blib/lib/Math/Simple.pm'. Change 'src/Simple.c' to
268\&'02c61710cab5b659efc343a9a830aa73' (the \s-1MD5\s0 key)
269.PP
2708) Run 'make ppd'
271.PP
2729)
273Edit 'Math\-Simple.ppd'. Fill in \s-1AUTHOR\s0 and \s-1ABSTRACT\s0 if you wish. Then
274change:
275.PP
276.Vb 1
277\& <CODEBASE HREF="" />
278.Ve
279.PP
280to
281.PP
282.Vb 1
283\& <CODEBASE HREF="Math-Simple.tar.gz" />
284.Ve
285.PP
28610) Run:
287.PP
288.Vb 2
289\& tar cvf Math-Simple.tar blib
290\& gzip --best Math-Simple.tar
291.Ve
292.PP
29311)
294Run:
295.PP
296.Vb 2
297\& tar cvf Math-Simple-1.23.tar Math-Simple.ppd Math-Simple.tar.gz
298\& gzip --best Math-Simple-1.23.tar
299.Ve
300.PP
30112) Distribute Math\-Simple\-1.23.tar.gz with the following instructions:
302.PP
303A) Run:
304.PP
305.Vb 2
306\& gzip -d Math-Simple-1.23.tar.gz
307\& tar xvzf Math-Simple-1.23.tar
308.Ve
309.PP
310B) Run 'ppm install Math\-Simple.ppd'
311.PP
312C) Delete Math\-Simple.tar and Math\-Simple.ppd.
313.PP
314D) Test with:
315.PP
316.Vb 1
317\& perl -MMath::Simple -le 'print add(37, 42)'
318.Ve
319.PP
320\&\-\-\-
321.PP
322That's it. The process should also work with zip instead of tar, but I
323haven't tried it.
324.PP
325The recipient of the binary must have Perl built with a matching
326architecture. Luckily, ppm will catch this.
327.PP
328For a binary dist *with* C source code, simply omit steps 2, 3, 6, and
3297.
330.PP
331If this seems too hard, then in a future version you should be able to
332just type:
333.PP
334.Vb 1
335\& make ppm
336.Ve