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.38 by root, Fri Mar 18 19:49:04 2011 UTC vs.
Revision 1.41 by root, Thu May 19 18:58:19 2011 UTC

9 staticperl configure # fetch and then configure perl 9 staticperl configure # fetch and then configure perl
10 staticperl build # configure and then build perl 10 staticperl build # configure and then build perl
11 staticperl install # build and then install perl 11 staticperl install # build and then install perl
12 staticperl clean # clean most intermediate files (restart at configure) 12 staticperl clean # clean most intermediate files (restart at configure)
13 staticperl distclean # delete everything installed by this script 13 staticperl distclean # delete everything installed by this script
14 staticperl perl ... # invoke the perlinterpreter
14 staticperl cpan # invoke CPAN shell 15 staticperl cpan # invoke CPAN shell
15 staticperl instmod path... # install unpacked modules 16 staticperl instmod path... # install unpacked modules
16 staticperl instcpan modulename... # install modules from CPAN 17 staticperl instcpan modulename... # install modules from CPAN
17 staticperl mkbundle <bundle-args...> # see documentation 18 staticperl mkbundle <bundle-args...> # see documentation
18 staticperl mkperl <bundle-args...> # see documentation 19 staticperl mkperl <bundle-args...> # see documentation
38file that contains perl interpreter, libc, all the modules you need, all 39file that contains perl interpreter, libc, all the modules you need, all
39the libraries you need and of course your actual program. 40the libraries you need and of course your actual program.
40 41
41With F<uClibc> and F<upx> on x86, you can create a single 500kb binary 42With F<uClibc> and F<upx> on x86, you can create a single 500kb binary
42that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO, 43that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO,
43Coro and so on. Or any other choice of modules. 44Coro and so on. Or any other choice of modules (and some other size :).
44 45
45To see how this turns out, you can try out smallperl and bigperl, two 46To see how this turns out, you can try out smallperl and bigperl, two
46pre-built static and compressed perl binaries with many and even more 47pre-built static and compressed perl binaries with many and even more
47modules: just follow the links at L<http://staticperl.schmorp.de/>. 48modules: just follow the links at L<http://staticperl.schmorp.de/>.
48 49
185 186
186=item F<staticperl install> 187=item F<staticperl install>
187 188
188Wipes the perl installation directory (usually F<~/.staticperl/perl>) and 189Wipes the perl installation directory (usually F<~/.staticperl/perl>) and
189installs the perl distribution, potentially after building it first. 190installs the perl distribution, potentially after building it first.
191
192=item F<staticperl perl> [args...]
193
194Invokes the compiled perl interpreter with the given args. Basically the
195same as starting perl directly (usually via F<~/.staticperl/bin/perl>),
196but beats typing the path sometimes.
197
198Example: check that the Gtk2 module is installed and loadable.
199
200 staticperl perl -MGtk2 -e0
190 201
191=item F<staticperl cpan> [args...] 202=item F<staticperl cpan> [args...]
192 203
193Starts an interactive CPAN shell that you can use to install further 204Starts an interactive CPAN shell that you can use to install further
194modules. Installs the perl first if necessary, but apart from that, 205modules. Installs the perl first if necessary, but apart from that,
912F<~/.staticperlrc> to override them. 923F<~/.staticperlrc> to override them.
913 924
914Most of the variables override (or modify) the corresponding F<Configure> 925Most of the variables override (or modify) the corresponding F<Configure>
915variable, except C<PERL_CCFLAGS>, which gets appended. 926variable, except C<PERL_CCFLAGS>, which gets appended.
916 927
928You should have a look near the beginning of the F<staticperl> script -
929staticperl tries to default C<PERL_OPTIMIZE> to some psace-saving options
930suitable for newer gcc versions. For other compilers or older versions you
931need to adjust these, for example, in your F<~/.staticperlrc>.
932
917=back 933=back
918 934
919=head4 Variables you probably I<do not want> to override 935=head4 Variables you probably I<do not want> to override
920 936
921=over 4 937=over 4
1139good experiences with GCC 4.4.x but not GCC 4.5. 1155good experiences with GCC 4.4.x but not GCC 4.5.
1140 1156
1141To minimise code size, I used C<-pipe -ffunction-sections -fdata-sections 1157To minimise code size, I used C<-pipe -ffunction-sections -fdata-sections
1142-finline-limit=8 -fno-builtin-strlen -mtune=i386>. The C<-mtune=i386> 1158-finline-limit=8 -fno-builtin-strlen -mtune=i386>. The C<-mtune=i386>
1143doesn't decrease codesize much, but it makes the file much more 1159doesn't decrease codesize much, but it makes the file much more
1144compressible. 1160compressible (and the execution a lot slower...).
1145 1161
1146If you don't need Coro or threads, you can go with "linuxthreads.old" (or 1162If you don't need Coro or threads, you can go with "linuxthreads.old" (or
1147no thread support). For Coro, it is highly recommended to switch to a 1163no thread support). For Coro, it is highly recommended to switch to a
1148uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201 1164uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201
1149snapshot) and enable NPTL, otherwise Coro needs to be configured with the 1165snapshot) and enable NPTL, otherwise Coro needs to be configured with the
1222C<"AnyEvent/Util/uts46data.pl">. 1238C<"AnyEvent/Util/uts46data.pl">.
1223 1239
1224Or you can use C<--usepacklists> and specify C<-MAnyEvent> to include 1240Or you can use C<--usepacklists> and specify C<-MAnyEvent> to include
1225everything. 1241everything.
1226 1242
1243=item Cairo
1244
1245See Glib, same problem, same solution.
1246
1227=item Carp 1247=item Carp
1228 1248
1229Carp had (in older versions of perl) a dependency on L<Carp::Heavy>. As of 1249Carp had (in older versions of perl) a dependency on L<Carp::Heavy>. As of
1230perl 5.12.2 (maybe earlier), this dependency no longer exists. 1250perl 5.12.2 (maybe earlier), this dependency no longer exists.
1231 1251
1232=item Config 1252=item Config
1233 1253
1234The F<perl -V> switch (as well as many modules) needs L<Config>, which in 1254The F<perl -V> switch (as well as many modules) needs L<Config>, which in
1235turn might need L<"Config_heavy.pl">. Including the latter gives you 1255turn might need L<"Config_heavy.pl">. Including the latter gives you
1236both. 1256both.
1257
1258=item Glib
1259
1260Glib literally requires Glib to be installed already to build - it tries
1261to fake this by running Glib out of the build directory before being
1262built. F<staticperl> tries to work around this by forcing C<MAN1PODS> and
1263C<MAN3PODS> to be empty via the C<PERL_MM_OPT> environment variable.
1264
1265=item Gtk2
1266
1267See Pango, same problems, same solution.
1268
1269=item Pango
1270
1271In addition to the C<MAN3PODS> problem in Glib, Pango also routes around
1272L<ExtUtils::MakeMaker> by compiling its files on its own. F<staticperl>
1273tries to patch L<ExtUtils::MM_Unix> to route around Pango.
1237 1274
1238=item Term::ReadLine::Perl 1275=item Term::ReadLine::Perl
1239 1276
1240Also needs L<Term::ReadLine::readline>, or C<--usepacklists>. 1277Also needs L<Term::ReadLine::readline>, or C<--usepacklists>.
1241 1278

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines