… | |
… | |
84 | With F<staticperl>, the burden is mostly with the developer - only direct |
84 | With F<staticperl>, the burden is mostly with the developer - only direct |
85 | compile-time dependencies and L<AutoLoader> are handled automatically. |
85 | compile-time dependencies and L<AutoLoader> are handled automatically. |
86 | This means the modules to include often need to be tweaked manually. |
86 | This means the modules to include often need to be tweaked manually. |
87 | |
87 | |
88 | All this does not preclude more permissive modes to be implemented in |
88 | All this does not preclude more permissive modes to be implemented in |
89 | the future, but right now, you have to resolve state hidden dependencies |
89 | the future, but right now, you have to resolve hidden dependencies |
90 | manually. |
90 | manually. |
91 | |
91 | |
92 | =item * PAR works out of the box, F<staticperl> does not. |
92 | =item * PAR works out of the box, F<staticperl> does not. |
93 | |
93 | |
94 | Maintaining your own custom perl build can be a pain in the ass, and while |
94 | Maintaining your own custom perl build can be a pain in the ass, and while |
… | |
… | |
202 | =item F<staticperl cpan> [args...] |
202 | =item F<staticperl cpan> [args...] |
203 | |
203 | |
204 | Starts an interactive CPAN shell that you can use to install further |
204 | Starts an interactive CPAN shell that you can use to install further |
205 | modules. Installs the perl first if necessary, but apart from that, |
205 | modules. Installs the perl first if necessary, but apart from that, |
206 | no magic is involved: you could just as well run it manually via |
206 | no magic is involved: you could just as well run it manually via |
207 | F<~/.staticperl/perl/bin/cpan>. |
207 | F<~/.staticperl/perl/bin/cpan>, except that F<staticperl> additionally |
|
|
208 | sets the environment variable C<$PERL> to the path of the perl |
|
|
209 | interpreter, which is handy in subshells. |
208 | |
210 | |
209 | Any additional arguments are simply passed to the F<cpan> command. |
211 | Any additional arguments are simply passed to the F<cpan> command. |
210 | |
212 | |
211 | =item F<staticperl instcpan> module... |
213 | =item F<staticperl instcpan> module... |
212 | |
214 | |
… | |
… | |
566 | SOME_MARKER |
568 | SOME_MARKER |
567 | |
569 | |
568 | # load the binary |
570 | # load the binary |
569 | chomp (my $data = do "bindata.pl"); |
571 | chomp (my $data = do "bindata.pl"); |
570 | |
572 | |
|
|
573 | =item C<--allow-dlls> |
|
|
574 | |
|
|
575 | By default, when F<mkbundle> hits a dynamic perl extension (e.g. a F<.so> |
|
|
576 | or F<.dll> file), it will stop with a fatal error. |
|
|
577 | |
|
|
578 | This option instead packages the shared object into the bundle, with a |
|
|
579 | prefix of F<&fs/perl/> (e.g. F<&fs/perl/auto/List/Util/Util.so>). What you |
|
|
580 | do with that is up to you, F<staticperl> has no special support for this |
|
|
581 | at the moment, apart from working around the lack of availability of |
|
|
582 | F<PerlIO::scalar> while bootstrapping, at a speed cost. |
|
|
583 | |
|
|
584 | One way to deal with this is to write all files starting with F<&fs/> into |
|
|
585 | some directory and C<unshift>ing the path corresponding to F<&fs/perl/> |
|
|
586 | onto C<@INC>. |
|
|
587 | |
|
|
588 | #TODO: example |
|
|
589 | |
571 | =back |
590 | =back |
572 | |
591 | |
573 | =item Step 2: filter all files using C<--include> and C<--exclude> options. |
592 | =item Step 2: filter all files using C<--include> and C<--exclude> options. |
574 | |
593 | |
575 | After all candidate files and modules are added, they are I<filtered> |
594 | After all candidate files and modules are added, they are I<filtered> |
… | |
… | |
882 | =item C<STATICPERL> |
901 | =item C<STATICPERL> |
883 | |
902 | |
884 | The directory where staticperl stores all its files |
903 | The directory where staticperl stores all its files |
885 | (default: F<~/.staticperl>). |
904 | (default: F<~/.staticperl>). |
886 | |
905 | |
887 | =item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ... |
906 | =item C<DLCACHE> |
888 | |
907 | |
889 | Usually set to C<1> to make modules "less inquisitive" during their |
908 | The path to a directory (will be created if it doesn't exist) where |
890 | installation, you can set any environment variable you want - some modules |
909 | downloaded perl sources are being cached, to avoid downloading them |
891 | (such as L<Coro> or L<EV>) use environment variables for further tweaking. |
910 | again. The default is empty, which means there is no cache. |
892 | |
911 | |
893 | =item C<PERL_VERSION> |
912 | =item C<PERL_VERSION> |
894 | |
913 | |
895 | The perl version to install - default is currently C<5.12.3>, but C<5.8.9> |
914 | The perl version to install - default is currently C<5.12.3>, but C<5.8.9> |
896 | is also a good choice (5.8.9 is much smaller than 5.12.3, while 5.10.1 is |
915 | is also a good choice (5.8.9 is much smaller than 5.12.3, while 5.10.1 is |
897 | about as big as 5.12.3). |
916 | about as big as 5.12.3). |
|
|
917 | |
|
|
918 | =item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ... |
|
|
919 | |
|
|
920 | Usually set to C<1> to make modules "less inquisitive" during their |
|
|
921 | installation. You can set (and export!) any environment variable you want |
|
|
922 | - some modules (such as L<Coro> or L<EV>) use environment variables for |
|
|
923 | further tweaking. |
898 | |
924 | |
899 | =item C<PERL_PREFIX> |
925 | =item C<PERL_PREFIX> |
900 | |
926 | |
901 | The prefix where perl gets installed (default: F<$STATICPERL/perl>), |
927 | The prefix where perl gets installed (default: F<$STATICPERL/perl>), |
902 | i.e. where the F<bin> and F<lib> subdirectories will end up. |
928 | i.e. where the F<bin> and F<lib> subdirectories will end up. |
… | |
… | |
1167 | twice the address space needed for stacks). |
1193 | twice the address space needed for stacks). |
1168 | |
1194 | |
1169 | If you use C<linuxthreads.old>, then you should also be aware that |
1195 | If you use C<linuxthreads.old>, then you should also be aware that |
1170 | uClibc shares C<errno> between all threads when statically linking. See |
1196 | uClibc shares C<errno> between all threads when statically linking. See |
1171 | L<http://lists.uclibc.org/pipermail/uclibc/2010-June/044157.html> for a |
1197 | L<http://lists.uclibc.org/pipermail/uclibc/2010-June/044157.html> for a |
1172 | workaround (And L<https://bugs.uclibc.org/2089> for discussion). |
1198 | workaround (and L<https://bugs.uclibc.org/2089> for discussion). |
1173 | |
1199 | |
1174 | C<ccache> support is also recommended, especially if you want |
1200 | C<ccache> support is also recommended, especially if you want |
1175 | to play around with buildroot options. Enabling the C<miniperl> |
1201 | to play around with buildroot options. Enabling the C<miniperl> |
1176 | package will probably enable all options required for a successful |
1202 | package will probably enable all options required for a successful |
1177 | perl build. F<staticperl> itself additionally needs either C<wget> |
1203 | perl build. F<staticperl> itself additionally needs either C<wget> |
… | |
… | |
1185 | it from working properly in a chroot - either use dash (and link it to |
1211 | it from working properly in a chroot - either use dash (and link it to |
1186 | F</bin/sh> inside the chroot) or link busybox to F</bin/sh>, using it's |
1212 | F</bin/sh> inside the chroot) or link busybox to F</bin/sh>, using it's |
1187 | built-in ash shell. |
1213 | built-in ash shell. |
1188 | |
1214 | |
1189 | Finally, you need F</dev/null> inside the chroot for many scripts to work |
1215 | Finally, you need F</dev/null> inside the chroot for many scripts to work |
1190 | - F<cp /dev/null output/target/dev> or bind-mounting your F</dev> will |
1216 | - either F<cp /dev/null output/target/dev> or bind-mounting your F</dev> |
1191 | both provide this. |
1217 | will provide this. |
1192 | |
1218 | |
1193 | After you have compiled and set up your buildroot target, you can copy |
1219 | After you have compiled and set up your buildroot target, you can copy |
1194 | F<staticperl> from the C<App::Staticperl> distribution or from your |
1220 | F<staticperl> from the C<App::Staticperl> distribution or from your |
1195 | perl f<bin> directory (if you installed it) into the F<output/target> |
1221 | perl F<bin> directory (if you installed it) into the F<output/target> |
1196 | filesystem, chroot inside and run it. |
1222 | filesystem, chroot inside and run it. |
1197 | |
1223 | |
1198 | =head1 RECIPES / SPECIFIC MODULES |
1224 | =head1 RECIPES / SPECIFIC MODULES |
1199 | |
1225 | |
1200 | This section contains some common(?) recipes and information about |
1226 | This section contains some common(?) recipes and information about |