… | |
… | |
467 | --incglob '/unicore/**.pl' |
467 | --incglob '/unicore/**.pl' |
468 | |
468 | |
469 | =item C<--add> F<file> | C<--add> "F<file> alias" |
469 | =item C<--add> F<file> | C<--add> "F<file> alias" |
470 | |
470 | |
471 | Adds the given (perl) file into the bundle (and optionally call it |
471 | Adds the given (perl) file into the bundle (and optionally call it |
472 | "alias"). The F<file> is either an absolute path or a path relative to |
472 | "alias"). The F<file> is either an absolute path or a path relative to the |
473 | the current directory. If an alias is specified, then this is the name it |
473 | current directory. If an alias is specified, then this is the name it will |
474 | will use for C<@INC> searches, otherwise the F<file> will be used as the |
474 | use for C<@INC> searches, otherwise the path F<&file> will be used as the |
475 | internal name. |
475 | internal name. |
476 | |
476 | |
477 | This switch is used to include extra files into the bundle. |
477 | This switch is used to include extra files into the bundle. |
478 | |
478 | |
479 | Example: embed the file F<httpd> in the current directory as F<httpd.pm> |
479 | Example: embed the file F<httpd> in the current directory as F<httpd.pm> |
480 | when creating the bundle. |
480 | when creating the bundle. |
481 | |
481 | |
482 | staticperl mkperl --add "httpd httpd.pm" |
482 | staticperl mkperl --add "httpd httpd.pm" |
|
|
483 | |
|
|
484 | # can be accessed via "use httpd" |
|
|
485 | |
|
|
486 | Example: add a file F<initcode> from the current directory. |
|
|
487 | |
|
|
488 | staticperl mkperl --add initcode |
|
|
489 | |
|
|
490 | # can be accessed via "do '&initcode'" |
483 | |
491 | |
484 | Example: add local files as extra modules in the bundle. |
492 | Example: add local files as extra modules in the bundle. |
485 | |
493 | |
486 | # specification file |
494 | # specification file |
487 | add file1 myfiles/file1.pm |
495 | add file1 myfiles/file1.pm |
… | |
… | |
497 | |
505 | |
498 | Just like C<--add>, except that it treats the file as binary and adds it |
506 | Just like C<--add>, except that it treats the file as binary and adds it |
499 | without any postprocessing (perl files might get stripped to reduce their |
507 | without any postprocessing (perl files might get stripped to reduce their |
500 | size). |
508 | size). |
501 | |
509 | |
502 | You should probably add a C</> prefix to avoid clashing with embedded perl |
510 | If you specify an alias you should probably add a C<&> prefix to avoid |
503 | files (whose paths do not start with C</>), and/or use a special directory |
511 | clashing with embedded perl files (whose paths never start with C<&>), |
504 | prefix, such as C</res/name>. |
512 | and/or use a special directory prefix, such as C<&res/name>. |
505 | |
513 | |
506 | You can later get a copy of these files by calling C<staticperl::find |
514 | You can later get a copy of these files by calling C<staticperl::find |
507 | "alias">. |
515 | "alias">. |
508 | |
516 | |
509 | An alternative way to embed binary files is to convert them to perl and |
517 | An alternative way to embed binary files is to convert them to perl and |
… | |
… | |
664 | The difference to the (mutually exclusive) C<--perl> option is that the |
672 | The difference to the (mutually exclusive) C<--perl> option is that the |
665 | binary created by this option will not try to act as a perl interpreter - |
673 | binary created by this option will not try to act as a perl interpreter - |
666 | instead it will simply initialise the perl interpreter, clean it up and |
674 | instead it will simply initialise the perl interpreter, clean it up and |
667 | exit. |
675 | exit. |
668 | |
676 | |
669 | This means that, by default, it will do nothing but burna few CPU cycles |
677 | This means that, by default, it will do nothing but burn a few CPU cycles |
670 | - for it to do something useful you I<must> add some boot code, e.g. with |
678 | - for it to do something useful you I<must> add some boot code, e.g. with |
671 | the C<--boot> option. |
679 | the C<--boot> option. |
672 | |
680 | |
673 | Example: create a standalone perl binary called F<./myexe> that will |
681 | Example: create a standalone perl binary called F<./myexe> that will |
674 | execute F<appfile> when it is started. |
682 | execute F<appfile> when it is started. |