… | |
… | |
14 | staticperl cpan # invoke CPAN shell |
14 | staticperl cpan # invoke CPAN shell |
15 | staticperl instmod path... # install unpacked modules |
15 | staticperl instmod path... # install unpacked modules |
16 | staticperl instcpan modulename... # install modules from CPAN |
16 | staticperl instcpan modulename... # install modules from CPAN |
17 | staticperl mkbundle <bundle-args...> # see documentation |
17 | staticperl mkbundle <bundle-args...> # see documentation |
18 | staticperl mkperl <bundle-args...> # see documentation |
18 | staticperl mkperl <bundle-args...> # see documentation |
|
|
19 | staticperl mkapp appname <bundle-args...> # see documentation |
19 | |
20 | |
20 | Typical Examples: |
21 | Typical Examples: |
21 | |
22 | |
22 | staticperl install # fetch, configure, build and install perl |
23 | staticperl install # fetch, configure, build and install perl |
23 | staticperl cpan # run interactive cpan shell |
24 | staticperl cpan # run interactive cpan shell |
24 | staticperl mkperl -M '"Config_heavy.pl"' # build a perl that supports -V |
25 | staticperl mkperl -M '"Config_heavy.pl"' # build a perl that supports -V |
25 | staticperl mkperl -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI -MURI::http |
26 | staticperl mkperl -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI -MURI::http |
26 | # build a perl with the above modules linked in |
27 | # build a perl with the above modules linked in |
|
|
28 | staticperl mkapp myapp --boot mainprog mymodules |
|
|
29 | # build a binary "myapp" from mainprog and mymodules |
27 | |
30 | |
28 | =head1 DESCRIPTION |
31 | =head1 DESCRIPTION |
29 | |
32 | |
30 | This script helps you creating single-file perl interpreters, or embedding |
33 | This script helps you creating single-file perl interpreters, or embedding |
31 | a perl interpreter in your applications. Single-file means that it is |
34 | a perl interpreter in your applications. Single-file means that it is |
… | |
… | |
244 | (required by L<AnyEvent::HTTPD>) implements various URI schemes as extra |
247 | (required by L<AnyEvent::HTTPD>) implements various URI schemes as extra |
245 | modules - since L<AnyEvent::HTTPD> only needs C<http> URIs, we only need |
248 | modules - since L<AnyEvent::HTTPD> only needs C<http> URIs, we only need |
246 | to include that module. I found out about these dependencies by carefully |
249 | to include that module. I found out about these dependencies by carefully |
247 | watching any error messages about missing modules... |
250 | watching any error messages about missing modules... |
248 | |
251 | |
|
|
252 | Instead of building a new perl binary, you can also build a standalone |
|
|
253 | application: |
|
|
254 | |
|
|
255 | # build the app |
|
|
256 | staticperl mkapp app --boot eg/httpd \ |
|
|
257 | -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI::http |
|
|
258 | |
|
|
259 | # run it |
|
|
260 | ./app |
|
|
261 | |
249 | =head3 OPTION PROCESSING |
262 | =head3 OPTION PROCESSING |
250 | |
263 | |
251 | All options can be given as arguments on the command line (typically |
264 | All options can be given as arguments on the command line (typically |
252 | using long (e.g. C<--verbose>) or short option (e.g. C<-v>) style). Since |
265 | using long (e.g. C<--verbose>) or short option (e.g. C<-v>) style). Since |
253 | specifying a lot of modules can make the command line very cumbersome, |
266 | specifying a lot of modules can make the command line very cumbersome, |
… | |
… | |
312 | C<mkperl> command (instead of C<mkbundle>): |
325 | C<mkperl> command (instead of C<mkbundle>): |
313 | |
326 | |
314 | # build a new ./perl with only common::sense in it - very small :) |
327 | # build a new ./perl with only common::sense in it - very small :) |
315 | staticperl mkperl -Mcommon::sense |
328 | staticperl mkperl -Mcommon::sense |
316 | |
329 | |
|
|
330 | =item --app name |
|
|
331 | |
|
|
332 | After writing out the bundle files, try to link a new standalone |
|
|
333 | program. It will be called C<name>, and the bundle files get removed after |
|
|
334 | linking it. |
|
|
335 | |
|
|
336 | The difference to the (mutually exclusive) C<--perl> option is that the |
|
|
337 | binary created by this option will not try to act as a perl interpreter - |
|
|
338 | instead it will simply initialise the perl interpreter, clean it up and |
|
|
339 | exit. |
|
|
340 | |
|
|
341 | This switch is automatically used when F<staticperl> is invoked with the |
|
|
342 | C<mkapp> command (instead of C<mkbundle>): |
|
|
343 | |
|
|
344 | To let it do something useful you I<must> add some boot code, e.g. with |
|
|
345 | the C<--boot> option. |
|
|
346 | |
|
|
347 | Example: create a standalone perl binary that will execute F<appfile> when |
|
|
348 | it is started. |
|
|
349 | |
|
|
350 | staticperl mkbundle --app myexe --boot appfile |
|
|
351 | |
317 | =item --use module | -Mmodule |
352 | =item --use module | -Mmodule |
318 | |
353 | |
319 | Include the named module and all direct dependencies. This is done by |
354 | Include the named module and all direct dependencies. This is done by |
320 | C<require>'ing the module in a subprocess and tracing which other modules |
355 | C<require>'ing the module in a subprocess and tracing which other modules |
321 | and files it actually loads. If the module uses L<AutoLoader>, then all |
356 | and files it actually loads. If the module uses L<AutoLoader>, then all |