… | |
… | |
118 | THE STATICPERL SCRIPT |
118 | THE STATICPERL SCRIPT |
119 | This module installs a script called staticperl into your perl binary |
119 | This module installs a script called staticperl into your perl binary |
120 | directory. The script is fully self-contained, and can be used without |
120 | directory. The script is fully self-contained, and can be used without |
121 | perl (for example, in an uClibc chroot environment). In fact, it can be |
121 | perl (for example, in an uClibc chroot environment). In fact, it can be |
122 | extracted from the "App::Staticperl" distribution tarball as |
122 | extracted from the "App::Staticperl" distribution tarball as |
123 | bin/staticperl, without any installation. |
123 | bin/staticperl, without any installation. The newest (possibly alpha) |
|
|
124 | version can also be downloaded from |
|
|
125 | <http://staticperl.schmorp.de/staticperl>. |
124 | |
126 | |
125 | staticperl interprets the first argument as a command to execute, |
127 | staticperl interprets the first argument as a command to execute, |
126 | optionally followed by any parameters. |
128 | optionally followed by any parameters. |
127 | |
129 | |
128 | There are two command categories: the "phase 1" commands which deal with |
130 | There are two command categories: the "phase 1" commands which deal with |
… | |
… | |
137 | |
139 | |
138 | The command |
140 | The command |
139 | |
141 | |
140 | staticperl install |
142 | staticperl install |
141 | |
143 | |
142 | Is normally all you need: It installs the perl interpreter in |
144 | is normally all you need: It installs the perl interpreter in |
143 | ~/.staticperl/perl. It downloads, configures, builds and installs the |
145 | ~/.staticperl/perl. It downloads, configures, builds and installs the |
144 | perl interpreter if required. |
146 | perl interpreter if required. |
145 | |
147 | |
146 | Most of the following commands simply run one or more steps of this |
148 | Most of the following staticperl subcommands simply run one or more |
147 | sequence. |
149 | steps of this sequence. |
|
|
150 | |
|
|
151 | If it fails, then most commonly because the compiler options I selected |
|
|
152 | are not supported by your compiler - either edit the staticperl script |
|
|
153 | yourself or create ~/.staticperl shell script where your set working |
|
|
154 | "PERL_CCFLAGS" etc. variables. |
148 | |
155 | |
149 | To force recompilation or reinstallation, you need to run staticperl |
156 | To force recompilation or reinstallation, you need to run staticperl |
150 | distclean first. |
157 | distclean first. |
151 | |
158 | |
152 | staticperl version |
159 | staticperl version |
… | |
… | |
193 | them that you want to have built. |
200 | them that you want to have built. |
194 | |
201 | |
195 | staticperl clean |
202 | staticperl clean |
196 | Deletes the perl source directory (and potentially cleans up other |
203 | Deletes the perl source directory (and potentially cleans up other |
197 | intermediate files). This can be used to clean up files only needed |
204 | intermediate files). This can be used to clean up files only needed |
198 | for building perl, without removing the installed perl interpreter, |
205 | for building perl, without removing the installed perl interpreter. |
199 | or to force a re-build from scratch. |
|
|
200 | |
206 | |
201 | At the moment, it doesn't delete downloaded tarballs. |
207 | At the moment, it doesn't delete downloaded tarballs. |
|
|
208 | |
|
|
209 | The exact semantics of this command will probably change. |
202 | |
210 | |
203 | staticperl distclean |
211 | staticperl distclean |
204 | This wipes your complete ~/.staticperl directory. Be careful with |
212 | This wipes your complete ~/.staticperl directory. Be careful with |
205 | this, it nukes your perl download, perl sources, perl distribution |
213 | this, it nukes your perl download, perl sources, perl distribution |
206 | and any installed modules. It is useful if you wish to start over |
214 | and any installed modules. It is useful if you wish to start over |
… | |
… | |
637 | |
645 | |
638 | More commonly, you would either activate 64 bit integer support |
646 | More commonly, you would either activate 64 bit integer support |
639 | ("-Duse64bitint"), or disable large files support (-Uuselargefiles), |
647 | ("-Duse64bitint"), or disable large files support (-Uuselargefiles), |
640 | to reduce filesize further. |
648 | to reduce filesize further. |
641 | |
649 | |
642 | "PERL_CPPFLAGS", "PERL_OPTIMIZE", "PERL_LDFLAGS", "PERL_LIBS" |
650 | "PERL_CC", "PERL_CCFLAGS", "PERL_OPTIMIZE", "PERL_LDFLAGS", "PERL_LIBS" |
643 | These flags are passed to perl's Configure script, and are generally |
651 | These flags are passed to perl's Configure script, and are generally |
644 | optimised for small size (at the cost of performance). Since they |
652 | optimised for small size (at the cost of performance). Since they |
645 | also contain subtle workarounds around various build issues, |
653 | also contain subtle workarounds around various build issues, |
646 | changing these usually requires understanding their default values - |
654 | changing these usually requires understanding their default values - |
647 | best look at the top of the staticperl script for more info on |
655 | best look at the top of the staticperl script for more info on |
648 | these. |
656 | these, and use a ~/.staticperlrc to override them. |
|
|
657 | |
|
|
658 | Most of the variables override (or modify) the corresponding |
|
|
659 | Configure variable, except "PERL_CCFLAGS", which gets appended. |
649 | |
660 | |
650 | Variables you probably *do not want* to override |
661 | Variables you probably *do not want* to override |
|
|
662 | "MAKE" |
|
|
663 | The make command to use - default is "make". |
|
|
664 | |
651 | "MKBUNDLE" |
665 | "MKBUNDLE" |
652 | Where staticperl writes the "mkbundle" command to (default: |
666 | Where staticperl writes the "mkbundle" command to (default: |
653 | $STATICPERL/mkbundle). |
667 | $STATICPERL/mkbundle). |
654 | |
668 | |
655 | "STATICPERL_MODULES" |
669 | "STATICPERL_MODULES" |
… | |
… | |
932 | PERL_CONFIGURE="$PERL_CONFIGURE -U$sym" |
946 | PERL_CONFIGURE="$PERL_CONFIGURE -U$sym" |
933 | done |
947 | done |
934 | } |
948 | } |
935 | |
949 | |
936 | This mostly gains space when linking staticaly, as the functions |
950 | This mostly gains space when linking staticaly, as the functions |
937 | will liekly not be linked in. The gain for dynamically-linked |
951 | will likely not be linked in. The gain for dynamically-linked |
938 | binaries is smaller. |
952 | binaries is smaller. |
939 | |
953 | |
940 | Also, this leaves "gethostbyname" in - not only is it actually used |
954 | Also, this leaves "gethostbyname" in - not only is it actually used |
941 | often, the Socket module also exposes it, so leaving it out usually |
955 | often, the Socket module also exposes it, so leaving it out usually |
942 | gains little. Why Socket exposes a C function that is in the core |
956 | gains little. Why Socket exposes a C function that is in the core |