perl

 view release on metacpan or  search on metacpan

Configure  view on Meta::CPAN

siteprefix="$ans"
siteprefixexp="$ansexp"

: determine where site specific libraries go.
: Usual default is /usr/local/lib/perl5/site_perl/$version
: The default "style" setting is made in installstyle.U
: XXX No longer works with Prefixit stuff.
prog=`echo $package | $sed 's/-*[0-9.]*$//'`
case "$sitelib" in
'') case "$installstyle" in
	*lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
	*)	 dflt=$siteprefix/lib/site_$prog/$version ;;
	esac
	;;
*)	dflt="$sitelib"
	;;
esac
$cat <<EOM

The installation process will create a directory for
site-specific extensions and modules.  Most users find it convenient
to place all site-specific files in this directory rather than in the
main distribution directory.

EOM
fn=d~+
rp='Pathname for the site-specific library files?'
. ./getfile
prefixvar=sitelib
. ./setprefixvar
sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`

: Determine list of previous versions to include in @INC
$cat > getverlist <<EOPL
#!$perl5
use strict;
use warnings;
use File::Basename;
my \$api_versionstring = "$api_versionstring";
my \$version = "$version";
my \$stem = "$sitelib_stem";
my \$archname = "$archname";
EOPL
	$cat >> getverlist <<'EOPL'
# The list found is stored twice for each entry: the original name, and
# the binary broken down version into pack "s>s>s>", so sorting is easy
# and unambiguous.  This will work for all versions that have a maximum
# of three digit per group separate by '.'s or '_'s. Names are extended
# with ".0.0" to ensure at least three elements for the pack.
#                                   -- H.Merijn Brand (m)'06 23-10-2006
# pack "s>" was introduced in perl-5.10, so I had to rewrite this to an
# sprintf approach to support bases systems with 5.6.x and 5.8.x
#                                   -- H.Merijn Brand (m)'25 16-05-2025

my @inc_version_list;
my @candidates;
# XXX Redo to do opendir/readdir?
if (-d $stem) {
    chdir($stem);
    ;@candidates = map {
	[ $_, sprintf "%04d%04d%04d", (split m/[._]/, "$_.0.0")[0,1,2] ] } glob("5.*");
    ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
}
else {
    ;@candidates = ();
}

my ($pversion, $aversion, $vsn5005) = map {
    sprintf "%04d%04d%04d", (split m/[._]/, "$_.0.0")[0,1,2] } $version, $api_versionstring, "5.005";
foreach my $d (@candidates) {
    if ($d->[1] lt $pversion) {
	if ($d->[1] ge $aversion) {
	    unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
	}
	elsif ($d->[1] ge $vsn5005) {
	    unshift(@inc_version_list, grep { -d } $d->[0]);
	}
    }
    else {
	# Skip newer version.  I.e. don't look in
	# 5.7.0 if we're installing 5.6.1.
    }
}

if (@inc_version_list) {
    print join(' ', @inc_version_list);
}
else {
    # Blank space to preserve value for next Configure run.
    print " ";
}
EOPL
chmod +x getverlist
case "$inc_version_list" in
'')	if test -x "$perl5$exe_ext"; then
		dflt=`$perl5 getverlist`
	else
		dflt='none'
	fi
	;;
$undef) dflt='none' ;;
*)  eval dflt=\"$inc_version_list\" ;;
esac
case "$dflt" in
''|' ') dflt=none ;;
esac
case "$dflt" in
5.005) dflt=none ;;
esac
$cat <<EOM

In order to ease the process of upgrading, this version of perl
can be configured to use modules built and installed with earlier
versions of perl that were installed under $prefix.  Specify here
the list of earlier versions that this version of perl should check.
If Configure detected no earlier versions of perl installed under
$prefix, then the list will be empty.  Answer 'none' to tell perl
to not search earlier versions.

The default should almost always be sensible, so if you're not sure,
just accept the default.
EOM

rp='List of earlier versions to include in @INC?'
. ./myread
case "$ans" in
[Nn]one|''|' '|$undef) inc_version_list=' ' ;;
*) inc_version_list="$ans" ;;
esac



( run in 0.698 second using v1.01-cache-2.11-cpan-71847e10f99 )