… | |
… | |
184 | command by specifying all the directories with modules in them that you |
184 | command by specifying all the directories with modules in them that you |
185 | want to have built. |
185 | want to have built. |
186 | |
186 | |
187 | =item F<staticperl clean> |
187 | =item F<staticperl clean> |
188 | |
188 | |
189 | Runs F<make distclean> in the perl source directory (and potentially |
189 | Deletes the perl source directory (and potentially cleans up other |
190 | cleans up other intermediate files). This can be used to clean up |
190 | intermediate files). This can be used to clean up files only needed for |
191 | intermediate files without removing the installed perl interpreter. |
191 | building perl, without removing the installed perl interpreter, or to |
|
|
192 | force a re-build from scratch. |
|
|
193 | |
|
|
194 | At the moment, it doesn't delete downloaded tarballs. |
192 | |
195 | |
193 | =item F<staticperl distclean> |
196 | =item F<staticperl distclean> |
194 | |
197 | |
195 | This wipes your complete F<~/.staticperl> directory. Be careful with this, |
198 | This wipes your complete F<~/.staticperl> directory. Be careful with this, |
196 | it nukes your perl download, perl sources, perl distribution and any |
199 | it nukes your perl download, perl sources, perl distribution and any |
… | |
… | |
383 | # specification file |
386 | # specification file |
384 | add file1 myfiles/file1 |
387 | add file1 myfiles/file1 |
385 | add file2 myfiles/file2 |
388 | add file2 myfiles/file2 |
386 | add file3 myfiles/file3 |
389 | add file3 myfiles/file3 |
387 | |
390 | |
|
|
391 | =item --binadd "file" | --add "file alias" |
|
|
392 | |
|
|
393 | Just like C<--add>, except that it treats the file as binary and adds it |
|
|
394 | without any processing. |
|
|
395 | |
|
|
396 | You should probably add a C</> prefix to avoid clashing with embedded |
|
|
397 | perl files (whose paths do not start with C</>), and/or use a special |
|
|
398 | directory, such as C</res/name>. |
|
|
399 | |
|
|
400 | You can later get a copy of these files by calling C<staticperl::find |
|
|
401 | "alias">. |
|
|
402 | |
388 | =item --static |
403 | =item --static |
389 | |
404 | |
390 | When C<--perl> is also given, link statically instead of dynamically. The |
405 | When C<--perl> is also given, link statically instead of dynamically. The |
391 | default is to link the new perl interpreter fully dynamic (that means all |
406 | default is to link the new perl interpreter fully dynamic (that means all |
392 | perl modules are linked statically, but all external libraries are still |
407 | perl modules are linked statically, but all external libraries are still |
… | |
… | |
429 | =item C<EMAIL> |
444 | =item C<EMAIL> |
430 | |
445 | |
431 | The e-mail address of the person who built this binary. Has no good |
446 | The e-mail address of the person who built this binary. Has no good |
432 | default, so should be specified by you. |
447 | default, so should be specified by you. |
433 | |
448 | |
|
|
449 | =item C<CPAN> |
|
|
450 | |
|
|
451 | The URL of the CPAN mirror to use (e.g. L<http://mirror.netcologne.de/cpan/>). |
|
|
452 | |
|
|
453 | =item C<EXTRA_MODULES> |
|
|
454 | |
|
|
455 | Additional modules installed during F<staticperl install>. Here you can |
|
|
456 | set which modules you want have to installed from CPAN. |
|
|
457 | |
|
|
458 | Example: I really really need EV, AnyEvent, Coro and AnyEvent::AIO. |
|
|
459 | |
|
|
460 | EXTRA_MODULES="EV AnyEvent Coro AnyEvent::AIO" |
|
|
461 | |
|
|
462 | Note that you can also use a C<postinstall> hook to achieve this, and |
|
|
463 | more. |
|
|
464 | |
434 | =back |
465 | =back |
435 | |
466 | |
436 | =head4 Variables you might I<want> to override |
467 | =head4 Variables you might I<want> to override |
437 | |
468 | |
438 | =over 4 |
469 | =over 4 |
439 | |
470 | |
|
|
471 | =item C<STATICPERL> |
|
|
472 | |
|
|
473 | The directory where staticperl stores all its files |
|
|
474 | (default: F<~/.staticperl>). |
|
|
475 | |
|
|
476 | =item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ... |
|
|
477 | |
|
|
478 | Usually set to C<1> to make modules "less inquisitive" during their |
|
|
479 | installation, you can set any environment variable you want - some modules |
|
|
480 | (such as L<Coro> or L<EV>) use environment variables for further tweaking. |
|
|
481 | |
440 | =item C<PERLVER> |
482 | =item C<PERL_VERSION> |
441 | |
483 | |
442 | The perl version to install - default is currently C<5.12.2>, but C<5.8.9> |
484 | The perl version to install - default is currently C<5.12.2>, but C<5.8.9> |
443 | is also a good choice (5.8.9 is much smaller than 5.12.2, while 5.10.1 is |
485 | is also a good choice (5.8.9 is much smaller than 5.12.2, while 5.10.1 is |
444 | about as big as 5.12.2). |
486 | about as big as 5.12.2). |
445 | |
487 | |
446 | =item C<CPAN> |
|
|
447 | |
|
|
448 | The URL of the CPAN mirror to use (e.g. L<http://mirror.netcologne.de/cpan/>). |
|
|
449 | |
|
|
450 | =item C<EXTRA_MODULES> |
|
|
451 | |
|
|
452 | Additional modules installed during F<staticperl install>. Here you can |
|
|
453 | set which modules you want have to installed from CPAN. |
|
|
454 | |
|
|
455 | Example: I really really need EV, AnyEvent, Coro and IO::AIO. |
|
|
456 | |
|
|
457 | EXTRA_MODULES="EV AnyEvent Coro IO::AIO" |
|
|
458 | |
|
|
459 | Note that you can also use a C<postinstall> hook to achieve this, and |
|
|
460 | more. |
|
|
461 | |
|
|
462 | =item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ... |
|
|
463 | |
|
|
464 | Usually set to C<1> to make modules "less inquisitive" during their |
|
|
465 | installation, you can set any environment variable you want - some modules |
|
|
466 | (such as L<Coro> or L<EV>) use environment variables for further tweaking. |
|
|
467 | |
|
|
468 | =item C<STATICPERL> |
|
|
469 | |
|
|
470 | The directory where staticperl stores all its files |
|
|
471 | (default: F<~/.staticperl>). |
|
|
472 | |
|
|
473 | =item C<PREFIX> |
488 | =item C<PERL_PREFIX> |
474 | |
489 | |
475 | The prefix where perl gets installed (default: F<$STATICPERL/perl>), |
490 | The prefix where perl gets installed (default: F<$STATICPERL/perl>), |
476 | i.e. where the F<bin> and F<lib> subdirectories will end up. |
491 | i.e. where the F<bin> and F<lib> subdirectories will end up. |
|
|
492 | |
|
|
493 | =item C<PERL_CONFIGURE> |
|
|
494 | |
|
|
495 | Additional Configure options - these are simply passed to the perl |
|
|
496 | Configure script. For example, if you wanted to enable dynamic loading, |
|
|
497 | you could pass C<-Dusedl>. To enable ithreads (Why would you want that |
|
|
498 | insanity? Don't! Use L<forks> instead!) you would pass C<-Duseithreads> |
|
|
499 | and so on. |
|
|
500 | |
|
|
501 | More commonly, you would either activate 64 bit integer support |
|
|
502 | (C<-Duse64bitint>), or disable large files support (-Uuselargefiles), to |
|
|
503 | reduce filesize further. |
477 | |
504 | |
478 | =item C<PERL_CPPFLAGS>, C<PERL_OPTIMIZE>, C<PERL_LDFLAGS>, C<PERL_LIBS> |
505 | =item C<PERL_CPPFLAGS>, C<PERL_OPTIMIZE>, C<PERL_LDFLAGS>, C<PERL_LIBS> |
479 | |
506 | |
480 | These flags are passed to perl's F<Configure> script, and are generally |
507 | These flags are passed to perl's F<Configure> script, and are generally |
481 | optimised for small size (at the cost of performance). Since they also |
508 | optimised for small size (at the cost of performance). Since they also |
… | |
… | |
518 | instcpan Anyevent::AIO AnyEvent::HTTPD |
545 | instcpan Anyevent::AIO AnyEvent::HTTPD |
519 | } |
546 | } |
520 | |
547 | |
521 | =over 4 |
548 | =over 4 |
522 | |
549 | |
|
|
550 | =item preconfigure |
|
|
551 | |
|
|
552 | Called just before running F<./Configur> in the perl source |
|
|
553 | directory. Current working directory is the perl source directory. |
|
|
554 | |
|
|
555 | This can be used to set any C<PERL_xxx> variables, which might be costly |
|
|
556 | to compute. |
|
|
557 | |
523 | =item postconfigure |
558 | =item postconfigure |
524 | |
559 | |
525 | Called after configuring, but before building perl. Current working |
560 | Called after configuring, but before building perl. Current working |
526 | directory is the perl source directory. |
561 | directory is the perl source directory. |
527 | |
562 | |
528 | Could be used to tailor/patch config.sh (followed by F<./Configure -S>) or |
563 | Could be used to tailor/patch config.sh (followed by F<sh Configure -S>) |
529 | do any other modifications. |
564 | or do any other modifications. |
530 | |
565 | |
531 | =item postbuild |
566 | =item postbuild |
532 | |
567 | |
533 | Called after building, but before installing perl. Current working |
568 | Called after building, but before installing perl. Current working |
534 | directory is the perl source directory. |
569 | directory is the perl source directory. |
… | |
… | |
654 | |
689 | |
655 | =back |
690 | =back |
656 | |
691 | |
657 | =head1 FULLY STATIC BINARIES - BUILDROOT |
692 | =head1 FULLY STATIC BINARIES - BUILDROOT |
658 | |
693 | |
659 | To make truly static (linux-) libraries, you might want to have a look at |
694 | To make truly static (Linux-) libraries, you might want to have a look at |
660 | buildroot (L<http://buildroot.uclibc.org/>). |
695 | buildroot (L<http://buildroot.uclibc.org/>). |
661 | |
696 | |
662 | Buildroot is primarily meant to set up a cross-compile environment (which |
697 | Buildroot is primarily meant to set up a cross-compile environment (which |
663 | is not so useful as perl doesn't quite like cross compiles), but it can also compile |
698 | is not so useful as perl doesn't quite like cross compiles), but it can also compile |
664 | a chroot environment where you can use F<staticperl>. |
699 | a chroot environment where you can use F<staticperl>. |
… | |
… | |
678 | uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201 |
713 | uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201 |
679 | snapshot) and enable NPTL, otherwise Coro needs to be configured with the |
714 | snapshot) and enable NPTL, otherwise Coro needs to be configured with the |
680 | ultra-slow pthreads backend to work around linuxthreads bugs (it also uses |
715 | ultra-slow pthreads backend to work around linuxthreads bugs (it also uses |
681 | twice the address space needed for stacks). |
716 | twice the address space needed for stacks). |
682 | |
717 | |
|
|
718 | If you use C<linuxthreads.old>, then you should also be aware that |
|
|
719 | uClibc shares C<errno> between all threads when statically linking. See |
|
|
720 | L<http://lists.uclibc.org/pipermail/uclibc/2010-June/044157.html> for a |
|
|
721 | workaround (And L<https://bugs.uclibc.org/2089> for discussion). |
|
|
722 | |
683 | C<ccache> support is also recommended, especially if you want to |
723 | C<ccache> support is also recommended, especially if you want |
684 | play around with buildroot options. Enabling the C<miniperl> package |
724 | to play around with buildroot options. Enabling the C<miniperl> |
685 | will probably enable all options required for a successful perl |
725 | package will probably enable all options required for a successful |
686 | build. F<staticperl> itself additionally needs either C<wget> or C<curl>. |
726 | perl build. F<staticperl> itself additionally needs either C<wget> |
|
|
727 | (recommended, for CPAN) or C<curl>. |
687 | |
728 | |
688 | As for shells, busybox should provide all that is needed, but the default |
729 | As for shells, busybox should provide all that is needed, but the default |
689 | busybox configuration doesn't include F<comm> which is needed by perl - |
730 | busybox configuration doesn't include F<comm> which is needed by perl - |
690 | either make a custom busybox config, or compile coreutils. |
731 | either make a custom busybox config, or compile coreutils. |
691 | |
732 | |