First stab at rather shaky Configure support for relocatable @INC.
Nicholas Clark [Mon, 13 Mar 2006 20:49:55 +0000 (20:49 +0000)]
Seems to be installing rather more that it's supposed to be.

p4raw-id: //depot/perl@27490

Configure
configpm

index 6326ffe..56a05f9 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -5993,6 +5993,49 @@ eval "${prefixvar}exp=\"\$ansexp\""
 . ./installprefix
 EOSC
 
+: determine where public executables go
+echo " "
+set dflt bin bin
+eval $prefixit
+fn=d~
+rp='Pathname where the public executables will reside?'
+. ./getfile
+if $test "X$ansexp" != "X$binexp"; then
+       installbin=''
+fi
+prefixvar=bin
+: XXX Bug? -- ignores Configure -Dinstallprefix setting.
+. ./setprefixvar
+
+case "$userelocatableinc" in
+$define|true|[yY]*)    dflt='y';;
+*) dflt='n';;
+esac
+cat <<EOM
+
+Would you like to build Perl so that the installation is relocatable, so that
+library paths in @INC are determined relative to the path of the perl binary?
+This is not advised for system Perl installs, or if you need to run setid
+scripts or scripts under taint mode.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+rp='Use relocatable @INC?'
+. ./myread
+case "$ans" in
+y|Y)   val="$define" ;;     
+*)      val="$undef" ;;
+esac
+set userelocatableinc
+eval $setvar
+
+: Default prefix is now "up one level from where the binaries are"
+case "$userelocatableinc" in
+$define|true|[yY]*) prefix=".../.."
+                   prefixexp=".../..";;
+esac
+
+
 : determine where private library files go
 : Usual default is /usr/local/lib/perl5/$version.
 : Also allow things like /opt/perl/lib/$version, since 
@@ -6729,20 +6772,6 @@ EOM
        ;;
 esac
 
-: determine where public executables go
-echo " "
-set dflt bin bin
-eval $prefixit
-fn=d~
-rp='Pathname where the public executables will reside?'
-. ./getfile
-if $test "X$ansexp" != "X$binexp"; then
-       installbin=''
-fi
-prefixvar=bin
-: XXX Bug? -- ignores Configure -Dinstallprefix setting.
-. ./setprefixvar
-
 echo " "
 case "$extras" in
 '') dflt='n';;
@@ -8946,11 +8975,6 @@ EOCP
        ;;
 esac
 
-# probably will refer to
-#   $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
-need_relocation=0
-userelocatableinc=undef
-
 case "$vendorprefix" in
 '')    d_vendorbin="$undef"
        vendorbin=''
index ccf7816..de4a694 100755 (executable)
--- a/configpm
+++ b/configpm
@@ -298,13 +298,34 @@ EOT
 my @need_relocation;
 
 if (fetch_string({},'userelocatableinc')) {
-    foreach my $what (qw(archlibexp
+    foreach my $what (qw(prefixexp
+
+                        archlibexp
+                        html1direxp
+                        html3direxp
+                        man1direxp
+                        man3direxp
                         privlibexp
+                        scriptdirexp
                         sitearchexp
+                        sitebinexp
+                        sitehtml1direxp
+                        sitehtml3direxp
                         sitelibexp
-                        sitelib_stem
+                        siteman1direxp
+                        siteman3direxp
+                        sitescriptexp
                         vendorarchexp
+                        vendorbinexp
+                        vendorhtml1direxp
+                        vendorhtml3direxp
                         vendorlibexp
+                        vendorman1direxp
+                        vendorman3direxp
+                        vendorscriptexp
+
+                        siteprefixexp
+                        sitelib_stem
                         vendorlib_stem)) {
        push @need_relocation, $what if fetch_string({}, $what) =~ m!^\.\.\./!;
     }