in reply to Re: Relocatable Perl 5.10.0 on Solaris
in thread Relocatable Perl 5.10.0 on Solaris

I think Unixish operating systems have a problem with determining the directory where an executable lives in and hence it's not really supported for a program to find out the directory it is living in to determine the place of library directories in relation to that path.

...but I think that's how it's meant to work, if I'm reading the docs correctly (from perl5100delta.pod):

Relocatable installations

There is now Configure support for creating a relocatable perl tree. If you Configure with -Duserelocatableinc, then the paths in @INC (and everything else in %Config) can be optionally located via the path of the perl executable.

That means that, if the string ".../" is found at the start of any path, it's substituted with the directory of $^X. So, the relocation can be configured on a per-directory basis, although the default with -Duserelocatableinc is that everything is relocated. The initial install is done to the original configured prefix.

So, I'd say the OP's expectations are at least somewhat legitimate :)

Replies are listed 'Best First'.
Re^3: Relocatable Perl 5.10.0 on Solaris
by Corion (Patriarch) on May 16, 2008 at 10:08 UTC

    Ah hah - so maybe the issue is that the Solaris @INC does not contain .../ but ./../, at least to what the OP showed us. So either the Perl was configured wrong or the configure process went wrong somewhere. Maybe patching the resulting binary is the easiest way out, as the string only decreases in length which can easily be fixed by zero padding it at the end.

      Alas, no - I checked using a hex editor, and both binaries definitely contain .../../lib. So the problem appears to be a runtime one, not at configure/build.

      This is why I was hoping it was a library problem :(.

      Regards,
      CK.

        Maybe look at what $^X is on the Solaris machine - if it always lacks a path, likely the magic that turns ... into <c>/home/ck/myperl/bin/

        cannot use that value as the path.