1 ?RCS: $Id: inc_version_list.U,v $
3 ?RCS: Copyright (c) 2000 Andy Dougherty
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.
11 ?RCS: $Log: inc_version_list.U,v $
13 ?MAKE:inc_version_list inc_version_list_init d_inc_version_list: cat sed \
14 Getfile perl5 version api_versionstring rm Myread archname \
15 prefix sitelib_stem exe_ext
16 ?MAKE: -pick add $@ %<
19 ?S: This variable specifies the list of subdirectories in over
20 ?S: which perl.c:incpush() and lib/lib.pm will automatically
21 ?S: search when adding directories to @INC. The elements in
22 ?S: the list are separated by spaces. This is only useful
23 ?S: if you have a perl library directory tree structured like the
24 ?S: default one. See INSTALL for how this works. The versioned
25 ?S: site_perl directory was introduced in 5.005, so that is the
26 ?S: lowest possible value.
28 ?S: This list includes architecture-dependent directories back to
29 ?S: version $api_versionstring (e.g. 5.5.640) and
30 ?S: architecture-independent directories all the way back to
33 ?S:inc_version_list_init:
34 ?S: This variable holds the same list as inc_version_list, but
35 ?S: each item is enclosed in double quotes and separated by commas,
36 ?S: suitable for use in the PERL_INC_VERSION_LIST initialization.
38 ?S:d_inc_version_list:
39 ?S: This variable conditionally defines PERL_INC_VERSION_LIST.
40 ?S: It is set to undef when PERL_INC_VERSION_LIST is empty.
42 ?C:PERL_INC_VERSION_LIST:
43 ?C: This variable specifies the list of subdirectories in over
44 ?C: which perl.c:incpush() and lib/lib.pm will automatically
45 ?C: search when adding directories to @INC, in a format suitable
46 ?C: for a C initialization string. See the inc_version_list entry
47 ?C: in Porting/Glossary for more details.
49 ?H:#$d_inc_version_list PERL_INC_VERSION_LIST $inc_version_list_init /**/
52 : Determine list of previous versions to include in @INC
53 $cat > getverlist <<EOPL
56 \$api_versionstring = "$api_versionstring";
57 \$version = "$version";
58 \$stem = "$sitelib_stem";
59 \$archname = "$archname";
61 $cat >> getverlist <<'EOPL'
62 # The list found is store twice for each entry: the original name, and
63 # the binary broken down version as pack "sss", so sorting is easy and
64 # unambiguous. This will work for all versions that have a maximum of
65 # three digit groups, separate by '.'s or '_'s. Names are extended with
66 # ".0.0" to ensure at least three elements for the pack.
67 # -- H.Merijn Brand (m)'06 23-10-2006
69 # Can't have leading @ because metaconfig interprets it as a command!
70 ;@inc_version_list=();
71 # XXX Redo to do opendir/readdir?
75 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
76 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
82 ($pversion, $aversion, $vsn5005) = map {
83 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
84 foreach $d (@candidates) {
85 if ($d->[1] lt $pversion) {
86 if ($d->[1] ge $aversion) {
87 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
89 elsif ($d->[1] ge $vsn5005) {
90 unshift(@inc_version_list, grep { -d } $d->[0]);
94 # Skip newer version. I.e. don't look in
95 # 5.7.0 if we're installing 5.6.1.
99 if (@inc_version_list) {
100 print join(' ', @inc_version_list);
103 # Blank space to preserve value for next Configure run.
108 case "$inc_version_list" in
109 '') if test -x "$perl5$exe_ext"; then
110 dflt=`$perl5 getverlist`
115 $undef) dflt='none' ;;
116 ?X: Configure -Dinc_version_list='5.6.0/$archname 5.6.0' ...
117 *) eval dflt=\"$inc_version_list\" ;;
127 In order to ease the process of upgrading, this version of perl
128 can be configured to use modules built and installed with earlier
129 versions of perl that were installed under $prefix. Specify here
130 the list of earlier versions that this version of perl should check.
131 If Configure detected no earlier versions of perl installed under
132 $prefix, then the list will be empty. Answer 'none' to tell perl
133 to not search earlier versions.
135 The default should almost always be sensible, so if you're not sure,
136 just accept the default.
139 rp='List of earlier versions to include in @INC?'
142 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
143 *) inc_version_list="$ans" ;;
145 case "$inc_version_list" in
147 inc_version_list_init='0'
148 d_inc_version_list="$undef"
150 *) inc_version_list_init=`echo $inc_version_list |
151 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
152 d_inc_version_list="$define"