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