develooper Front page | perl.perl5.porters | Postings from December 2008

5.10.0 "Configure" improvement for 'userelocatableinc' on Solaris 10

Thread Next
From:
Luc St-Louis
Date:
December 3, 2008 10:53
Subject:
5.10.0 "Configure" improvement for 'userelocatableinc' on Solaris 10
Message ID:
20081203010711.GA7711@monk
The 'userelocatableinc' option works incorrectly on Solaris 10 (and
earlier, presumably).  The problem is that the path to the executable
cannot be obtained like on Linux ('/proc/self/exe') or on BSD
('/proc/curproc/file').  But, as suggested by 'almut' on perlmonks
(http://www.perlmonks.org/?node_id=686876).  it can be obtained with
'/proc/self/path/a.out'.  So the solution (tested and working) is to
have in Configure (currently, around line 15563) something like the
following "if ... fi" snippet added, for Solaris 10:

    procselfexe=''
    val="$undef"
    case "$d_readlink" in
    "$define")
        ...
        if $issymlink /proc/self/path/a.out ; then
            $ls -l /proc/self/path/a.out > reflect
            if $contains /`basename $ls` reflect >/dev/null 2>&1; then
                echo "You have Solaris-like /proc/self/path/a.out."
                procselfexe='"/proc/self/path/a.out"'
                val="$define"
            fi
        fi
        ...

I think this also makes $^X return a correct path instead of just
'perl' (I'm not at the office right now, and I forgot to test that).

The technique does not work on Solaris 8, because apparently it does not
support the '/proc/self/path/a.out' mechanism (according to 'almut'). I
don't know about other versions.

Thanks.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About