Commit | Line | Data |
---|---|---|
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" | |
134 | Inline\-FAQ \- The Inline FAQ | |
135 | .SH "DESCRIPTION" | |
136 | .IX Header "DESCRIPTION" | |
137 | Welcome 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 | |
143 | This is a collection of old, long-winded emails that myself and others | |
144 | have sent to the Inline mailing list. (inline@perl.org) They have been | |
145 | reviewed and edited for general Inline edification. Some of them may be | |
146 | related 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" | |
150 | Since there is only a handful of content so far, all FAQs are currently | |
151 | under this heading. | |
152 | .Sh "How disposable is a .Inline or _Inline directory?" | |
153 | .IX Subsection "How disposable is a .Inline or _Inline directory?" | |
154 | I probably need to be more emphatic about the roll of _Inline/ cache | |
155 | directories. Since they are created automatically, they are completely | |
156 | disposable. I delete them all the time. And it is fine to have a | |
157 | different one for each project. In fact as long as you don't have | |
158 | ~/.Inline/ defined, Inline will create a new ./_Inline directory. You | |
159 | can move that to ./.Inline and it will continue to work if you want to | |
160 | give it more longevity and hide it from view. There is a long | |
161 | complicated list of rules about how [_.]Inline/ directories are | |
162 | used/created. But it was designed to give you the most | |
163 | flexibility/ease\-of\-use. Never be afraid to nuke 'em. They'll just pop | |
164 | right 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 | |
168 | semantics, but thought it better to remove it, so people wouldn't try to | |
169 | use it the old way. There is now _INSTALL_ (but you're not supposed to | |
170 | know that :). It works magically through the use of Inline::MakeMaker. I | |
171 | explained this earlier but it's worth going through again because it's | |
172 | the biggest change for 0.40. Here's how to 'permanently' install an | |
173 | Inline 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 | |
189 | With Inline 0.41 (or thereabouts) you can skip steps 3 & 4, and just | |
190 | say 'perl \-MInline=INSTALL ./Foo.pm'. This will work for non-Inline | |
191 | modules too. It will become the defacto standard (since there is no easy | |
192 | standard) way of installing a Perl module. It will allow Makefile.PL | |
193 | parameters 'perl \-MInline=INSTALL ./Foo.pm \- PREFIX=/home/ingy/perl' and | |
194 | things like that. It will also make use of a \s-1MANIFEST\s0 if you provide | |
195 | one. | |
196 | .Sh "How do I create a binary distribution using Inline?" | |
197 | .IX Subsection "How do I create a binary distribution using Inline?" | |
198 | I've figured out how to create and install a \s-1PPM\s0 binary distribution; | |
199 | with or without distributing the C code! And I've decided to share it | |
200 | with all of you :) | |
201 | .PP | |
202 | \&\s-1NOTE:\s0 Future versions of Inline will make this process a one line | |
203 | command. But for now just use this simple recipe. | |
204 | .PP | |
205 | \&\-\-\- | |
206 | .PP | |
207 | The Inline 0.40 distribution comes with a sample extension module called | |
208 | Math::Simple. Theoretically you could distribute this module on \s-1CPAN\s0. It | |
209 | has all the necessary support for installation. You can find it in | |
210 | Inline\-0.40/modules/Math/Simple/. Here are the steps for converting this | |
211 | into 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 | |
215 | modules. ActivePerl (available for Win32, Linux, and Solaris) has all of | |
216 | these bundled. While ActivePerl isn't required, it makes things (a | |
217 | lot) easier. | |
218 | .PP | |
219 | 1) cd Inline\-0.40/Math/Simple/ | |
220 | .PP | |
221 | 2) 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 | |
253 | So now you have the Perl in one file and the C in the other. The C code | |
254 | must be in a subdirectory. | |
255 | .PP | |
256 | 3) | |
257 | Note that I also changed the term '\s-1DATA\s0' to the name of the C file. This | |
258 | will work just as if the C were still inline. | |
259 | .PP | |
260 | 4) Run 'perl Makefile.PL' | |
261 | .PP | |
262 | 5) Run 'make test' | |
263 | .PP | |
264 | 6) Get the \s-1MD5\s0 key from 'blib/arch/auto/Math/Simple/Simple.inl' | |
265 | .PP | |
266 | 7) | |
267 | Edit 'blib/lib/Math/Simple.pm'. Change 'src/Simple.c' to | |
268 | \&'02c61710cab5b659efc343a9a830aa73' (the \s-1MD5\s0 key) | |
269 | .PP | |
270 | 8) Run 'make ppd' | |
271 | .PP | |
272 | 9) | |
273 | Edit 'Math\-Simple.ppd'. Fill in \s-1AUTHOR\s0 and \s-1ABSTRACT\s0 if you wish. Then | |
274 | change: | |
275 | .PP | |
276 | .Vb 1 | |
277 | \& <CODEBASE HREF="" /> | |
278 | .Ve | |
279 | .PP | |
280 | to | |
281 | .PP | |
282 | .Vb 1 | |
283 | \& <CODEBASE HREF="Math-Simple.tar.gz" /> | |
284 | .Ve | |
285 | .PP | |
286 | 10) Run: | |
287 | .PP | |
288 | .Vb 2 | |
289 | \& tar cvf Math-Simple.tar blib | |
290 | \& gzip --best Math-Simple.tar | |
291 | .Ve | |
292 | .PP | |
293 | 11) | |
294 | Run: | |
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 | |
301 | 12) Distribute Math\-Simple\-1.23.tar.gz with the following instructions: | |
302 | .PP | |
303 | A) 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 | |
310 | B) Run 'ppm install Math\-Simple.ppd' | |
311 | .PP | |
312 | C) Delete Math\-Simple.tar and Math\-Simple.ppd. | |
313 | .PP | |
314 | D) Test with: | |
315 | .PP | |
316 | .Vb 1 | |
317 | \& perl -MMath::Simple -le 'print add(37, 42)' | |
318 | .Ve | |
319 | .PP | |
320 | \&\-\-\- | |
321 | .PP | |
322 | That's it. The process should also work with zip instead of tar, but I | |
323 | haven't tried it. | |
324 | .PP | |
325 | The recipient of the binary must have Perl built with a matching | |
326 | architecture. Luckily, ppm will catch this. | |
327 | .PP | |
328 | For a binary dist *with* C source code, simply omit steps 2, 3, 6, and | |
329 | 7. | |
330 | .PP | |
331 | If this seems too hard, then in a future version you should be able to | |
332 | just type: | |
333 | .PP | |
334 | .Vb 1 | |
335 | \& make ppm | |
336 | .Ve |