develooper Front page | perl.perl5.porters | Postings from March 2007

single file relocatable perl distribution

Thread Next
Nicholas Clark
March 4, 2007 15:13
single file relocatable perl distribution
Message ID:
I'm experimenting with making single file perl distributions

$ ls -l perl
-rwxr-xr-x  1 nick  nick  21577960 Mar  4 23:03 perl
$ ldd perl
perl: => /lib/ (0x286e6000) => /lib/ (0x286f7000) => /lib/ (0x2870d000) => /lib/ (0x28726000) => /lib/ (0x28733000)
$ file perl
perl: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked (uses shared libs), not stripped

Note, this is a single file with all libraries staticly linked in, with
a zip file of all of the libraries appended. It doesn't create or need any
temporary files.

If you have x86 FreeBSD and want to play you can get it here:

I had to tweak slightly:

---	Sun Mar  4 22:25:23 2007
+++	Sun Mar  4 23:02:24 2007
@@ -34,7 +34,7 @@
     if (File::Spec->can("rel2abs")) {
         for my $inc (@INC) {
-            $inc = File::Spec->rel2abs($inc);
+            $inc = File::Spec->rel2abs($inc) unless ref $inc;

Unfortunately even with that it won't build modules, because
ExtUtils::MakeMaker writes Makefiles that have a dependency on

make: don't know how to make /export/home/nwc10/lib/perl5/5.9.5/i386-freebsd/ Stop
  /usr/bin/make -- NOT OK

I'm not sure what to do about that. But yes, it does run the CPAN shell.


(hence the question about xsinit, as ex::lib::zip needs to fiddle with @INC
before perl_run)

Nicholas Clark

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About