Quantcast
Channel: perl.dist
Viewing all articles
Browse latest Browse all 80

Making perl location-independent. by Alan Burlison

$
0
0
Another thing that has always bugged me is not being able to relocate perl
without rebuilding it, even if the package that perl itself is delivered
in is relocatable.

As far as I can remember the things that would have to be fixed are:

1. Fixing up Config.pm if perl is moved.
2. locating libperl.so if perl is moved.
3. Fixing up @INC if perl is moved.

Are there any other issues?

#2 can be done on Solaris by specifying the location of libperl relative
to the executable, using the $ORIGIN linker magic, eg assuming perl is in
..../bin and libperl is in .../lib/sun4-solaris-64int/CORE:
cc -o perl ... -R '$ORIGIN/../lib/sun4-solaris-64int/CORE' ...
and #3 can be done by using getexecname() and realpath() to locate where
the executable is. However I'm not sure of how this would translate onto
other platforms.

--
Alan Burlison
--
$ head -1 /dev/bollocks
drive out-of-the-box clicks-and-mortar brand recognition

Viewing all articles
Browse latest Browse all 80

Trending Articles