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.16 by root, Wed Dec 8 23:03:21 2010 UTC vs.
Revision 1.17 by root, Thu Dec 9 08:55:52 2010 UTC

67=item * The generated executables don't need a writable filesystem. 67=item * The generated executables don't need a writable filesystem.
68 68
69F<staticperl> loads all required files directly from memory. There is no 69F<staticperl> loads all required files directly from memory. There is no
70need to unpack files into a temporary directory. 70need to unpack files into a temporary directory.
71 71
72=item * More control over included files. 72=item * More control over included files, more burden.
73 73
74PAR tries to be maintenance and hassle-free - it tries to include more 74PAR tries to be maintenance and hassle-free - it tries to include more
75files than necessary to make sure everything works out of the box. The 75files than necessary to make sure everything works out of the box. It
76extra files (such as the unicode database) can take substantial amounts of 76mostly succeeds at this, but he extra files (such as the unicode database)
77memory and file size. 77can take substantial amounts of memory and file size.
78 78
79With F<staticperl>, the burden is mostly with the developer - only direct 79With F<staticperl>, the burden is mostly with the developer - only direct
80compile-time dependencies and L<AutoLoader> are handled automatically. 80compile-time dependencies and L<AutoLoader> are handled automatically.
81This means the modules to include often need to be tweaked manually. 81This means the modules to include often need to be tweaked manually.
82
83All this does not preclude more permissive modes to be implemented in
84the future, but right now, you have to resolve state hidden dependencies
85manually.
82 86
83=item * PAR works out of the box, F<staticperl> does not. 87=item * PAR works out of the box, F<staticperl> does not.
84 88
85Maintaining your own custom perl build can be a pain in the ass, and while 89Maintaining your own custom perl build can be a pain in the ass, and while
86F<staticperl> tries to make this easy, it still requires a custom perl 90F<staticperl> tries to make this easy, it still requires a custom perl
783After you have compiled and set up your buildroot target, you can copy 787After you have compiled and set up your buildroot target, you can copy
784F<staticperl> from the C<App::Staticperl> distribution or from your 788F<staticperl> from the C<App::Staticperl> distribution or from your
785perl f<bin> directory (if you installed it) into the F<output/target> 789perl f<bin> directory (if you installed it) into the F<output/target>
786filesystem, chroot inside and run it. 790filesystem, chroot inside and run it.
787 791
792=head1 RECIPES / SPECIFIC MODULES
793
794This section contains some common(?) recipes and information about
795problems with some common modules or perl constructs that require extra
796files to be included.
797
798=head2 MODULES
799
800=over 4
801
802=item utf8
803
804Some functionality in the utf8 module, such as swash handling (used
805for unicode character ranges in regexes) is implemented in the
806C<"utf8_heavy.pl"> library.
807
808Many Unicode properties in turn are defined in separate modules,
809such as C<"unicore/Heavy.pl"> and more specific data tables such as
810C<"unicore/To/Digit.pl"> or C<"unicore/lib/Perl/Word.pl">. These
811tables are big (7MB uncompressed), so including them on demand by your
812applciation only might pay off.
813
814=item Carp
815
816Carp had (in older versions of perl) a dependency on L<Carp::Heavy>. As of
817perl 5.12.2 (maybe earlier), this dependency no longer exists.
818
819=item Config
820
821The F<perl -V> switch (as well as many modules) needs L<Config>, which in
822turn might need L<"Config_heavy.pl">. Including the latter gives you
823both.
824
825=item AnyEvent
826
827AnyEvent needs a backend implementation that it will load in a delayed
828fashion. The L<AnyEvent::Impl::Perl> backend is the default choice
829for AnyEvent if it can't find anything else, and is usually a safe
830fallback. If you plan to use e.g. L<EV> (L<POE>...), then you need to
831include the L<AnyEvent::Impl::EV> (L<AnyEvent::Impl::POE>...) backend as
832well.
833
834If you want to handle IRIs or IDNs (L<AnyEvent::Util> punycode and idn
835functions), you also need to include C<"AnyEvent/Util/idna.pl"> and
836C<"AnyEvent/Util/uts46data.pl">.
837
838=item URI
839
840URI implements schemes as separate modules - the generic URL scheme is
841implemented in L<URI::_generic>, HTTP is implemented in L<URI::http>. If
842you need to use any of these schemes, you should include these manually.
843
844=back
845
846=head2 RECIPES
847
848=over 4
849
850=item Getting rid of netdb function
851
852The perl core has lots of netdb functions (C<getnetbyname>, C<getgrent>
853and so on) that few applications use. You can avoid compiling them in by
854putting the following fragment into a C<preconfigure> hook:
855
856 preconfigure() {
857 for sym in \
858 d_getgrnam_r d_endgrent d_endgrent_r d_endhent \
859 d_endhostent_r d_endnent d_endnetent_r d_endpent \
860 d_endprotoent_r d_endpwent d_endpwent_r d_endsent \
861 d_endservent_r d_getgrent d_getgrent_r d_getgrgid_r \
862 d_getgrnam_r d_gethbyaddr d_gethent d_getsbyport \
863 d_gethostbyaddr_r d_gethostbyname_r d_gethostent_r \
864 d_getlogin_r d_getnbyaddr d_getnbyname d_getnent \
865 d_getnetbyaddr_r d_getnetbyname_r d_getnetent_r \
866 d_getpent d_getpbyname d_getpbynumber d_getprotobyname_r \
867 d_getprotobynumber_r d_getprotoent_r d_getpwent \
868 d_getpwent_r d_getpwnam_r d_getpwuid_r d_getsent \
869 d_getservbyname_r d_getservbyport_r d_getservent_r \
870 d_getspnam_r d_getsbyname
871 # d_gethbyname
872 do
873 PERL_CONFIGURE="$PERL_CONFIGURE -U$sym"
874 done
875 }
876
877This mostly gains space when linking staticaly, as the functions will
878liekly not be linked in. The gain for dynamically-linked binaries is
879smaller.
880
881Also, this leaves C<gethostbyname> in - not only is it actually used
882often, the L<Socket> module also exposes it, so leaving it out usually
883gains little. Why Socket exposes a C function that is in the core already
884is anybody's guess.
885
886=back
887
788=head1 AUTHOR 888=head1 AUTHOR
789 889
790 Marc Lehmann <schmorp@schmorp.de> 890 Marc Lehmann <schmorp@schmorp.de>
791 http://software.schmorp.de/pkg/staticperl.html 891 http://software.schmorp.de/pkg/staticperl.html

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines