… | |
… | |
278 | -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI::http |
278 | -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI::http |
279 | |
279 | |
280 | # run it |
280 | # run it |
281 | ./app |
281 | ./app |
282 | |
282 | |
|
|
283 | Here are the three phase 2 commands: |
|
|
284 | |
|
|
285 | =over 4 |
|
|
286 | |
|
|
287 | =item F<staticperl mkbundle> args... |
|
|
288 | |
|
|
289 | The "default" bundle command - it interprets the given bundle options and |
|
|
290 | writes out F<bundle.h>, F<bundle.c>, F<bundle.ccopts> and F<bundle.ldopts> |
|
|
291 | files, useful for embedding. |
|
|
292 | |
|
|
293 | =item F<staticperl mkperl> args... |
|
|
294 | |
|
|
295 | Creates a bundle just like F<staticperl mkbundle> (in fact, it's the same |
|
|
296 | as invoking F<staticperl mkbundle --perl> args...), but then compiles and |
|
|
297 | links a new perl interpreter that embeds the created bundle, then deletes |
|
|
298 | all intermediate files. |
|
|
299 | |
|
|
300 | =item F<staticperl mkapp> filename args... |
|
|
301 | |
|
|
302 | Does the same as F<staticperl mkbundle> (in fact, it's the same as |
|
|
303 | invoking F<staticperl mkbundle --app> filename args...), but then compiles |
|
|
304 | and links a new standalone application that simply initialises the perl |
|
|
305 | interpreter. |
|
|
306 | |
|
|
307 | The difference to F<staticperl mkperl> is that the standalone application |
|
|
308 | does not act like a perl interpreter would - in fact, by default it would |
|
|
309 | just do nothing and exit immediately, so you should specify some code to |
|
|
310 | be executed via the F<--boot> option. |
|
|
311 | |
|
|
312 | =back |
|
|
313 | |
283 | =head3 OPTION PROCESSING |
314 | =head3 OPTION PROCESSING |
284 | |
315 | |
285 | All options can be given as arguments on the command line (typically |
316 | All options can be given as arguments on the command line (typically |
286 | using long (e.g. C<--verbose>) or short option (e.g. C<-v>) style). Since |
317 | using long (e.g. C<--verbose>) or short option (e.g. C<-v>) style). Since |
287 | specifying a lot of modules can make the command line very cumbersome, |
318 | specifying a lot of modules can make the command line very cumbersome, you |
288 | you can put all long options into a "bundle specification file" (with or |
319 | can put all long options into a "bundle specification file" (one option |
289 | without C<--> prefix) and specify this bundle file instead. |
320 | per line, with or without C<--> prefix) and specify this bundle file |
|
|
321 | instead. |
290 | |
322 | |
291 | For example, the command given earlier could also look like this: |
323 | For example, the command given earlier could also look like this: |
292 | |
324 | |
293 | staticperl mkperl httpd.bundle |
325 | staticperl mkperl httpd.bundle |
294 | |
326 | |
… | |
… | |
299 | use AnyEvent::HTTPD |
331 | use AnyEvent::HTTPD |
300 | use URI::http |
332 | use URI::http |
301 | add eg/httpd httpd.pm |
333 | add eg/httpd httpd.pm |
302 | |
334 | |
303 | All options that specify modules or files to be added are processed in the |
335 | All options that specify modules or files to be added are processed in the |
304 | order given on the command line (that affects the C<--use> and C<--eval> |
336 | order given on the command line. |
305 | options at the moment). |
|
|
306 | |
337 | |
307 | =head3 PACKAGE SELECTION WORKFLOW |
338 | =head3 PACKAGE SELECTION WORKFLOW |
308 | |
339 | |
309 | F<staticperl mkbundle> has a number of options to control package |
340 | F<staticperl mkbundle> has a number of options to control package |
310 | selection. This section describes how they interact with each other. Also, |
341 | selection. This section describes how they interact with each other. Also, |