ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/README
(Generate patch)

Comparing App-Staticperl/README (file contents):
Revision 1.6 by root, Tue Dec 7 21:22:12 2010 UTC vs.
Revision 1.7 by root, Wed Dec 8 22:27:35 2010 UTC

12 staticperl cpan # invoke CPAN shell 12 staticperl cpan # invoke CPAN shell
13 staticperl instmod path... # install unpacked modules 13 staticperl instmod path... # install unpacked modules
14 staticperl instcpan modulename... # install modules from CPAN 14 staticperl instcpan modulename... # install modules from CPAN
15 staticperl mkbundle <bundle-args...> # see documentation 15 staticperl mkbundle <bundle-args...> # see documentation
16 staticperl mkperl <bundle-args...> # see documentation 16 staticperl mkperl <bundle-args...> # see documentation
17 staticperl mkapp appname <bundle-args...> # see documentation
17 18
18 Typical Examples: 19 Typical Examples:
19 20
20 staticperl install # fetch, configure, build and install perl 21 staticperl install # fetch, configure, build and install perl
21 staticperl cpan # run interactive cpan shell 22 staticperl cpan # run interactive cpan shell
22 staticperl mkperl -M '"Config_heavy.pl"' # build a perl that supports -V 23 staticperl mkperl -M '"Config_heavy.pl"' # build a perl that supports -V
23 staticperl mkperl -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI -MURI::http 24 staticperl mkperl -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI -MURI::http
24 # build a perl with the above modules linked in 25 # build a perl with the above modules linked in
26 staticperl mkapp myapp --boot mainprog mymodules
27 # build a binary "myapp" from mainprog and mymodules
25 28
26DESCRIPTION 29DESCRIPTION
27 This script helps you creating single-file perl interpreters, or 30 This script helps you creating single-file perl interpreters, or
28 embedding a perl interpreter in your applications. Single-file means 31 embedding a perl interpreter in your applications. Single-file means
29 that it is fully self-contained - no separate shared objects, no 32 that it is fully self-contained - no separate shared objects, no
225 AnyEvent::HTTPD) implements various URI schemes as extra modules - since 228 AnyEvent::HTTPD) implements various URI schemes as extra modules - since
226 AnyEvent::HTTPD only needs "http" URIs, we only need to include that 229 AnyEvent::HTTPD only needs "http" URIs, we only need to include that
227 module. I found out about these dependencies by carefully watching any 230 module. I found out about these dependencies by carefully watching any
228 error messages about missing modules... 231 error messages about missing modules...
229 232
233 Instead of building a new perl binary, you can also build a standalone
234 application:
235
236 # build the app
237 staticperl mkapp app --boot eg/httpd \
238 -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI::http
239
240 # run it
241 ./app
242
230 OPTION PROCESSING 243 OPTION PROCESSING
231 All options can be given as arguments on the command line (typically 244 All options can be given as arguments on the command line (typically
232 using long (e.g. "--verbose") or short option (e.g. "-v") style). Since 245 using long (e.g. "--verbose") or short option (e.g. "-v") style). Since
233 specifying a lot of modules can make the command line very cumbersome, 246 specifying a lot of modules can make the command line very cumbersome,
234 you can put all long options into a "bundle specification file" (with or 247 you can put all long options into a "bundle specification file" (with or
284 This switch is automatically used when staticperl is invoked with 297 This switch is automatically used when staticperl is invoked with
285 the "mkperl" command (instead of "mkbundle"): 298 the "mkperl" command (instead of "mkbundle"):
286 299
287 # build a new ./perl with only common::sense in it - very small :) 300 # build a new ./perl with only common::sense in it - very small :)
288 staticperl mkperl -Mcommon::sense 301 staticperl mkperl -Mcommon::sense
302
303 --app name
304 After writing out the bundle files, try to link a new standalone
305 program. It will be called "name", and the bundle files get removed
306 after linking it.
307
308 The difference to the (mutually exclusive) "--perl" option is that
309 the binary created by this option will not try to act as a perl
310 interpreter - instead it will simply initialise the perl
311 interpreter, clean it up and exit.
312
313 This switch is automatically used when staticperl is invoked with
314 the "mkapp" command (instead of "mkbundle"):
315
316 To let it do something useful you *must* add some boot code, e.g.
317 with the "--boot" option.
318
319 Example: create a standalone perl binary that will execute appfile
320 when it is started.
321
322 staticperl mkbundle --app myexe --boot appfile
289 323
290 --use module | -Mmodule 324 --use module | -Mmodule
291 Include the named module and all direct dependencies. This is done 325 Include the named module and all direct dependencies. This is done
292 by "require"'ing the module in a subprocess and tracing which other 326 by "require"'ing the module in a subprocess and tracing which other
293 modules and files it actually loads. If the module uses AutoLoader, 327 modules and files it actually loads. If the module uses AutoLoader,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines