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.49 by root, Wed Jul 13 15:23:13 2011 UTC vs.
Revision 1.56 by root, Mon Jun 25 11:37:15 2012 UTC

1=head1 NAME 1=head1 NAME
2 2
3staticperl - perl, libc, 100 modules, all in one 500kb file 3staticperl - perl, libc, 100 modules, all in one standalone 500kb file
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 staticperl help # print the embedded documentation 7 staticperl help # print the embedded documentation
8 staticperl fetch # fetch and unpack perl sources 8 staticperl fetch # fetch and unpack perl sources
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 perl ... # invoke the perlinterpreter
15 staticperl cpan # invoke CPAN shell 15 staticperl cpan # invoke CPAN shell
16 staticperl instmod path... # install unpacked modules 16 staticperl instsrc path... # install unpacked modules
17 staticperl instcpan modulename... # install modules from CPAN 17 staticperl instcpan modulename... # install modules from CPAN
18 staticperl mkbundle <bundle-args...> # see documentation 18 staticperl mkbundle <bundle-args...> # see documentation
19 staticperl mkperl <bundle-args...> # see documentation 19 staticperl mkperl <bundle-args...> # see documentation
20 staticperl mkapp appname <bundle-args...> # see documentation 20 staticperl mkapp appname <bundle-args...> # see documentation
21 21
348 add eg/httpd httpd.pm 348 add eg/httpd httpd.pm
349 349
350All options that specify modules or files to be added are processed in the 350All options that specify modules or files to be added are processed in the
351order given on the command line. 351order given on the command line.
352 352
353=head3 BUNDLE CREATION WORKFLOW / STATICPELR MKBUNDLE OPTIONS 353=head3 BUNDLE CREATION WORKFLOW / STATICPERL MKBUNDLE OPTIONS
354 354
355F<staticperl mkbundle> works by first assembling a list of candidate 355F<staticperl mkbundle> works by first assembling a list of candidate
356files and modules to include, then filtering them by include/exclude 356files and modules to include, then filtering them by include/exclude
357patterns. The remaining modules (together with their direct dependencies, 357patterns. The remaining modules (together with their direct dependencies,
358such as link libraries and L<AutoLoader> files) are then converted into 358such as link libraries and L<AutoLoader> files) are then converted into
543 # then later, in perl, use 543 # then later, in perl, use
544 use myfiles::file1; 544 use myfiles::file1;
545 require myfiles::file2; 545 require myfiles::file2;
546 my $res = do "myfiles/file3.pl"; 546 my $res = do "myfiles/file3.pl";
547 547
548=item C<--binadd> F<file> | C<--add> "F<file> alias" 548=item C<--binadd> F<file> | C<--binadd> "F<file> alias"
549 549
550Just like C<--add>, except that it treats the file as binary and adds it 550Just like C<--add>, except that it treats the file as binary and adds it
551without any postprocessing (perl files might get stripped to reduce their 551without any postprocessing (perl files might get stripped to reduce their
552size). 552size).
553 553
752standalone applications, and this option removes those known to cause 752standalone applications, and this option removes those known to cause
753trouble. 753trouble.
754 754
755Specifically, these are removed: 755Specifically, these are removed:
756 756
757C<PERL_HASH_SEED_DEBUG> and C<PERL_DEBUG_MSTATS> can cause underaible 757C<PERL_HASH_SEED_DEBUG> and C<PERL_DEBUG_MSTATS> can cause undesirable
758output, C<PERL5OPT>, C<PERL_DESTRUCT_LEVEL>, C<PERL_HASH_SEED> and 758output, C<PERL5OPT>, C<PERL_DESTRUCT_LEVEL>, C<PERL_HASH_SEED> and
759C<PERL_SIGNALS> can alter execution significantly, and C<PERL_UNICODE>, 759C<PERL_SIGNALS> can alter execution significantly, and C<PERL_UNICODE>,
760C<PERLIO_DEBUG> and C<PERLIO> can affect input and output. 760C<PERLIO_DEBUG> and C<PERLIO> can affect input and output.
761 761
762The variables C<PERL_LIB> and C<PERL5_LIB> are always ignored because the 762The variables C<PERL_LIB> and C<PERL5_LIB> are always ignored because the
949F<~/.staticperlrc> to override them. 949F<~/.staticperlrc> to override them.
950 950
951Most of the variables override (or modify) the corresponding F<Configure> 951Most of the variables override (or modify) the corresponding F<Configure>
952variable, except C<PERL_CCFLAGS>, which gets appended. 952variable, except C<PERL_CCFLAGS>, which gets appended.
953 953
954You should have a look near the beginning of the F<staticperl> script - 954The default for C<PERL_OPTIMIZE> is C<-Os> (assuming gcc), and for
955staticperl tries to default C<PERL_OPTIMIZE> to some psace-saving options 955C<PERL_LIBS> is C<-lm -lcrypt>, which should be good for most (but not
956suitable for newer gcc versions. For other compilers or older versions you 956all) systems.
957
958For other compilers or more customised optimisation settings, you need to
957need to adjust these, for example, in your F<~/.staticperlrc>. 959adjust these, e.g. in your F<~/.staticperlrc>.
960
961With gcc on x86 and amd64, you can get more space-savings by using:
962
963 -Os -ffunction-sections -fdata-sections -finline-limit=8 -mpush-args
964 -mno-inline-stringops-dynamically -mno-align-stringops
965
966And on x86 and pentium3 and newer (basically everything you might ever
967want to run on), adding these is even better for space-savings (use
968-mtune=core2 or something newer for much faster code, too):
969
970 -fomit-frame-pointer -march=pentium3 -mtune=i386
958 971
959=back 972=back
960 973
961=head4 Variables you probably I<do not want> to override 974=head4 Variables you probably I<do not want> to override
962 975
1340C<MAN3PODS> to be empty via the C<PERL_MM_OPT> environment variable. 1353C<MAN3PODS> to be empty via the C<PERL_MM_OPT> environment variable.
1341 1354
1342=item Gtk2 1355=item Gtk2
1343 1356
1344See Pango, same problems, same solution. 1357See Pango, same problems, same solution.
1358
1359=item Net::SSLeay
1360
1361This module hasn't been significantly updated since OpenSSL is called
1362OpenSSL, and fails to properly link against dependent libraries, most
1363commonly, it forgets to specify -ldl when linking.
1364
1365On GNU/Linux systems this usually goes undetected, as perl usually links
1366against -ldl itself and OpenSSL just happens to pick it up that way, by
1367chance.
1368
1369For static builds, you either have to configure -ldl manually, or you
1370cna use the following snippet in your C<postinstall> hook which patches
1371Net::SSLeay after installation, which happens to work most of the time:
1372
1373 postinstall() {
1374 # first install it
1375 instcpan Net::SSLeay
1376 # then add -ldl for future linking
1377 chmod u+w "$PERL_PREFIX"/lib/auto/Net/SSLeay/extralibs.ld
1378 echo " -ldl" >>"$PERL_PREFIX"/lib/auto/Net/SSLeay/extralibs.ld
1379 }
1345 1380
1346=item Pango 1381=item Pango
1347 1382
1348In addition to the C<MAN3PODS> problem in Glib, Pango also routes around 1383In addition to the C<MAN3PODS> problem in Glib, Pango also routes around
1349L<ExtUtils::MakeMaker> by compiling its files on its own. F<staticperl> 1384L<ExtUtils::MakeMaker> by compiling its files on its own. F<staticperl>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines