This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backport #28202 and #28263
authorH.Merijn Brand <h.m.brand@xs4all.nl>
Mon, 22 May 2006 17:19:19 +0000 (17:19 +0000)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Mon, 22 May 2006 17:19:19 +0000 (17:19 +0000)
28263 Oops. Fix bad #! lines when not using userelocatableinc
28202 Take advantage of the bug that binexp ignores the Configure

p4raw-id: //depot/metaconfig@28282

U/installdirs/bin.U
U/perl/perlpath.U
U/perl/startperl.U

index d591ebe..d34159d 100644 (file)
@@ -99,6 +99,8 @@ if $test "X$ansexp" != "X$binexp"; then
 fi
 prefixvar=bin
 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
+: XXX If this is fixed, also fix the "start perl" hunk below, which relies on
+:     this via initialinstalllocation
 . ./setprefixvar
 
 case "$userelocatableinc" in
@@ -123,10 +125,10 @@ esac
 set userelocatableinc
 eval $setvar
 
+initialinstalllocation="$binexp"
 : Default prefix is now "up one level from where the binaries are"
 case "$userelocatableinc" in
 $define|true|[yY]*)
-    initialinstalllocation="$binexp"
     bin=".../"
     binexp=".../"
     prefix=".../.."
index f4e5256..402ac56 100644 (file)
@@ -1,11 +1,11 @@
 ?RCS: $Id: perlpath.U,v 3.0.1.2 1995/09/25 09:17:04 ram Exp $
 ?RCS:
 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
-?RCS: 
+?RCS:
 ?RCS: This file is included with or a derivative work of a file included
 ?RCS: with the metaconfig program of Raphael Manfredi's "dist" distribution.
 ?RCS: In accordance with clause 7 of dist's modified Artistic License:
-?RCS: 
+?RCS:
 ?RCS:     You may distribute under the terms of either the GNU General Public
 ?RCS:     License or the Artistic License, as specified in the README file.
 ?RCS:
@@ -25,8 +25,8 @@
 ?X:
 ?X: The purpose of this unit is to locate perl good enough to construct a #!
 ?X:
-?MAKE:perlpath: cat Getfile Loc Myread Oldconfig binexp startperl \
-       version versiononly
+?MAKE:perlpath: cat Getfile Loc Myread Oldconfig initialinstalllocation \
+       startperl version versiononly
 ?MAKE: -pick add $@ %<
 ?Y:TOP
 ?S:perlpath:
@@ -50,8 +50,8 @@
 case "$perlpath" in
 '')
        case "$versiononly" in
-       "$define")      perlpath="$binexp/perl$version";;
-       *)              perlpath="$binexp/perl";;
+       "$define")      perlpath="$initialinstalllocation/perl$version";;
+       *)              perlpath="$initialinstalllocation/perl";;
        esac
        case "$startperl" in
        *!*) ;;
@@ -61,10 +61,10 @@ case "$perlpath" in
 I will use the "eval 'exec'" idiom to start Perl on your system.
 I can use the full path of your Perl binary for this purpose, but
 doing so may cause problems if you want to share those scripts and
-Perl is not always in a standard place ($binexp/perl).
+Perl is not always in a standard place ($initialinstalllocation/perl).
 
 EOH
-               dflt="$binexp/perl"
+               dflt="$initialinstalllocation/perl"
                rp="What path shall I use in \"eval 'exec'\"?"
                . ./myread
                perlpath="$ans"
index 363683d..9c1ad0e 100644 (file)
@@ -1,11 +1,11 @@
 ?RCS: $Id: startperl.U,v 3.0 1993/08/18 12:09:50 ram Exp $
 ?RCS:
 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
-?RCS: 
+?RCS:
 ?RCS: This file is included with or a derivative work of a file included
 ?RCS: with the metaconfig program of Raphael Manfredi's "dist" distribution.
 ?RCS: In accordance with clause 7 of dist's modified Artistic License:
-?RCS: 
+?RCS:
 ?RCS:     You may distribute under the terms of either the GNU General Public
 ?RCS:     License or the Artistic License, as specified in the README file.
 ?RCS:
@@ -15,7 +15,8 @@
 ?RCS: Revision 3.0  1993/08/18  12:09:50  ram
 ?RCS: Baseline for dist 3.0 netwide release.
 ?RCS:
-?MAKE:startperl: cat Myread sharpbang binexp test versiononly version
+?MAKE:startperl: cat Myread sharpbang initialinstalllocation test \
+       versiononly version
 ?MAKE: -pick add $@ %<
 ?Y:TOP
 ?X: This is different from dist's standard startperl.U unit because
@@ -39,6 +40,9 @@
 ?H:#define STARTPERL "$startperl"              /**/
 ?H:.
 : figure out how to guarantee perl startup
+: XXX Note that this currently takes advantage of the bug that binexp ignores
+:     the Configure -Dinstallprefix setting, which in turn means that under
+:     relocatable @INC, initialinstalllocation is what binexp started as.
 case "$startperl" in
 '')
        case "$sharpbang" in
@@ -48,13 +52,13 @@ case "$startperl" in
 I can use the #! construct to start perl on your system. This will
 make startup of perl scripts faster, but may cause problems if you
 want to share those scripts and perl is not in a standard place
-($binexp/perl) on all your platforms. The alternative is to force
-a shell by starting the script with a single ':' character.
+($initialinstalllocation/perl) on all your platforms. The alternative
+is to force a shell by starting the script with a single ':' character.
 
 EOH
                case "$versiononly" in
-               "$define")      dflt="$binexp/perl$version";;  
-               *)              dflt="$binexp/perl";;
+               "$define")      dflt="$initialinstalllocation/perl$version";;
+               *)              dflt="$initialinstalllocation/perl";;
                esac
                rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
                . ./myread