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.28 by root, Tue Dec 21 19:44:43 2010 UTC vs.
Revision 1.31 by root, Thu Dec 23 14:16:25 2010 UTC

557that are added automatically. Only one (F<.packlist> files) is currently 557that are added automatically. Only one (F<.packlist> files) is currently
558optional and can be influenced, the others are always included: 558optional and can be influenced, the others are always included:
559 559
560=over 4 560=over 4
561 561
562=item C<--usepacklist> 562=item C<--usepacklists>
563 563
564Read F<.packlist> files for each distribution that happens to match a 564Read F<.packlist> files for each distribution that happens to match a
565module name you specified. Sounds weird, and it is, so expect semantics to 565module name you specified. Sounds weird, and it is, so expect semantics to
566change somehow in the future. 566change somehow in the future.
567 567
732=item Patterns not starting with F</> will be anchored at the end of the path. 732=item Patterns not starting with F</> will be anchored at the end of the path.
733 733
734That is, F<idna.pl> will match any file called F<idna.pl> anywhere in the 734That is, F<idna.pl> will match any file called F<idna.pl> anywhere in the
735hierarchy, but not any directories of the same name. 735hierarchy, but not any directories of the same name.
736 736
737=item A F<*> matches any single component. 737=item A F<*> matches anything within a single path component.
738 738
739That is, F</unicore/*.pl> would match all F<.pl> files directly inside 739That is, F</unicore/*.pl> would match all F<.pl> files directly inside
740C</unicore>, not any deeper level F<.pl> files. Or in other words, F<*> 740C</unicore>, not any deeper level F<.pl> files. Or in other words, F<*>
741will not match slashes. 741will not match slashes.
742 742
1033 1033
1034Returns the list of all paths embedded in this binary. 1034Returns the list of all paths embedded in this binary.
1035 1035
1036=back 1036=back
1037 1037
1038=head1 FULLY STATIC BINARIES - BUILDROOT 1038=head1 FULLY STATIC BINARIES - UCLIBC AND BUILDROOT
1039 1039
1040To make truly static (Linux-) libraries, you might want to have a look at 1040To make truly static (Linux-) libraries, you might want to have a look at
1041buildroot (L<http://buildroot.uclibc.org/>). 1041buildroot (L<http://buildroot.uclibc.org/>).
1042 1042
1043Buildroot is primarily meant to set up a cross-compile environment (which 1043Buildroot is primarily meant to set up a cross-compile environment (which
1115handling for those files), so including them on demand by your application 1115handling for those files), so including them on demand by your application
1116only might pay off. 1116only might pay off.
1117 1117
1118To simply include the whole unicode database, use: 1118To simply include the whole unicode database, use:
1119 1119
1120 --incglob '/unicore/*.pl' 1120 --incglob '/unicore/**.pl'
1121 1121
1122=item AnyEvent 1122=item AnyEvent
1123 1123
1124AnyEvent needs a backend implementation that it will load in a delayed 1124AnyEvent needs a backend implementation that it will load in a delayed
1125fashion. The L<AnyEvent::Impl::Perl> backend is the default choice 1125fashion. The L<AnyEvent::Impl::Perl> backend is the default choice
1130 1130
1131If you want to handle IRIs or IDNs (L<AnyEvent::Util> punycode and idn 1131If you want to handle IRIs or IDNs (L<AnyEvent::Util> punycode and idn
1132functions), you also need to include C<"AnyEvent/Util/idna.pl"> and 1132functions), you also need to include C<"AnyEvent/Util/idna.pl"> and
1133C<"AnyEvent/Util/uts46data.pl">. 1133C<"AnyEvent/Util/uts46data.pl">.
1134 1134
1135Or you can use C<--usepacklist> and specify C<-MAnyEvent> to include 1135Or you can use C<--usepacklists> and specify C<-MAnyEvent> to include
1136everything. 1136everything.
1137 1137
1138=item Carp 1138=item Carp
1139 1139
1140Carp had (in older versions of perl) a dependency on L<Carp::Heavy>. As of 1140Carp had (in older versions of perl) a dependency on L<Carp::Heavy>. As of
1146turn might need L<"Config_heavy.pl">. Including the latter gives you 1146turn might need L<"Config_heavy.pl">. Including the latter gives you
1147both. 1147both.
1148 1148
1149=item Term::ReadLine::Perl 1149=item Term::ReadLine::Perl
1150 1150
1151Also needs L<Term::ReadLine::readline>, or C<--usepacklist>. 1151Also needs L<Term::ReadLine::readline>, or C<--usepacklists>.
1152 1152
1153=item URI 1153=item URI
1154 1154
1155URI implements schemes as separate modules - the generic URL scheme is 1155URI implements schemes as separate modules - the generic URL scheme is
1156implemented in L<URI::_generic>, HTTP is implemented in L<URI::http>. If 1156implemented in L<URI::_generic>, HTTP is implemented in L<URI::http>. If
1157you need to use any of these schemes, you should include these manually, 1157you need to use any of these schemes, you should include these manually,
1158or use C<--usepacklist>. 1158or use C<--usepacklists>.
1159 1159
1160=back 1160=back
1161 1161
1162=head2 RECIPES 1162=head2 RECIPES
1163 1163
1164=over 4 1164=over 4
1165 1165
1166=item Linking everything in 1166=item Just link everything in
1167 1167
1168To link just about everything installed in the perl library into a new 1168To link just about everything installed in the perl library into a new
1169perl, try this: 1169perl, try this (the first time this runs it will take a long time, as a
1170lot of files need to be parsed):
1170 1171
1171 staticperl mkperl --strip ppi --incglob '*' 1172 staticperl mkperl -v --strip ppi --incglob '*'
1172 1173
1174If you don't mind the extra megabytes, this can be a very effective way of
1175creating bundles without having to worry about forgetting any modules.
1176
1177You get even more useful variants of this method by first selecting
1178everything, and then excluding stuff you are reasonable sure not to need -
1179L<bigperl|http://staticperl.schmorp.de/bigperl.html> uses this approach.
1180
1173=item Getting rid of netdb function 1181=item Getting rid of netdb functions
1174 1182
1175The perl core has lots of netdb functions (C<getnetbyname>, C<getgrent> 1183The perl core has lots of netdb functions (C<getnetbyname>, C<getgrent>
1176and so on) that few applications use. You can avoid compiling them in by 1184and so on) that few applications use. You can avoid compiling them in by
1177putting the following fragment into a C<preconfigure> hook: 1185putting the following fragment into a C<preconfigure> hook:
1178 1186
1195 do 1203 do
1196 PERL_CONFIGURE="$PERL_CONFIGURE -U$sym" 1204 PERL_CONFIGURE="$PERL_CONFIGURE -U$sym"
1197 done 1205 done
1198 } 1206 }
1199 1207
1200This mostly gains space when linking staticaly, as the functions will 1208This mostly gains space when linking statically, as the functions will
1201likely not be linked in. The gain for dynamically-linked binaries is 1209likely not be linked in. The gain for dynamically-linked binaries is
1202smaller. 1210smaller.
1203 1211
1204Also, this leaves C<gethostbyname> in - not only is it actually used 1212Also, this leaves C<gethostbyname> in - not only is it actually used
1205often, the L<Socket> module also exposes it, so leaving it out usually 1213often, the L<Socket> module also exposes it, so leaving it out usually

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines