Also sprach Alan Stewart:
I hate to be argumentative, especially when I may be dead wrong, but
just because you found those strings somewhere in perl, doesn't say
how or when they are used.
Now this discussion is getting surreal. Once and for all, you are dead
wrong.
From config.h of my recently compiled 5.8.4:
/* ARCHLIB:
* This variable, if defined, holds the name of the directory in
* which the user wants to put architecture-dependent public
* library files for perl5. It is most often a local directory
* such as /usr/local/lib. Programs using this variable must be
* prepared to deal with filename expansion. If ARCHLIB is the
* same as PRIVLIB, it is not defined, since presumably the
* program already searches PRIVLIB.
*/
/* ARCHLIB_EXP:
* This symbol contains the ~name expanded version of ARCHLIB, to be used
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
#define ARCHLIB "/usr/opt/perldb/lib/5.8.4/i686-linux" /**/
#define ARCHLIB_EXP "/usr/opt/perldb/lib/5.8.4/i686-linux" /**/
.....
/* PRIVLIB:
* This symbol contains the name of the private library for this package.
* The library is private in the sense that it needn't be in anyone's
* execution path, but it should be accessible by the world. The program
* should be prepared to do ~ expansion.
*/
/* PRIVLIB_EXP:
* This symbol contains the ~name expanded version of PRIVLIB, to be used
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
#define PRIVLIB "/usr/opt/perldb/lib/5.8.4" /**/
#define PRIVLIB_EXP "/usr/opt/perldb/lib/5.8.4" /**/
[ and so on ]
And now from perl.c:
#else
#ifndef PRIVLIB_EXP
# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
#endif
#if defined(WIN32)
incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE);
#else
incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE);
#endif
#ifdef SITEARCH_EXP
/* sitearch is always relative to sitelib on Windows for
* DLL-based path intuition to work correctly */
# if !defined(WIN32)
incpush(SITEARCH_EXP, FALSE, FALSE, TRUE);
# endif
#endif
#ifdef SITELIB_EXP
# if defined(WIN32)
/* this picks up sitearch as well */
incpush(SITELIB_EXP, TRUE, FALSE, TRUE);
# else
incpush(SITELIB_EXP, FALSE, FALSE, TRUE);
# endif
#endif
#ifdef SITELIB_STEM /* Search for version-specific dirs below here */
incpush(SITELIB_STEM, FALSE, TRUE, TRUE);
#endif
where incpush() is S_incpush which eventually does after some checks and
transformations:
/* finally push this lib directory on the end of @INC */
av_push(GvAVn(PL_incgv), libdir);
Do you have an example of perl (and libperl.so) being relocated and
still using the same installed perl paths and modules? If these things
are hard-coded in, that should be possible.
Why an example? It's all in the source. Besides, that's how Perl
behaves.
ethan:/usr/opt# ls -l
total 32
drwxr-xr-x 5 root root 4096 Oct 14 2003 perl-5.8.1
drwxr-xr-x 5 root root 4096 Dec 11 2003 perl-maint
drwxr-xr-x 5 root root 4096 Sep 2 2003 perl5.5.3
drwxr-xr-x 5 root root 4096 Dec 9 2003 perl5.6.0
drwxr-xr-x 5 root root 4096 Mar 20 2003 perl5.6.1
drwxr-xr-x 5 root root 4096 Nov 14 2003 perl5.8.2
drwxr-xr-x 5 root root 4096 Aug 6 2003 perl_autobox
drwxr-xr-x 4 root root 4096 Jun 17 05:34 perldb
ethan:/usr/opt# perl5.6.1/bin/perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
...
ethan:/usr/opt# mv perl5.6.1/ perl5.6.1_
ethan:/usr/opt# perl5.6.1_/bin/perl -V
Can't locate Config.pm in @INC (@INC contains:
/usr/opt/perl5.6.1/lib/5.6.1/i686-linux /usr/opt/perl5.6.1/lib/5.6.1
/usr/opt/perl5.6.1/lib/site_perl/5.6.1/i686-linux
/usr/opt/perl5.6.1/lib/site_perl/5.6.1
/usr/opt/perl5.6.1/lib/site_perl .).
BEGIN failed--compilation aborted.
Tassilo