This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add NV_PRESERVES_UV.
[metaconfig.git] / U / installdirs / inc_version_list.U
CommitLineData
edd6115f
JH
1?RCS: $Id: inc_version_list.U,v $
2?RCS:
3?RCS: Copyright (c) 2000 Andy Dougherty
4?RCS:
5?RCS: You may redistribute only under the terms of the Artistic Licence,
6?RCS: as specified in the README file that comes with the distribution.
7?RCS: You may reuse parts of this distribution only within the terms of
8?RCS: that same Artistic Licence; a copy of which may be found at the root
9?RCS: of the source tree for dist 3.0.
10?RCS:
11?RCS: $Log: inc_version_list.U,v $
12?RCS:
13?MAKE:inc_version_list : cat sed Getfile perl version api_versionstring \
14 rm Myread archname prefix sitelib
15?MAKE: -pick add $@ %<
16?Y:TOP
17?S:inc_version_list:
18?S: This variable specifies the list of subdirectories in over
19?S: which perl.c:incpush() and lib/lib.pm will automatically
20?S: search when adding directories to @INC. This is only useful
21?S: if you have a perl library directory tree structured like the
22?S: default one. See INSTALL for how this works. The versioned
23?S: site_perl directory was introduced in 5.005, so that is the
24?S: lowest possible value.
25?S:
26?S: This list includes architecture-dependent directories back to
27?S: version $api_versionstring (e.g. 5.5.640) and
28?S: architecture-independent directories all the way back to
29?S: 5.005.
30?S:.
31?C:PERL_INC_VERSION_LIST:
32?C: This variable specifies the list of subdirectories in over
33?C: which perl.c:incpush() and lib/lib.pm will automatically
34?C: search when adding directories to @INC, in a format suitable
35?C: for a C initialization string. See the inc_version_list entry
36?C: in Porting/Glossary for more details.
37?C:.
38?H:#define PERL_INC_VERSION_LIST $inc_version_list /**/
39?H:.
40?T: stem d
41: Determine list of previous versions to include in @INC
42$cat > getverlist <<EOPL
43#!$perl -w
44use File::Basename;
45\$api_versionstring = "$api_versionstring";
46\$version = "$version";
47\$sitelib = "$sitelib";
48\$archname = "$archname";
49EOPL
50 $cat >> getverlist <<'EOPL'
51# Can't have leading @ because metaconfig interprets it as a command!
52;@inc_version_list=();
53$stem=dirname($sitelib);
54# Redo to do opendir/readdir?
55if (-d $stem) {
56 chdir($stem);
57 ;@candidates = glob("5.*");
58}
59else {
60 ;@candidates = ();
61}
62
4b37e14a
JH
63# XXX ToDo: These comparisons must be reworked when two-digit
64# subversions come along, so that 5.7.10 compares as greater than
65# 5.7.3! By that time, hope that 5.6.x is sufficiently
66# widespread that we can use the built-in version vectors rather
67# than reinventing them here. For 5.6.0, however, we must
68# assume this script will likely be run by 5.005_0x. --AD 1/2000.
edd6115f
JH
69foreach $d (@candidates) {
70 if ($d lt $version) {
71 if ($d ge $api_versionstring) {
72 unshift(@inc_version_list, "$d/$archname", $d);
73 }
74 elsif ($d ge "5.005") {
75 unshift(@inc_version_list, $d);
76 }
77 }
78 else {
79 # Skip newer version. I.e. don't look in
80 # 5.7.0 if we're installing 5.6.1.
81 }
82}
83
84if (@inc_version_list) {
85 print '"';
86 print join('", "', @inc_version_list);
87 print '"';
88}
89else {
90 # Blank space to preserve value for next Configure run.
91 print " ";
92}
93EOPL
94chmod +x getverlist
95case "$inc_version_list" in
96'') if test -x $perl; then
97 dflt=`$perl getverlist`
98 else
99 dflt=''
100 fi
101 ;;
102*) dflt="$inc_version_list" ;;
103esac
104$cat <<'EOM'
105
106In order to ease the process of upgrading, this version of perl
107can be configured to use modules built and installed with earlier
108versions of perl that were installed under $prefix. Specify here
109the list of earlier versions that this version of perl should check.
110If Configure detected no earlier versions of perl installed under
111$prefix, then the list will be empty.
112
113The default should almost always be sensible, so if you're not sure,
114just accept the default.
115EOM
116
117rp='list of earlier versions to include in @INC?'
118. ./myread
119inc_version_list="$ans"
120$rm -f getverlist
121