… | |
… | |
122 | often as necessary. |
122 | often as necessary. |
123 | |
123 | |
124 | =head1 THE F<STATICPERL> SCRIPT |
124 | =head1 THE F<STATICPERL> SCRIPT |
125 | |
125 | |
126 | This module installs a script called F<staticperl> into your perl |
126 | This module installs a script called F<staticperl> into your perl |
127 | binary directory. The script is fully self-contained, and can be used |
127 | binary directory. The script is fully self-contained, and can be |
128 | without perl (for example, in an uClibc chroot environment). In fact, |
128 | used without perl (for example, in an uClibc chroot environment). In |
129 | it can be extracted from the C<App::Staticperl> distribution tarball as |
129 | fact, it can be extracted from the C<App::Staticperl> distribution |
130 | F<bin/staticperl>, without any installation. |
130 | tarball as F<bin/staticperl>, without any installation. The |
|
|
131 | newest (possibly alpha) version can also be downloaded from |
|
|
132 | L<http://staticperl.schmorp.de/staticperl>. |
131 | |
133 | |
132 | F<staticperl> interprets the first argument as a command to execute, |
134 | F<staticperl> interprets the first argument as a command to execute, |
133 | optionally followed by any parameters. |
135 | optionally followed by any parameters. |
134 | |
136 | |
135 | There are two command categories: the "phase 1" commands which deal with |
137 | There are two command categories: the "phase 1" commands which deal with |
… | |
… | |
145 | |
147 | |
146 | The command |
148 | The command |
147 | |
149 | |
148 | staticperl install |
150 | staticperl install |
149 | |
151 | |
150 | Is normally all you need: It installs the perl interpreter in |
152 | is normally all you need: It installs the perl interpreter in |
151 | F<~/.staticperl/perl>. It downloads, configures, builds and installs the |
153 | F<~/.staticperl/perl>. It downloads, configures, builds and installs the |
152 | perl interpreter if required. |
154 | perl interpreter if required. |
153 | |
155 | |
154 | 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 |
155 | 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. |
156 | |
163 | |
157 | To force recompilation or reinstallation, you need to run F<staticperl |
164 | To force recompilation or reinstallation, you need to run F<staticperl |
158 | distclean> first. |
165 | distclean> first. |
159 | |
166 | |
160 | =over 4 |
167 | =over 4 |
… | |
… | |
207 | |
214 | |
208 | =item F<staticperl clean> |
215 | =item F<staticperl clean> |
209 | |
216 | |
210 | Deletes the perl source directory (and potentially cleans up other |
217 | Deletes the perl source directory (and potentially cleans up other |
211 | 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 |
212 | building perl, without removing the installed perl interpreter, or to |
219 | building perl, without removing the installed perl interpreter. |
213 | force a re-build from scratch. |
|
|
214 | |
220 | |
215 | 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. |
216 | |
224 | |
217 | =item F<staticperl distclean> |
225 | =item F<staticperl distclean> |
218 | |
226 | |
219 | This wipes your complete F<~/.staticperl> directory. Be careful with this, |
227 | This wipes your complete F<~/.staticperl> directory. Be careful with this, |
220 | it nukes your perl download, perl sources, perl distribution and any |
228 | it nukes your perl download, perl sources, perl distribution and any |
… | |
… | |
701 | |
709 | |
702 | More commonly, you would either activate 64 bit integer support |
710 | More commonly, you would either activate 64 bit integer support |
703 | (C<-Duse64bitint>), or disable large files support (-Uuselargefiles), to |
711 | (C<-Duse64bitint>), or disable large files support (-Uuselargefiles), to |
704 | reduce filesize further. |
712 | reduce filesize further. |
705 | |
713 | |
706 | =item C<PERL_CPPFLAGS>, C<PERL_OPTIMIZE>, C<PERL_LDFLAGS>, C<PERL_LIBS> |
714 | =item C<PERL_CC>, C<PERL_CCFLAGS>, C<PERL_OPTIMIZE>, C<PERL_LDFLAGS>, C<PERL_LIBS> |
707 | |
715 | |
708 | These flags are passed to perl's F<Configure> script, and are generally |
716 | These flags are passed to perl's F<Configure> script, and are generally |
709 | optimised for small size (at the cost of performance). Since they also |
717 | optimised for small size (at the cost of performance). Since they also |
710 | contain subtle workarounds around various build issues, changing these |
718 | contain subtle workarounds around various build issues, changing these |
711 | usually requires understanding their default values - best look at the top |
719 | usually requires understanding their default values - best look at |
712 | of the F<staticperl> script for more info on these. |
720 | the top of the F<staticperl> script for more info on these, and use a |
|
|
721 | F<~/.staticperlrc> to override them. |
|
|
722 | |
|
|
723 | Most of the variables override (or modify) the corresponding F<Configure> |
|
|
724 | variable, except C<PERL_CCFLAGS>, which gets appended. |
713 | |
725 | |
714 | =back |
726 | =back |
715 | |
727 | |
716 | =head4 Variables you probably I<do not want> to override |
728 | =head4 Variables you probably I<do not want> to override |
717 | |
729 | |
718 | =over 4 |
730 | =over 4 |
|
|
731 | |
|
|
732 | =item C<MAKE> |
|
|
733 | |
|
|
734 | The make command to use - default is C<make>. |
719 | |
735 | |
720 | =item C<MKBUNDLE> |
736 | =item C<MKBUNDLE> |
721 | |
737 | |
722 | Where F<staticperl> writes the C<mkbundle> command to |
738 | Where F<staticperl> writes the C<mkbundle> command to |
723 | (default: F<$STATICPERL/mkbundle>). |
739 | (default: F<$STATICPERL/mkbundle>). |
… | |
… | |
1051 | PERL_CONFIGURE="$PERL_CONFIGURE -U$sym" |
1067 | PERL_CONFIGURE="$PERL_CONFIGURE -U$sym" |
1052 | done |
1068 | done |
1053 | } |
1069 | } |
1054 | |
1070 | |
1055 | This mostly gains space when linking staticaly, as the functions will |
1071 | This mostly gains space when linking staticaly, as the functions will |
1056 | liekly not be linked in. The gain for dynamically-linked binaries is |
1072 | likely not be linked in. The gain for dynamically-linked binaries is |
1057 | smaller. |
1073 | smaller. |
1058 | |
1074 | |
1059 | Also, this leaves C<gethostbyname> in - not only is it actually used |
1075 | Also, this leaves C<gethostbyname> in - not only is it actually used |
1060 | often, the L<Socket> module also exposes it, so leaving it out usually |
1076 | often, the L<Socket> module also exposes it, so leaving it out usually |
1061 | gains little. Why Socket exposes a C function that is in the core already |
1077 | gains little. Why Socket exposes a C function that is in the core already |