| 1 |
?RCS: $Id: perl5.U,v $ |
| 2 |
?RCS: |
| 3 |
?RCS: Copyright (c) 2000 Andrew Dougherty |
| 4 |
?RCS: |
| 5 |
?RCS: You may distribute under the terms of either the GNU General Public |
| 6 |
?RCS: License or the Artistic License, as specified in the README file. |
| 7 |
?RCS: |
| 8 |
?RCS: $Log: perl5.U,v $ |
| 9 |
?RCS: |
| 10 |
?X: |
| 11 |
?X: The purpose of this unit is to locate a previously installed |
| 12 |
?X: version of perl5 suitable for running inc_version_list.U. |
| 13 |
?X: We check for 5.005 and later because inc_version_list is |
| 14 |
?X: irrelevant for earlier versions. |
| 15 |
?X: |
| 16 |
?MAKE:perl5: path_sep binexp test sed exe_ext |
| 17 |
?MAKE: -pick add $@ %< |
| 18 |
?Y:TOP |
| 19 |
?S:perl5: |
| 20 |
?S: This variable contains the full path (if any) to a previously |
| 21 |
?S: installed perl5.005 or later suitable for running the script |
| 22 |
?S: to determine inc_version_list. |
| 23 |
?S:. |
| 24 |
?T: tdir |
| 25 |
: Find perl5.005 or later. |
| 26 |
echo "Looking for a previously installed perl5.005 or later... " |
| 27 |
case "$perl5" in |
| 28 |
'') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do |
| 29 |
: Check if this perl is recent and can load a simple module |
| 30 |
if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then |
| 31 |
perl5=$tdir/perl |
| 32 |
break; |
| 33 |
elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then |
| 34 |
perl5=$tdir/perl5 |
| 35 |
break; |
| 36 |
fi |
| 37 |
done |
| 38 |
;; |
| 39 |
*) perl5="$perl5" |
| 40 |
;; |
| 41 |
esac |
| 42 |
case "$perl5" in |
| 43 |
'') echo "None found. That's ok.";; |
| 44 |
*) echo "Using $perl5." ;; |
| 45 |
esac |
| 46 |
|