… | |
… | |
147 | |
147 | |
148 | The command |
148 | The command |
149 | |
149 | |
150 | staticperl install |
150 | staticperl install |
151 | |
151 | |
152 | Is normally all you need: It installs the perl interpreter in |
152 | is normally all you need: It installs the perl interpreter in |
153 | F<~/.staticperl/perl>. It downloads, configures, builds and installs the |
153 | F<~/.staticperl/perl>. It downloads, configures, builds and installs the |
154 | perl interpreter if required. |
154 | perl interpreter if required. |
155 | |
155 | |
156 | Most of the following commands simply run one or more steps of this |
156 | Most of the following F<staticperl> subcommands simply run one or more |
157 | sequence. |
157 | steps of this sequence. |
|
|
158 | |
|
|
159 | If it fails, then most commonly because the compiler options I selected |
|
|
160 | are not supported by your compiler - either edit the F<staticperl> script |
|
|
161 | yourself or create F<~/.staticperl> shell script where your set working |
|
|
162 | C<PERL_CCFLAGS> etc. variables. |
158 | |
163 | |
159 | To force recompilation or reinstallation, you need to run F<staticperl |
164 | To force recompilation or reinstallation, you need to run F<staticperl |
160 | distclean> first. |
165 | distclean> first. |
161 | |
166 | |
162 | =over 4 |
167 | =over 4 |
… | |
… | |
209 | |
214 | |
210 | =item F<staticperl clean> |
215 | =item F<staticperl clean> |
211 | |
216 | |
212 | Deletes the perl source directory (and potentially cleans up other |
217 | Deletes the perl source directory (and potentially cleans up other |
213 | intermediate files). This can be used to clean up files only needed for |
218 | intermediate files). This can be used to clean up files only needed for |
214 | building perl, without removing the installed perl interpreter, or to |
219 | building perl, without removing the installed perl interpreter. |
215 | force a re-build from scratch. |
|
|
216 | |
220 | |
217 | At the moment, it doesn't delete downloaded tarballs. |
221 | At the moment, it doesn't delete downloaded tarballs. |
|
|
222 | |
|
|
223 | The exact semantics of this command will probably change. |
218 | |
224 | |
219 | =item F<staticperl distclean> |
225 | =item F<staticperl distclean> |
220 | |
226 | |
221 | This wipes your complete F<~/.staticperl> directory. Be careful with this, |
227 | This wipes your complete F<~/.staticperl> directory. Be careful with this, |
222 | it nukes your perl download, perl sources, perl distribution and any |
228 | it nukes your perl download, perl sources, perl distribution and any |
… | |
… | |
272 | -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI::http |
278 | -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI::http |
273 | |
279 | |
274 | # run it |
280 | # run it |
275 | ./app |
281 | ./app |
276 | |
282 | |
|
|
283 | Here are the three phase 2 commands: |
|
|
284 | |
|
|
285 | =over 4 |
|
|
286 | |
|
|
287 | =item F<staticperl mkbundle> args... |
|
|
288 | |
|
|
289 | The "default" bundle command - it interprets the given bundle options and |
|
|
290 | writes out F<bundle.h>, F<bundle.c>, F<bundle.ccopts> and F<bundle.ldopts> |
|
|
291 | files, useful for embedding. |
|
|
292 | |
|
|
293 | =item F<staticperl mkperl> args... |
|
|
294 | |
|
|
295 | Creates a bundle just like F<staticperl mkbundle> (in fact, it's the same |
|
|
296 | as invoking F<staticperl mkbundle --perl> args...), but then compiles and |
|
|
297 | links a new perl interpreter that embeds the created bundle, then deletes |
|
|
298 | all intermediate files. |
|
|
299 | |
|
|
300 | =item F<staticperl mkapp> filename args... |
|
|
301 | |
|
|
302 | Does the same as F<staticperl mkbundle> (in fact, it's the same as |
|
|
303 | invoking F<staticperl mkbundle --app> filename args...), but then compiles |
|
|
304 | and links a new standalone application that simply initialises the perl |
|
|
305 | interpreter. |
|
|
306 | |
|
|
307 | The difference to F<staticperl mkperl> is that the standalone application |
|
|
308 | does not act like a perl interpreter would - in fact, by default it would |
|
|
309 | just do nothing and exit immediately, so you should specify some code to |
|
|
310 | be executed via the F<--boot> option. |
|
|
311 | |
|
|
312 | =back |
|
|
313 | |
277 | =head3 OPTION PROCESSING |
314 | =head3 OPTION PROCESSING |
278 | |
315 | |
279 | All options can be given as arguments on the command line (typically |
316 | All options can be given as arguments on the command line (typically |
280 | using long (e.g. C<--verbose>) or short option (e.g. C<-v>) style). Since |
317 | using long (e.g. C<--verbose>) or short option (e.g. C<-v>) style). Since |
281 | specifying a lot of modules can make the command line very cumbersome, |
318 | specifying a lot of modules can make the command line very cumbersome, you |
282 | you can put all long options into a "bundle specification file" (with or |
319 | can put all long options into a "bundle specification file" (one option |
283 | without C<--> prefix) and specify this bundle file instead. |
320 | per line, with or without C<--> prefix) and specify this bundle file |
|
|
321 | instead. |
284 | |
322 | |
285 | For example, the command given earlier could also look like this: |
323 | For example, the command given earlier could also look like this: |
286 | |
324 | |
287 | staticperl mkperl httpd.bundle |
325 | staticperl mkperl httpd.bundle |
288 | |
326 | |
… | |
… | |
293 | use AnyEvent::HTTPD |
331 | use AnyEvent::HTTPD |
294 | use URI::http |
332 | use URI::http |
295 | add eg/httpd httpd.pm |
333 | add eg/httpd httpd.pm |
296 | |
334 | |
297 | All options that specify modules or files to be added are processed in the |
335 | All options that specify modules or files to be added are processed in the |
298 | order given on the command line (that affects the C<--use> and C<--eval> |
336 | order given on the command line. |
299 | options at the moment). |
|
|
300 | |
337 | |
301 | =head3 PACKAGE SELECTION WORKFLOW |
338 | =head3 PACKAGE SELECTION WORKFLOW |
302 | |
339 | |
303 | F<staticperl mkbundle> has a number of options to control package |
340 | F<staticperl mkbundle> has a number of options to control package |
304 | selection. This section describes how they interact with each other. Also, |
341 | selection. This section describes how they interact with each other. Also, |
… | |
… | |
703 | |
740 | |
704 | More commonly, you would either activate 64 bit integer support |
741 | More commonly, you would either activate 64 bit integer support |
705 | (C<-Duse64bitint>), or disable large files support (-Uuselargefiles), to |
742 | (C<-Duse64bitint>), or disable large files support (-Uuselargefiles), to |
706 | reduce filesize further. |
743 | reduce filesize further. |
707 | |
744 | |
708 | =item C<PERL_CC>, C<PERL_CPPFLAGS>, C<PERL_OPTIMIZE>, C<PERL_LDFLAGS>, C<PERL_LIBS> |
745 | =item C<PERL_CC>, C<PERL_CCFLAGS>, C<PERL_OPTIMIZE>, C<PERL_LDFLAGS>, C<PERL_LIBS> |
709 | |
746 | |
710 | These flags are passed to perl's F<Configure> script, and are generally |
747 | These flags are passed to perl's F<Configure> script, and are generally |
711 | optimised for small size (at the cost of performance). Since they also |
748 | optimised for small size (at the cost of performance). Since they also |
712 | contain subtle workarounds around various build issues, changing these |
749 | contain subtle workarounds around various build issues, changing these |
713 | usually requires understanding their default values - best look at the top |
750 | usually requires understanding their default values - best look at |
714 | of the F<staticperl> script for more info on these. |
751 | the top of the F<staticperl> script for more info on these, and use a |
|
|
752 | F<~/.staticperlrc> to override them. |
|
|
753 | |
|
|
754 | Most of the variables override (or modify) the corresponding F<Configure> |
|
|
755 | variable, except C<PERL_CCFLAGS>, which gets appended. |
715 | |
756 | |
716 | =back |
757 | =back |
717 | |
758 | |
718 | =head4 Variables you probably I<do not want> to override |
759 | =head4 Variables you probably I<do not want> to override |
719 | |
760 | |
720 | =over 4 |
761 | =over 4 |
|
|
762 | |
|
|
763 | =item C<MAKE> |
|
|
764 | |
|
|
765 | The make command to use - default is C<make>. |
721 | |
766 | |
722 | =item C<MKBUNDLE> |
767 | =item C<MKBUNDLE> |
723 | |
768 | |
724 | Where F<staticperl> writes the C<mkbundle> command to |
769 | Where F<staticperl> writes the C<mkbundle> command to |
725 | (default: F<$STATICPERL/mkbundle>). |
770 | (default: F<$STATICPERL/mkbundle>). |