1 ?RCS: $Id: patchlevel.U,v 3.0.1.1 1997/02/28 16:18:41 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: This file is included with or a derivative work of a file included
6 ?RCS: with the metaconfig program of Raphael Manfredi's "dist" distribution.
7 ?RCS: In accordance with clause 7 of dist's modified Artistic License:
9 ?RCS: You may distribute under the terms of either the GNU General Public
10 ?RCS: License or the Artistic License, as specified in the README file.
12 ?RCS: $Log: patchlevel.U,v $
13 ?RCS: Revision 3.0.1.1 1997/02/28 16:18:41 ram
14 ?RCS: patch61: added support for src.U
16 ?RCS: Revision 3.0 1993/08/18 12:09:31 ram
17 ?RCS: Baseline for dist 3.0 netwide release.
19 ?MAKE:patchlevel revision version subversion \
20 perl_patchlevel version_patchlevel_string \
21 api_revision api_version api_subversion api_versionstring: \
22 package test rsrc echo awk osname
23 ?MAKE: -pick add $@ %<
25 ?S: The value of revision comes from the patchlevel.h file.
26 ?S: In a version number such as 5.6.1, this is the "5".
27 ?S: In patchlevel.h, this is referred to as "PERL_REVISION".
30 ?S: The patchlevel level of this package.
31 ?S: The value of patchlevel comes from the patchlevel.h file.
32 ?S: In a version number such as 5.6.1, this is the "6".
33 ?S: In patchlevel.h, this is referred to as "PERL_VERSION".
36 ?S: The subversion level of this package.
37 ?S: The value of subversion comes from the patchlevel.h file.
38 ?S: In a version number such as 5.6.1, this is the "1".
39 ?S: In patchlevel.h, this is referred to as "PERL_SUBVERSION".
40 ?S: This is unique to perl.
43 ?S: The full version number of this package, such as 5.6.1 (or 5_6_1).
44 ?S: This combines revision, patchlevel, and subversion to get the
45 ?S: full version number, including any possible subversions.
46 ?S: This is suitable for use as a directory name, and hence is
47 ?S: filesystem dependent.
50 ?S: The three variables, api_revision, api_version, and
51 ?S: api_subversion, specify the version of the oldest perl binary
52 ?S: compatible with the present perl. In a full version string
53 ?S: such as '5.6.1', api_revision is the '5'.
54 ?S: Prior to 5.5.640, the format was a floating point number,
57 ?S: perl.c:incpush() and lib/lib.pm will automatically search in
58 ?S: $sitelib/.. for older directories back to the limit specified
59 ?S: by these api_ variables. This is only useful if you have a
60 ?S: perl library directory tree structured like the default one.
61 ?S: See INSTALL for how this works. The versioned site_perl
62 ?S: directory was introduced in 5.005, so that is the lowest
63 ?S: possible value. The version list appropriate for the current
64 ?S: system is determined in inc_version_list.U.
66 ?S: XXX To do: Since compatibility can depend on compile time
67 ?S: options (such as bincompat, longlong, etc.) it should
68 ?S: (perhaps) be set by Configure, but currently it isn't.
69 ?S: Currently, we read a hard-wired value from patchlevel.h.
70 ?S: Perhaps what we ought to do is take the hard-wired value from
71 ?S: patchlevel.h but then modify it if the current Configure
72 ?S: options warrant. patchlevel.h then would use an #ifdef guard.
75 ?S: The three variables, api_revision, api_version, and
76 ?S: api_subversion, specify the version of the oldest perl binary
77 ?S: compatible with the present perl. In a full version string
78 ?S: such as '5.6.1', api_version is the '6'. See api_revision for
79 ?S: full details. As a special case, 5.5.0 is rendered in the
80 ?S: old-style as 5.005. (In the 5.005_0x maintenance series,
81 ?S: this was the only versioned directory in $sitelib.)
84 ?S: The three variables, api_revision, api_version, and
85 ?S: api_subversion, specify the version of the oldest perl binary
86 ?S: compatible with the present perl. In a full version string
87 ?S: such as '5.6.1', api_subversion is the '1'. See api_revision for
91 ?S: This variable combines api_revision, api_version, and
92 ?S: api_subversion in a format such as 5.6.1 (or 5_6_1) suitable
93 ?S: for use as a directory name. This is filesystem dependent.
96 ?S: This is the Perl patch level, a numeric change identifier,
97 ?S: as defined by whichever source code maintenance system
98 ?S: is used to maintain the patches; currently Perforce.
99 ?S: It does not correlate with the Perl version numbers or
100 ?S: the maintenance versus development dichotomy except
101 ?S: by also being increasing.
103 ?S:version_patchlevel_string:
104 ?S: This is a string combining version, subversion and
105 ?S: perl_patchlevel (if perl_patchlevel is non-zero).
106 ?S: It is typically something like
107 ?S: 'version 7 subversion 1' or
108 ?S: 'version 7 subversion 1 patchlevel 11224'
109 ?S: It is computed here to avoid duplication of code in myconfig.SH
110 ?S: and lib/Config.pm.
114 ?LINT:extern LANGUAGE
115 ?LINT:change LANGUAGE
118 echo "Getting the current patchlevel..." >&4
119 if $test -r $rsrc/patchlevel.h;then
120 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
121 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
122 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
123 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
124 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
125 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
126 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
135 $echo "(You do not have patchlevel.h. Eek.)"
137 if $test -r $rsrc/.patch ; then
138 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
139 perl_patchlevel=`cat $rsrc/.patch`
142 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
143 version_patchlevel_string="version $patchlevel subversion $subversion"
144 case "$perl_patchlevel" in
146 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
149 $echo "(You have $package $version_patchlevel_string.)"
153 : XXX Should be a Configure test for double-dots in filenames.
154 version=`echo $revision $patchlevel $subversion | \
155 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
156 api_versionstring=`echo $api_revision $api_version $api_subversion | \
157 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
160 version=`echo $revision $patchlevel $subversion | \
161 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
162 api_versionstring=`echo $api_revision $api_version $api_subversion | \
163 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
166 : Special case the 5.005_xx maintenance series, which used 5.005
167 : without any subversion label as a subdirectory in $sitelib
168 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
169 api_versionstring='5.005'