ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/staticperl.pod
(Generate patch)

Comparing App-Staticperl/staticperl.pod (file contents):
Revision 1.9 by root, Tue Dec 7 09:08:06 2010 UTC vs.
Revision 1.13 by root, Tue Dec 7 19:55:56 2010 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines