1 | =head1 NAME |
1 | =head1 NAME |
2 | |
2 | |
3 | staticperl - perl, libc, 50 modules all in one 500kb file |
3 | staticperl - perl, libc, 100 modules, all in one 500kb file |
4 | |
4 | |
5 | =head1 SYNOPSIS |
5 | =head1 SYNOPSIS |
6 | |
6 | |
7 | staticperl help # print the embedded documentation |
7 | staticperl help # print the embedded documentation |
8 | staticperl fetch # fetch and unpack perl sources |
8 | staticperl fetch # fetch and unpack perl sources |
… | |
… | |
32 | fully self-contained - no separate shared objects, no autoload fragments, |
32 | fully self-contained - no separate shared objects, no autoload fragments, |
33 | no .pm or .pl files are needed. And when linking statically, you can |
33 | no .pm or .pl files are needed. And when linking statically, you can |
34 | create (or embed) a single file that contains perl interpreter, libc, all |
34 | create (or embed) a single file that contains perl interpreter, libc, all |
35 | the modules you need and all the libraries you need. |
35 | the modules you need and all the libraries you need. |
36 | |
36 | |
37 | With F<uClibc> and F<upx> on x86, you can create a single 500kb binary that |
37 | With F<uClibc> and F<upx> on x86, you can create a single 500kb binary |
38 | contains perl and 50 modules such as AnyEvent, EV, IO::AIO, Coro and so |
38 | that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO, |
39 | on. Or any other choice of modules. |
39 | Coro and so on. Or any other choice of modules. |
40 | |
40 | |
41 | The created files do not need write access to the file system (like PAR |
41 | The created files do not need write access to the file system (like PAR |
42 | does). In fact, since this script is in many ways similar to PAR::Packer, |
42 | does). In fact, since this script is in many ways similar to PAR::Packer, |
43 | here are the differences: |
43 | here are the differences: |
44 | |
44 | |
… | |
… | |
430 | The e-mail address of the person who built this binary. Has no good |
430 | The e-mail address of the person who built this binary. Has no good |
431 | default, so should be specified by you. |
431 | default, so should be specified by you. |
432 | |
432 | |
433 | =back |
433 | =back |
434 | |
434 | |
435 | =head4 Variables you I<might want> to override |
435 | =head4 Variables you might I<want> to override |
436 | |
436 | |
437 | =over 4 |
437 | =over 4 |
438 | |
438 | |
439 | =item C<PERLVER> |
439 | =item C<PERLVER> |
440 | |
440 | |
… | |
… | |
443 | about as big as 5.12.2). |
443 | about as big as 5.12.2). |
444 | |
444 | |
445 | =item C<CPAN> |
445 | =item C<CPAN> |
446 | |
446 | |
447 | The URL of the CPAN mirror to use (e.g. L<http://mirror.netcologne.de/cpan/>). |
447 | The URL of the CPAN mirror to use (e.g. L<http://mirror.netcologne.de/cpan/>). |
|
|
448 | |
|
|
449 | =item C<EXTRA_MODULES> |
|
|
450 | |
|
|
451 | Additional modules installed during F<staticperl install>. Here you can |
|
|
452 | set which modules you want have to installed from CPAN. |
|
|
453 | |
|
|
454 | Example: I really really need EV, AnyEvent, Coro and IO::AIO. |
|
|
455 | |
|
|
456 | EXTRA_MODULES="EV AnyEvent Coro IO::AIO" |
|
|
457 | |
|
|
458 | Note that you can also use a C<postinstall> hook to achieve this, and |
|
|
459 | more. |
|
|
460 | |
|
|
461 | =item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ... |
|
|
462 | |
|
|
463 | Usually set to C<1> to make modules "less inquisitive" during their |
|
|
464 | installation, you can set any environment variable you want - some modules |
|
|
465 | (such as L<Coro> or L<EV>) use environment variables for further tweaking. |
|
|
466 | |
|
|
467 | =item C<STATICPERL> |
|
|
468 | |
|
|
469 | The directory where staticperl stores all its files |
|
|
470 | (default: F<~/.staticperl>). |
|
|
471 | |
|
|
472 | =item C<PREFIX> |
|
|
473 | |
|
|
474 | The prefix where perl gets installed (default: F<$STATICPERL/perl>), |
|
|
475 | i.e. where the F<bin> and F<lib> subdirectories will end up. |
448 | |
476 | |
449 | =item C<PERL_CPPFLAGS>, C<PERL_OPTIMIZE>, C<PERL_LDFLAGS>, C<PERL_LIBS> |
477 | =item C<PERL_CPPFLAGS>, C<PERL_OPTIMIZE>, C<PERL_LDFLAGS>, C<PERL_LIBS> |
450 | |
478 | |
451 | These flags are passed to perl's F<Configure> script, and are generally |
479 | These flags are passed to perl's F<Configure> script, and are generally |
452 | optimised for small size (at the cost of performance). Since they also |
480 | optimised for small size (at the cost of performance). Since they also |
453 | contain subtle workarounds around various build issues, changing these |
481 | contain subtle workarounds around various build issues, changing these |
454 | usually requires understanding their default values - best look at the top |
482 | usually requires understanding their default values - best look at the top |
455 | of the F<staticperl> script for more info on these. |
483 | of the F<staticperl> script for more info on these. |
456 | |
484 | |
457 | =item C<STATICPERL> |
|
|
458 | |
|
|
459 | The directory where staticperl stores all its files |
|
|
460 | (default: F<~/.staticperl>). |
|
|
461 | |
|
|
462 | =item C<PREFIX> |
|
|
463 | |
|
|
464 | The prefix where perl gets installed (default: F<$STATICPERL/perl>), |
|
|
465 | i.e. where the F<bin> and F<lib> subdirectories will end up. |
|
|
466 | |
|
|
467 | =item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, others |
|
|
468 | |
|
|
469 | Usually set to C<1> to make modules "less inquisitive" during their |
|
|
470 | installation, you can set any environment variable you want - some modules |
|
|
471 | (such as L<Coro> or L<EV>) use environment variables for further tweaking. |
|
|
472 | |
|
|
473 | =item C<EXTRA_MODULES> |
|
|
474 | |
|
|
475 | Additional modules installed during F<staticperl install>. Here you can |
|
|
476 | set which modules you want have to installed from CPAN. |
|
|
477 | |
|
|
478 | Example: I really really need EV, AnyEvent, Coro and IO::AIO. |
|
|
479 | |
|
|
480 | EXTRA_MODULES="EV AnyEvent Coro IO::AIO" |
|
|
481 | |
|
|
482 | Note that you can also use a C<postinstall> hook to achieve this, and |
|
|
483 | more. |
|
|
484 | |
|
|
485 | =back |
485 | =back |
486 | |
486 | |
487 | =head4 Variables you I<probably do not want> to override |
487 | =head4 Variables you probably I<do not want> to override |
488 | |
488 | |
489 | =over 4 |
489 | =over 4 |
490 | |
490 | |
491 | =item C<MKBUNDLE> |
491 | =item C<MKBUNDLE> |
492 | |
492 | |