This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: Possible skeletal structure for searching multiple versions
authorAndy Dougherty <doughera@lafayette.edu>
Thu, 30 Sep 1999 11:52:00 +0000 (07:52 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 30 Sep 1999 15:48:56 +0000 (15:48 +0000)
To: Jarkko Hietaniemi <jhi@iki.fi>, Gurusamy Sarathy <gsar@activestate.com>
Message-ID: <Pine.SOL.4.10.9909301149090.3343-100000@maxwell.phys.lafayette.edu>

p4raw-id: //depot/metaconfig@4260

U/mkglossary
U/perl/patchlevel.U
U/perl/xs_apiversion.U [new file with mode: 0644]

index ae78ba0..dfd977b 100755 (executable)
@@ -81,7 +81,7 @@ symbol:  while (defined($var = <WANTED>)) {
 EOE
             } else {
                print <<EOE;
-       This variable is be used internally by Configure to determine the
+       This variable is used internally by Configure to determine the
        full pathname (if any) of the $var program.  After Configure runs,
        the value is reset to a plain "$var" and is not useful.
 
index c85741c..f607bbd 100644 (file)
@@ -16,8 +16,8 @@
 ?RCS: Revision 3.0  1993/08/18  12:09:31  ram
 ?RCS: Baseline for dist 3.0 netwide release.
 ?RCS:
-?MAKE:patchlevel version subversion apiversion: package baserev test \
-       rsrc echo n c awk
+?MAKE:patchlevel version subversion apiversion: \
+       package baserev test rsrc echo n c awk
 ?MAKE: -pick add $@ %<
 ?S:patchlevel:
 ?S:    The patchlevel level of this package.
 ?S:    like 5.004 instead of 5,004.  This is unique to perl.
 ?S:.
 ?S:apiversion:
-?S:    This is a number which identifies the lowest version of perl
-?S:    to have an API (for XS extensions) compatible with the present
-?S:    version.  For example, for 5.005_01, the apiversion should be
-?S:    5.005, since 5.005_01 should be binary compatible with 5.005.
-?S:    This should probably be incremented manually somehow, perhaps
-?S:    from patchlevel.h.  For now, we'll guess maintenance subversions
-?S:    will retain binary compatibility.
+?S:    MakeMaker will install add-on modules in a directory with the
+?S:    PERL_APIVERSION version number.  The value is set manually in
+?S:    patchlevel.h.  Normally, for maintenance releases, this is
+?S:    just something like 5.005 or 5.6 or 5.7.  That is, it does not
+?S:    include the subversion number and does not change across
+?S:    maintenance releases.  This is so that add-on extensions can
+?S:    be shared across maintenance versions.  It is unclear how this
+?S:    ought to work for developer versions.  If a release breaks
+?S:    binary compatibility, this number should be increased.
 ?S:.
 ?LINT:extern LC_ALL
 ?LINT:change LC_ALL
@@ -54,9 +56,11 @@ echo "Getting the current patchlevel..." >&4
 if $test -r $rsrc/patchlevel.h;then
        patchlevel=`awk '/define[       ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
        subversion=`awk '/define[       ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
+       apiversion=`awk '/define[       ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
 else
        patchlevel=0
        subversion=0
+       apiversion=0
 fi
 $echo $n "(You have $package" $c
 case "$package" in
@@ -76,13 +80,4 @@ else
                 echo $baserev $patchlevel $subversion | \
                 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
 fi
-: Figure out perl API version.  Perhaps this should be in patchlevel.h
-if test "$subversion" -lt 50; then
-       apiversion=`LC_ALL=C; export LC_ALL; \
-                LANGUAGE=C; export LANGUAGE; \
-                echo $baserev $patchlevel | \
-                $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
-else
-       apiversion="$version"
-fi
 
diff --git a/U/perl/xs_apiversion.U b/U/perl/xs_apiversion.U
new file mode 100644 (file)
index 0000000..07f21e8
--- /dev/null
@@ -0,0 +1,90 @@
+?RCS: $Id: xs_apiversion.U $
+?RCS:
+?RCS: Copyright (c) 1999 Andy Dougherty
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: xs_apiversion.U,v $
+?RCS:
+?MAKE:xs_apiversion pm_apiversion: apiversion bincompat5005
+?MAKE: -pick add $@ %<
+?S:xs_apiversion:
+?S:    This variable contains the version of the oldest perl binary
+?S:    compatible with the present perl.  perl.c:incpush() and
+?S:    lib/lib.pm will automatically search in $sitearch for older
+?S:    directories across major versions back to xs_apiversion.
+?S:    This is only useful if you have a perl library directory tree
+?S:    structured like the default one.
+?S:    See INSTALL for how this works.
+?S:    The versioned site_perl directory was introduced in 5.005,
+?S:    so that is the lowest possible value.
+?S:    Since this can depend on compile time options (such as
+?S:    bincompat) it is set by Configure.  Other non-default sources
+?S:    of potential incompatibility, such as multiplicity, threads,
+?S:    debugging, 64bits, sfio, etc., are not checked for currently,
+?S:    though in principle we could go snooping around in old
+?S:    Config.pm files.
+?S:.
+?S:pm_apiversion:
+?S:    This variable contains the version of the oldest perl
+?S:    compatible with the present perl.  (That is, pure perl modules
+?S:    written for $pm_apiversion will still work for the current
+?S:    version).  perl.c:incpush() and lib/lib.pm will automatically
+?S:    search in $sitelib for older directories across major versions
+?S:    back to pm_apiversion.  This is only useful if you have a perl
+?S:    library directory tree structured like the default one.  The
+?S:    versioned site_perl library was introduced in 5.005, so that's
+?S:    the default setting for this variable.  It's hard to imagine
+?S:    it changing before Perl6.  It is included here for symmetry
+?S:    with xs_apiveprsion -- the searching algorithms will
+?S:    (presumably) be similar.
+?S:    See the INSTALL file for how this works.
+?S:.
+?C:PERL_XS_APIVERSION:
+?C:    This variable contains the version of the oldest perl binary
+?C:    compatible with the present perl.  perl.c:incpush() and
+?C:    lib/lib.pm will automatically search in $sitearch for older
+?C:    directories across major versions back to xs_apiversion.
+?C:    This is only useful if you have a perl library directory tree
+?C:    structured like the default one.
+?C:    See INSTALL for how this works.
+?C:    The versioned site_perl directory was introduced in 5.005,
+?C:    so that is the lowest possible value.
+?C:    Since this can depend on compile time options (such as
+?C:    bincompat) it is set by Configure.  Other non-default sources
+?C:    of potential incompatibility, such as multiplicity, threads,
+?C:    debugging, 64bits, sfio, etc., are not checked for currently,
+?C:    though in principle we could go snooping around in old
+?C:    Config.pm files.
+?C:.
+?C:PERL_PM_APIVERSION:
+?C:    This variable contains the version of the oldest perl
+?C:    compatible with the present perl.  (That is, pure perl modules
+?C:    written for pm_apiversion will still work for the current
+?C:    version).  perl.c:incpush() and lib/lib.pm will automatically
+?C:    search in $sitelib for older directories across major versions
+?C:    back to pm_apiversion.  This is only useful if you have a perl
+?C:    library directory tree structured like the default one.  The
+?C:    versioned site_perl library was introduced in 5.005, so that's
+?C:    the default setting for this variable.  It's hard to imagine
+?C:    it changing before Perl6.  It is included here for symmetry
+?C:    with xs_apiveprsion -- the searching algorithms will
+?C:    (presumably) be similar.
+?C:    See the INSTALL file for how this works.
+?C:.
+?H:#define PERL_XS_APIVERSION $xs_apiversion /* Change to string for tuples?*/
+?H:#define PERL_PM_APIVERSION $pm_apiversion /* Change to string for tuples?*/
+?H:.
+: Find earliest binary compatible site_perl subdirectory perl can use.
+case "$bincompat5005" in
+"$define") xs_apiversion='5.005' ;;
+*) xs_apiversion=$apiversion ;;   # The current site_perl version.
+esac
+: Find earliest pure perl site_perl subdirectory perl can use.
+: The versioned directories started at 5.005.
+pm_apiversion='5.005'
+