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.31 by root, Thu Dec 23 14:16:25 2010 UTC vs.
Revision 1.45 by root, Mon Jun 27 21:56:51 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
20 21
21Typical Examples: 22Typical Examples:
22 23
23 staticperl install # fetch, configure, build and install perl 24 staticperl install # fetch, configure, build and install perl
24 staticperl cpan # run interactive cpan shell 25 staticperl cpan # run interactive cpan shell
25 staticperl mkperl -M '"Config_heavy.pl"' # build a perl that supports -V 26 staticperl mkperl -MConfig_heavy.pl # build a perl that supports -V
26 staticperl mkperl -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI -MURI::http 27 staticperl mkperl -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI -MURI::http
27 # build a perl with the above modules linked in 28 # build a perl with the above modules linked in
28 staticperl mkapp myapp --boot mainprog mymodules 29 staticperl mkapp myapp --boot mainprog mymodules
29 # build a binary "myapp" from mainprog and mymodules 30 # build a binary "myapp" from mainprog and mymodules
30 31
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
139with creating binaries and bundle files. 140with creating binaries and bundle files.
140 141
141=head2 PHASE 1 COMMANDS: INSTALLING PERL 142=head2 PHASE 1 COMMANDS: INSTALLING PERL
142 143
143The most important command is F<install>, which does basically 144The most important command is F<install>, which does basically
144everything. The default is to download and install perl 5.12.2 and a few 145everything. The default is to download and install perl 5.12.3 and a few
145modules required by F<staticperl> itself, but all this can (and should) be 146modules required by F<staticperl> itself, but all this can (and should) be
146changed - see L<CONFIGURATION>, below. 147changed - see L<CONFIGURATION>, below.
147 148
148The command 149The command
149 150
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,
252 263
253 # first make sure we have perl and the required modules 264 # first make sure we have perl and the required modules
254 staticperl instcpan AnyEvent::HTTPD 265 staticperl instcpan AnyEvent::HTTPD
255 266
256 # now build the perl 267 # now build the perl
257 staticperl mkperl -M'"Config_heavy.pl"' -MAnyEvent::Impl::Perl \ 268 staticperl mkperl -MConfig_heavy.pl -MAnyEvent::Impl::Perl \
258 -MAnyEvent::HTTPD -MURI::http \ 269 -MAnyEvent::HTTPD -MURI::http \
259 --add 'eg/httpd httpd.pm' 270 --add 'eg/httpd httpd.pm'
260 271
261 # finally, invoke it 272 # finally, invoke it
262 ./perl -Mhttpd 273 ./perl -Mhttpd
381 392
382=over 4 393=over 4
383 394
384=item C<--use> F<module> | C<-M>F<module> 395=item C<--use> F<module> | C<-M>F<module>
385 396
386Include the named module and trace direct dependencies. This is done by 397Include the named module or perl library and trace direct
387C<require>'ing the module in a subprocess and tracing which other modules 398dependencies. This is done by loading the module in a subprocess and
388and files it actually loads. 399tracing which other modules and files it actually loads.
389 400
390Example: include AnyEvent and AnyEvent::Impl::Perl. 401Example: include AnyEvent and AnyEvent::Impl::Perl.
391 402
392 staticperl mkbundle --use AnyEvent --use AnyEvent::Impl::Perl 403 staticperl mkbundle --use AnyEvent --use AnyEvent::Impl::Perl
393 404
394Sometimes you want to load old-style "perl libraries" (F<.pl> files), 405Sometimes you want to load old-style "perl libraries" (F<.pl> files), or
395or maybe other weirdly named files. To do that, you need to quote 406maybe other weirdly named files. To support this, the C<--use> option
396the name in single or double quotes (this is because F<staticperl> 407actually tries to do what you mean, depending on the string you specify:
397I<literally> just adds the string after the C<require> - which acts 408
398different when confronted with quoted vs. unquoted strings). When given on 409=over 4
399the command line, you probably need to quote once more to avoid your shell 410
400interpreting it. Common cases that need this are F<Config_heavy.pl> and 411=item a possibly valid module name, e.g. F<common::sense>, F<Carp>,
401F<utf8_heavy.pl>. 412F<Coro::Mysql>.
413
414If the string contains no quotes, no F</> and no F<.>, then C<--use>
415assumes that it is a normal module name. It will create a new package and
416evaluate a C<use module> in it, i.e. it will load the package and do a
417default import.
418
419The import step is done because many modules trigger more dependencies
420when something is imported than without.
421
422=item anything that contains F</> or F<.> characters,
423e.g. F<utf8_heavy.pl>, F<Module/private/data.pl>.
424
425The string will be quoted and passed to require, as if you used C<require
426$module>. Nothing will be imported.
427
428=item "path" or 'path', e.g. C<"utf8_heavy.pl">.
429
430If you enclose the name into single or double quotes, then the quotes will
431be removed and the resulting string will be passed to require. This syntax
432is form compatibility with older versions of staticperl and should not be
433used anymore.
434
435=back
436
437Example: C<use> AnyEvent::Socket, once using C<use> (importing the
438symbols), and once via C<require>, not importing any symbols. The first
439form is preferred as many modules load some extra dependencies when asked
440to export symbols.
441
442 staticperl mkbundle -MAnyEvent::Socket # use + import
443 staticperl mkbundle -MAnyEvent/Socket.pm # require only
402 444
403Example: include the required files for F<perl -V> to work in all its 445Example: include the required files for F<perl -V> to work in all its
404glory (F<Config.pm> is included automatically by this). 446glory (F<Config.pm> is included automatically by the dependency tracker).
405 447
406 # bourne shell 448 # shell command
407 staticperl mkbundle --use '"Config_heavy.pl"' 449 staticperl mkbundle -MConfig_heavy.pl
408 450
409 # bundle specification file 451 # bundle specification file
410 use "Config_heavy.pl" 452 use Config_heavy.pl
411 453
412The C<-M>module syntax is included as a convenience that might be easier 454The C<-M>module syntax is included as a convenience that might be easier
413to remember than C<--use> - it's the same switch as perl itself uses 455to remember than C<--use> - it's the same switch as perl itself uses
414to load modules. Or maybe it confuses people. Time will tell. Or maybe 456to load modules. Or maybe it confuses people. Time will tell. Or maybe
415not. Sigh. 457not. Sigh.
420code, or maybe one of the modules you use need a special use statement. In 462code, or maybe one of the modules you use need a special use statement. In
421that case, you can use C<--eval> to execute some perl snippet or set some 463that case, you can use C<--eval> to execute some perl snippet or set some
422variables or whatever you need. All files C<require>'d or C<use>'d while 464variables or whatever you need. All files C<require>'d or C<use>'d while
423executing the snippet are included in the final bundle. 465executing the snippet are included in the final bundle.
424 466
425Keep in mind that F<mkbundle> will only C<require> the modules named 467Keep in mind that F<mkbundle> will not import any symbols from the modules
426by the C<--use> option, so do not expect the symbols from modules you 468named by the C<--use> option, so do not expect the symbols from modules
427C<--use>'d earlier on the command line to be available. 469you C<--use>'d earlier on the command line to be available.
428 470
429Example: force L<AnyEvent> to detect a backend and therefore include it 471Example: force L<AnyEvent> to detect a backend and therefore include it
430in the final bundle. 472in the final bundle.
431 473
432 staticperl mkbundle --eval 'use AnyEvent; AnyEvent::detect' 474 staticperl mkbundle --eval 'use AnyEvent; AnyEvent::detect'
467 --incglob '/unicore/**.pl' 509 --incglob '/unicore/**.pl'
468 510
469=item C<--add> F<file> | C<--add> "F<file> alias" 511=item C<--add> F<file> | C<--add> "F<file> alias"
470 512
471Adds the given (perl) file into the bundle (and optionally call it 513Adds the given (perl) file into the bundle (and optionally call it
472"alias"). The F<file> is either an absolute path or a path relative to 514"alias"). The F<file> is either an absolute path or a path relative to the
473the current directory. If an alias is specified, then this is the name it 515current directory. If an alias is specified, then this is the name it will
474will use for C<@INC> searches, otherwise the F<file> will be used as the 516use for C<@INC> searches, otherwise the path F<file> will be used as the
475internal name. 517internal name.
476 518
477This switch is used to include extra files into the bundle. 519This switch is used to include extra files into the bundle.
478 520
479Example: embed the file F<httpd> in the current directory as F<httpd.pm> 521Example: embed the file F<httpd> in the current directory as F<httpd.pm>
480when creating the bundle. 522when creating the bundle.
481 523
482 staticperl mkperl --add "httpd httpd.pm" 524 staticperl mkperl --add "httpd httpd.pm"
525
526 # can be accessed via "use httpd"
527
528Example: add a file F<initcode> from the current directory.
529
530 staticperl mkperl --add 'initcode &initcode'
531
532 # can be accessed via "do '&initcode'"
483 533
484Example: add local files as extra modules in the bundle. 534Example: add local files as extra modules in the bundle.
485 535
486 # specification file 536 # specification file
487 add file1 myfiles/file1.pm 537 add file1 myfiles/file1.pm
497 547
498Just like C<--add>, except that it treats the file as binary and adds it 548Just like C<--add>, except that it treats the file as binary and adds it
499without any postprocessing (perl files might get stripped to reduce their 549without any postprocessing (perl files might get stripped to reduce their
500size). 550size).
501 551
502You should probably add a C</> prefix to avoid clashing with embedded perl 552If you specify an alias you should probably add a C<&> prefix to avoid
503files (whose paths do not start with C</>), and/or use a special directory 553clashing with embedded perl files (whose paths never start with C<&>),
504prefix, such as C</res/name>. 554and/or use a special directory prefix, such as C<&res/name>.
505 555
506You can later get a copy of these files by calling C<staticperl::find 556You can later get a copy of these files by calling C<staticperl::find
507"alias">. 557"alias">.
508 558
509An alternative way to embed binary files is to convert them to perl and 559An alternative way to embed binary files is to convert them to perl and
664The difference to the (mutually exclusive) C<--perl> option is that the 714The difference to the (mutually exclusive) C<--perl> option is that the
665binary created by this option will not try to act as a perl interpreter - 715binary created by this option will not try to act as a perl interpreter -
666instead it will simply initialise the perl interpreter, clean it up and 716instead it will simply initialise the perl interpreter, clean it up and
667exit. 717exit.
668 718
669This means that, by default, it will do nothing but burna few CPU cycles 719This means that, by default, it will do nothing but burn a few CPU cycles
670- for it to do something useful you I<must> add some boot code, e.g. with 720- for it to do something useful you I<must> add some boot code, e.g. with
671the C<--boot> option. 721the C<--boot> option.
672 722
673Example: create a standalone perl binary called F<./myexe> that will 723Example: create a standalone perl binary called F<./myexe> that will
674execute F<appfile> when it is started. 724execute F<appfile> when it is started.
675 725
676 staticperl mkbundle --app myexe --boot appfile 726 staticperl mkbundle --app myexe --boot appfile
727
728=item C<--ignore-env>
729
730Generates extra code to unset some environment variables before
731initialising/running perl. Perl supports a lot of environment variables
732that might alter execution in ways that might be undesirablre for
733standalone applications, and this option removes those known to cause
734trouble.
735
736Specifically, these are removed:
737
738C<PERL_HASH_SEED_DEBUG> and C<PERL_DEBUG_MSTATS> can cause underaible
739output, C<PERL5OPT>, C<PERL_DESTRUCT_LEVEL>, C<PERL_HASH_SEED> and
740C<PERL_SIGNALS> can alter execution significantly, and C<PERL_UNICODE>,
741C<PERLIO_DEBUG> and C<PERLIO> can affect input and output.
742
743The variables C<PERL_LIB> and C<PERL5_LIB> are always ignored because the
744startup code used by F<staticperl> overrides C<@INC> in all cases.
745
746This option will not make your program more secure (unless you are
747running with elevated privileges), but it will reduce the surprise effect
748when a user has these environment variables set and doesn't expect your
749standalone program to act like a perl interpreter.
677 750
678=item C<--static> 751=item C<--static>
679 752
680Add C<-static> to F<bundle.ldopts>, which means a fully static (if 753Add C<-static> to F<bundle.ldopts>, which means a fully static (if
681supported by the OS) executable will be created. This is not immensely 754supported by the OS) executable will be created. This is not immensely
809=item C<STATICPERL> 882=item C<STATICPERL>
810 883
811The directory where staticperl stores all its files 884The directory where staticperl stores all its files
812(default: F<~/.staticperl>). 885(default: F<~/.staticperl>).
813 886
887=item C<DLCACHE>
888
889The path to a directory (will be created if it doesn't exist) where
890downloaded perl sources are being cached, to avoid downloading them
891again. The default is empty, which means there is no cache.
892
893=item C<PERL_VERSION>
894
895The perl version to install - default is currently C<5.12.3>, but C<5.8.9>
896is also a good choice (5.8.9 is much smaller than 5.12.3, while 5.10.1 is
897about as big as 5.12.3).
898
814=item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ... 899=item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ...
815 900
816Usually set to C<1> to make modules "less inquisitive" during their 901Usually set to C<1> to make modules "less inquisitive" during their
817installation, you can set any environment variable you want - some modules 902installation. You can set (and export!) any environment variable you want
818(such as L<Coro> or L<EV>) use environment variables for further tweaking. 903- some modules (such as L<Coro> or L<EV>) use environment variables for
819 904further tweaking.
820=item C<PERL_VERSION>
821
822The perl version to install - default is currently C<5.12.2>, but C<5.8.9>
823is also a good choice (5.8.9 is much smaller than 5.12.2, while 5.10.1 is
824about as big as 5.12.2).
825 905
826=item C<PERL_PREFIX> 906=item C<PERL_PREFIX>
827 907
828The prefix where perl gets installed (default: F<$STATICPERL/perl>), 908The prefix where perl gets installed (default: F<$STATICPERL/perl>),
829i.e. where the F<bin> and F<lib> subdirectories will end up. 909i.e. where the F<bin> and F<lib> subdirectories will end up.
850F<~/.staticperlrc> to override them. 930F<~/.staticperlrc> to override them.
851 931
852Most of the variables override (or modify) the corresponding F<Configure> 932Most of the variables override (or modify) the corresponding F<Configure>
853variable, except C<PERL_CCFLAGS>, which gets appended. 933variable, except C<PERL_CCFLAGS>, which gets appended.
854 934
935You should have a look near the beginning of the F<staticperl> script -
936staticperl tries to default C<PERL_OPTIMIZE> to some psace-saving options
937suitable for newer gcc versions. For other compilers or older versions you
938need to adjust these, for example, in your F<~/.staticperlrc>.
939
855=back 940=back
856 941
857=head4 Variables you probably I<do not want> to override 942=head4 Variables you probably I<do not want> to override
858 943
859=over 4 944=over 4
877=head3 OVERRIDABLE HOOKS 962=head3 OVERRIDABLE HOOKS
878 963
879In addition to environment variables, it is possible to provide some 964In addition to environment variables, it is possible to provide some
880shell functions that are called at specific times. To provide your own 965shell functions that are called at specific times. To provide your own
881commands, just define the corresponding function. 966commands, just define the corresponding function.
967
968The actual order in which hooks are invoked during a full install
969from scratch is C<preconfigure>, C<patchconfig>, C<postconfigure>,
970C<postbuild>, C<postinstall>.
882 971
883Example: install extra modules from CPAN and from some directories 972Example: install extra modules from CPAN and from some directories
884at F<staticperl install> time. 973at F<staticperl install> time.
885 974
886 postinstall() { 975 postinstall() {
893 982
894=over 4 983=over 4
895 984
896=item preconfigure 985=item preconfigure
897 986
898Called just before running F<./Configur> in the perl source 987Called just before running F<./Configure> in the perl source
899directory. Current working directory is the perl source directory. 988directory. Current working directory is the perl source directory.
900 989
901This can be used to set any C<PERL_xxx> variables, which might be costly 990This can be used to set any C<PERL_xxx> variables, which might be costly
902to compute. 991to compute.
903 992
993=item patchconfig
994
995Called after running F<./Configure> in the perl source directory to create
996F<./config.sh>, but before running F<./Configure -S> to actually apply the
997config. Current working directory is the perl source directory.
998
999Can be used to tailor/patch F<config.sh> or do any other modifications.
1000
904=item postconfigure 1001=item postconfigure
905 1002
906Called after configuring, but before building perl. Current working 1003Called after configuring, but before building perl. Current working
907directory is the perl source directory. 1004directory is the perl source directory.
908
909Could be used to tailor/patch config.sh (followed by F<sh Configure -S>)
910or do any other modifications.
911 1005
912=item postbuild 1006=item postbuild
913 1007
914Called after building, but before installing perl. Current working 1008Called after building, but before installing perl. Current working
915directory is the perl source directory. 1009directory is the perl source directory.
953A header file that contains the prototypes of the few symbols "exported" 1047A header file that contains the prototypes of the few symbols "exported"
954by bundle.c, and also exposes the perl headers to the application. 1048by bundle.c, and also exposes the perl headers to the application.
955 1049
956=over 4 1050=over 4
957 1051
958=item staticperl_init () 1052=item staticperl_init (xs_init = 0)
959 1053
960Initialises the perl interpreter. You can use the normal perl functions 1054Initialises the perl interpreter. You can use the normal perl functions
961after calling this function, for example, to define extra functions or 1055after calling this function, for example, to define extra functions or
962to load a .pm file that contains some initialisation code, or the main 1056to load a .pm file that contains some initialisation code, or the main
963program function: 1057program function:
970 } 1064 }
971 1065
972 static void 1066 static void
973 run_myapp(void) 1067 run_myapp(void)
974 { 1068 {
975 staticperl_init (); 1069 staticperl_init (0);
976 newXSproto ("myapp::xsfunction", xsfunction, __FILE__, "$$;$"); 1070 newXSproto ("myapp::xsfunction", xsfunction, __FILE__, "$$;$");
977 eval_pv ("require myapp::main", 1); // executes "myapp/main.pm" 1071 eval_pv ("require myapp::main", 1); // executes "myapp/main.pm"
978 } 1072 }
979 1073
1074When your bootcode already wants to access some XS functions at
1075compiletime, then you need to supply an C<xs_init> function pointer that
1076is called as soon as perl is initialised enough to define XS functions,
1077but before the preamble code is executed:
1078
1079 static void
1080 xs_init (pTHX)
1081 {
1082 newXSproto ("myapp::xsfunction", xsfunction, __FILE__, "$$;$");
1083 }
1084
1085 static void
1086 run_myapp(void)
1087 {
1088 staticperl_init (xs_init);
1089 }
1090
1091=item staticperl_cleanup ()
1092
1093In the unlikely case that you want to destroy the perl interpreter, here
1094is the corresponding function.
1095
980=item staticperl_xs_init (pTHX) 1096=item staticperl_xs_init (pTHX)
981 1097
982Sometimes you need direct control over C<perl_parse> and C<perl_run>, in 1098Sometimes you need direct control over C<perl_parse> and C<perl_run>, in
983which case you do not want to use C<staticperl_init> but call them on your 1099which case you do not want to use C<staticperl_init> but call them on your
984own. 1100own.
985 1101
986Then you need this function - either pass it directly as the C<xs_init> 1102Then you need this function - either pass it directly as the C<xs_init>
987function to C<perl_parse>, or call it from your own C<xs_init> function. 1103function to C<perl_parse>, or call it as one of the first things from your
988 1104own C<xs_init> function.
989=item staticperl_cleanup ()
990
991In the unlikely case that you want to destroy the perl interpreter, here
992is the corresponding function.
993 1105
994=item PerlInterpreter *staticperl 1106=item PerlInterpreter *staticperl
995 1107
996The perl interpreter pointer used by staticperl. Not normally so useful, 1108The perl interpreter pointer used by staticperl. Not normally so useful,
997but there it is. 1109but there it is.
1050good experiences with GCC 4.4.x but not GCC 4.5. 1162good experiences with GCC 4.4.x but not GCC 4.5.
1051 1163
1052To minimise code size, I used C<-pipe -ffunction-sections -fdata-sections 1164To minimise code size, I used C<-pipe -ffunction-sections -fdata-sections
1053-finline-limit=8 -fno-builtin-strlen -mtune=i386>. The C<-mtune=i386> 1165-finline-limit=8 -fno-builtin-strlen -mtune=i386>. The C<-mtune=i386>
1054doesn't decrease codesize much, but it makes the file much more 1166doesn't decrease codesize much, but it makes the file much more
1055compressible. 1167compressible (and the execution a lot slower...).
1056 1168
1057If you don't need Coro or threads, you can go with "linuxthreads.old" (or 1169If you don't need Coro or threads, you can go with "linuxthreads.old" (or
1058no thread support). For Coro, it is highly recommended to switch to a 1170no thread support). For Coro, it is highly recommended to switch to a
1059uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201 1171uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201
1060snapshot) and enable NPTL, otherwise Coro needs to be configured with the 1172snapshot) and enable NPTL, otherwise Coro needs to be configured with the
1062twice the address space needed for stacks). 1174twice the address space needed for stacks).
1063 1175
1064If you use C<linuxthreads.old>, then you should also be aware that 1176If you use C<linuxthreads.old>, then you should also be aware that
1065uClibc shares C<errno> between all threads when statically linking. See 1177uClibc shares C<errno> between all threads when statically linking. See
1066L<http://lists.uclibc.org/pipermail/uclibc/2010-June/044157.html> for a 1178L<http://lists.uclibc.org/pipermail/uclibc/2010-June/044157.html> for a
1067workaround (And L<https://bugs.uclibc.org/2089> for discussion). 1179workaround (and L<https://bugs.uclibc.org/2089> for discussion).
1068 1180
1069C<ccache> support is also recommended, especially if you want 1181C<ccache> support is also recommended, especially if you want
1070to play around with buildroot options. Enabling the C<miniperl> 1182to play around with buildroot options. Enabling the C<miniperl>
1071package will probably enable all options required for a successful 1183package will probably enable all options required for a successful
1072perl build. F<staticperl> itself additionally needs either C<wget> 1184perl build. F<staticperl> itself additionally needs either C<wget>
1080it from working properly in a chroot - either use dash (and link it to 1192it from working properly in a chroot - either use dash (and link it to
1081F</bin/sh> inside the chroot) or link busybox to F</bin/sh>, using it's 1193F</bin/sh> inside the chroot) or link busybox to F</bin/sh>, using it's
1082built-in ash shell. 1194built-in ash shell.
1083 1195
1084Finally, you need F</dev/null> inside the chroot for many scripts to work 1196Finally, you need F</dev/null> inside the chroot for many scripts to work
1085- F<cp /dev/null output/target/dev> or bind-mounting your F</dev> will 1197- either F<cp /dev/null output/target/dev> or bind-mounting your F</dev>
1086both provide this. 1198will provide this.
1087 1199
1088After you have compiled and set up your buildroot target, you can copy 1200After you have compiled and set up your buildroot target, you can copy
1089F<staticperl> from the C<App::Staticperl> distribution or from your 1201F<staticperl> from the C<App::Staticperl> distribution or from your
1090perl f<bin> directory (if you installed it) into the F<output/target> 1202perl F<bin> directory (if you installed it) into the F<output/target>
1091filesystem, chroot inside and run it. 1203filesystem, chroot inside and run it.
1092 1204
1093=head1 RECIPES / SPECIFIC MODULES 1205=head1 RECIPES / SPECIFIC MODULES
1094 1206
1095This section contains some common(?) recipes and information about 1207This section contains some common(?) recipes and information about
1104 1216
1105Some functionality in the utf8 module, such as swash handling (used 1217Some functionality in the utf8 module, such as swash handling (used
1106for unicode character ranges in regexes) is implemented in the 1218for unicode character ranges in regexes) is implemented in the
1107C<"utf8_heavy.pl"> library: 1219C<"utf8_heavy.pl"> library:
1108 1220
1109 -M'"utf8_heavy.pl"' 1221 -Mutf8_heavy.pl
1110 1222
1111Many Unicode properties in turn are defined in separate modules, 1223Many Unicode properties in turn are defined in separate modules,
1112such as C<"unicore/Heavy.pl"> and more specific data tables such as 1224such as C<"unicore/Heavy.pl"> and more specific data tables such as
1113C<"unicore/To/Digit.pl"> or C<"unicore/lib/Perl/Word.pl">. These tables 1225C<"unicore/To/Digit.pl"> or C<"unicore/lib/Perl/Word.pl">. These tables
1114are big (7MB uncompressed, although F<staticperl> contains special 1226are big (7MB uncompressed, although F<staticperl> contains special
1133C<"AnyEvent/Util/uts46data.pl">. 1245C<"AnyEvent/Util/uts46data.pl">.
1134 1246
1135Or you can use C<--usepacklists> and specify C<-MAnyEvent> to include 1247Or you can use C<--usepacklists> and specify C<-MAnyEvent> to include
1136everything. 1248everything.
1137 1249
1250=item Cairo
1251
1252See Glib, same problem, same solution.
1253
1138=item Carp 1254=item Carp
1139 1255
1140Carp had (in older versions of perl) a dependency on L<Carp::Heavy>. As of 1256Carp had (in older versions of perl) a dependency on L<Carp::Heavy>. As of
1141perl 5.12.2 (maybe earlier), this dependency no longer exists. 1257perl 5.12.2 (maybe earlier), this dependency no longer exists.
1142 1258
1143=item Config 1259=item Config
1144 1260
1145The F<perl -V> switch (as well as many modules) needs L<Config>, which in 1261The F<perl -V> switch (as well as many modules) needs L<Config>, which in
1146turn might need L<"Config_heavy.pl">. Including the latter gives you 1262turn might need L<"Config_heavy.pl">. Including the latter gives you
1147both. 1263both.
1264
1265=item Glib
1266
1267Glib literally requires Glib to be installed already to build - it tries
1268to fake this by running Glib out of the build directory before being
1269built. F<staticperl> tries to work around this by forcing C<MAN1PODS> and
1270C<MAN3PODS> to be empty via the C<PERL_MM_OPT> environment variable.
1271
1272=item Gtk2
1273
1274See Pango, same problems, same solution.
1275
1276=item Pango
1277
1278In addition to the C<MAN3PODS> problem in Glib, Pango also routes around
1279L<ExtUtils::MakeMaker> by compiling its files on its own. F<staticperl>
1280tries to patch L<ExtUtils::MM_Unix> to route around Pango.
1148 1281
1149=item Term::ReadLine::Perl 1282=item Term::ReadLine::Perl
1150 1283
1151Also needs L<Term::ReadLine::readline>, or C<--usepacklists>. 1284Also needs L<Term::ReadLine::readline>, or C<--usepacklists>.
1152 1285

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines