: add special variables
$test -f $src/patchlevel.h && \
-awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
+awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
echo "CONFIG=true" >>config.sh
: propagate old symbols
while (<>) {
next if m:^#!/bin/sh:;
- # Catch CONFIG=true and PATCHLEVEL=n line from Configure.
+ # Catch CONFIG=true and PERL_VERSION=n line from Configure.
s/^(\w+)=(true|\d+)\s*$/$1='$2'\n/;
+ my ($k,$v) = ($1,$2);
+ # grandfather PATCHLEVEL and SUBVERSION
+ if ($k) {
+ if ($k eq 'PERL_VERSION') {
+ push @v_others, "PATCHLEVEL='$v'\n";
+ }
+ elsif ($k eq 'PERL_SUBVERSION') {
+ push @v_others, "SUBVERSION='$v'\n";
+ }
+ }
# We can delimit things in config.sh with either ' or ".
unless ($in_v or m/^(\w+)=(['"])(.*\n)/){
push(@non_v, "#$_"); # not a name='value' line
$ OPEN/READONLY CONFIG 'patchlevel_h'
$Patchlevel_h_loop:
$ READ/END_Of_File=Close_patch CONFIG line
-$ IF ((F$LOCATE("#define PATCHLEVEL",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
+$ IF ((F$LOCATE("#define PERL_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
$ THEN
$ line = F$EDIT(line,"COMPRESS, TRIM")
$ patchlevel = F$EXTRACT(18,F$LENGTH(line)-18,line)
$ got_patch = "true"
$ ENDIF
-$ IF ((F$LOCATE("#define SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
+$ IF ((F$LOCATE("#define PERL_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
$ THEN
$ line = F$EDIT(line,"COMPRESS, TRIM")
$ subversion = F$EXTRACT(18,F$LENGTH(line)-18,line)
print <<'EOT';
#include "EXTERN.h"
#include "perl.h"
-#ifndef PATCHLEVEL
-#include "patchlevel.h"
-#endif
/* Workaround for mapstart: the only op which needs a different ppaddr */
#undef pp_mapstart
#include "EXTERN.h"
#include "perl.h"
-#ifndef PATCHLEVEL
-#include "patchlevel.h"
-#endif
static void xs_init _((void));
static PerlInterpreter *my_perl;
INIT_SPECIALSV_LIST;
PERL_SYS_INIT(&argc,&argv);
-#if PATCHLEVEL > 3 || (PATCHLEVEL == 3 && SUBVERSION >= 1)
perl_init_i18nl10n(1);
-#else
- perl_init_i18nl14n(1);
-#endif
if (!PL_do_undump) {
my_perl = perl_alloc();
#include "perl.h"
#include "XSUB.h"
+#ifndef PERL_VERSION
+#include "patchlevel.h"
+#define PERL_VERSION PATCHLEVEL
+#endif
+
/* Being the Berkeley DB we prefer the <sys/cdefs.h> (which will be
* shortly #included by the <db.h>) __attribute__ to the possibly
* already defined __attribute__, for example by GNUC or by Perl. */
croak("DB_File needs Berkeley DB 2.0.5 or greater, you have %d.%d.%d\n",
Major, Minor, Patch) ;
-#if PATCHLEVEL > 3
+#if PERL_VERSION > 3
sv_setpvf(ver_sv, "%d.%d", Major, Minor) ;
#else
{
#include "perl.h"
#include "XSUB.h"
+#ifndef PERL_VERSION
#include "patchlevel.h"
+#defined PERL_VERSION PATCHLEVEL
+#endif
-#if PATCHLEVEL < 5
+#if PERL_VERSION < 5
# ifndef PL_sv_undef
# define PL_sv_undef sv_undef
# endif
typedef FILE * OutputStream;
#endif
-#include "patchlevel.h"
-
-#if (PATCHLEVEL < 3) || ((PATCHLEVEL == 3) && (SUBVERSION < 22))
- /* before 5.003_22 */
-# define MY_start_subparse(fmt,flags) start_subparse()
-#else
-# if (PATCHLEVEL == 3) && (SUBVERSION == 22)
- /* 5.003_22 */
-# define MY_start_subparse(fmt,flags) start_subparse(flags)
-# else
- /* 5.003_23 onwards */
-# define MY_start_subparse(fmt,flags) start_subparse(fmt,flags)
-# endif
-#endif
+#define MY_start_subparse(fmt,flags) start_subparse(fmt,flags)
#ifndef gv_stashpvn
#define gv_stashpvn(str,len,flags) gv_stashpv(str,flags)
# the equivalent in the main Configure so we copy a little
# from Configure XXX Configure should be fixed.
if $test -r $src/patchlevel.h;then
- patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $src/patchlevel.h`
- subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $src/patchlevel.h`
+ patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $src/patchlevel.h`
+ subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $src/patchlevel.h`
else
patchlevel=0
subversion=0
$release = substr($ver,0,3); # Not used presently.
$patchlevel = substr($ver,3,2);
die "Patchlevel of perl ($patchlevel)",
- "and patchlevel of config.sh ($Config{'PATCHLEVEL'}) don't match\n"
- if $patchlevel != $Config{'PATCHLEVEL'};
+ "and patchlevel of config.sh ($Config{'PERL_VERSION'}) don't match\n"
+ if $patchlevel != $Config{'PERL_VERSION'};
$usage =
"Usage: installman --man1dir=/usr/wherever --man1ext=1
my $release = substr($ver,0,3); # Not used presently.
my $patchlevel = substr($ver,3,2);
die "Patchlevel of perl ($patchlevel)",
- "and patchlevel of config.sh ($Config{'PATCHLEVEL'}) don't match\n"
- if $patchlevel != $Config{'PATCHLEVEL'};
+ "and patchlevel of config.sh ($Config{'PERL_VERSION'}) don't match\n"
+ if $patchlevel != $Config{'PERL_VERSION'};
# Fetch some frequently-used items from %Config
my $installbin = $Config{installbin};
# Note that the text lines /^Summary of/ .. /^\s*$/ are copied into Config.pm.
$spitshell <<!GROK!THIS!
-Summary of my $package ($baserev patchlevel $PATCHLEVEL subversion $SUBVERSION) configuration:
+Summary of my $package (revision $baserev version $PERL_VERSION subversion $PERL_SUBVERSION) configuration:
Platform:
osname=$osname, osvers=$osvers, archname=$archname
uname='$myuname'
# Additional rules supported: perl_, aout_test, aout_install, use them
# for a.out style perl (which may fork).
-perl_version="5.00${PATCHLEVEL}_$SUBVERSION"
+perl_fullversion="5.00${PERL_VERSION}_$PERL_SUBVERSION"
case "$archname" in
- *-thread*) perl_version="${perl_version}-threaded";;
+ *-thread*) perl_fullversion="${perl_fullversion}-threaded";;
esac
-dll_post="`echo $perl_version | sum | awk '{print $1}'`"
+dll_post="`echo $perl_fullversion | sum | awk '{print $1}'`"
dll_post="`printf '%x' $dll_post | tr '[a-z]' '[A-Z]'`"
$spitshell >>Makefile <<!GROK!THIS!
-PERL_VERSION = $perl_version
+PERL_FULLVERSION = $perl_fullversion
OPTIMIZE = $optimize
AOUT_OPTIMIZE = \$(OPTIMIZE)
perl5.def: perl.linkexp
echo "LIBRARY '$(PERL_DLL_BASE)' INITINSTANCE TERMINSTANCE" > $@
- echo DESCRIPTION "'Perl interpreter v$(PERL_VERSION), export autogenerated, built with $(CONFIG_ARGS)'" >>$@
+ echo DESCRIPTION "'Perl interpreter v$(PERL_FULLVERSION), export autogenerated, built with $(CONFIG_ARGS)'" >>$@
echo STACKSIZE 32768 >>$@
echo CODE LOADONCALL >>$@
echo DATA LOADONCALL NONSHARED MULTIPLE >>$@
#ifdef USE_THREADS
sum++; /* Avoid conflict of DLLs in memory. */
#endif
- sum += PATCHLEVEL * 200 + SUBVERSION * 2; /* */
+ sum += PERL_VERSION * 200 + PERL_SUBVERSION * 2; /* */
fname[pos] = 'A' + (sum % 26);
fname[pos + 1] = 'A' + (sum / 26 % 26);
fname[pos + 2] = '\0';
#define PERL_VERSION 5 /* epoch */
#define PERL_SUBVERSION 55 /* generation */
-/* these are the old terms of reference */
-#define PATCHLEVEL PERL_VERSION
-#undef SUBVERSION /* OS/390 has a SUBVERSION in a system header */
-#define SUBVERSION PERL_SUBVERSION
-
/*
local_patches -- list of locally applied less-than-subversion patches.
If you're distributing such a patch, please give it a name and a
# define __PATCHLEVEL_H_INCLUDED__
#endif
+
+/* the old terms of reference, add them only when explicitly included */
+#if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(PATCHLEVEL)
+#define PATCHLEVEL PERL_VERSION
+#undef SUBVERSION /* OS/390 has a SUBVERSION in a system header */
+#define SUBVERSION PERL_SUBVERSION
+#endif
+
#include "EXTERN.h"
#include "perl.h"
-#include "patchlevel.h"
/* XXX If this causes problems, set i_unistd=undef in the hint file. */
#ifdef I_UNISTD
STATUS_ALL_SUCCESS;
SET_NUMERIC_STANDARD();
-#if defined(SUBVERSION) && SUBVERSION > 0
- sprintf(PL_patchlevel, "%7.5f", (double) 5
- + ((double) PATCHLEVEL / (double) 1000)
- + ((double) SUBVERSION / (double) 100000));
+#if defined(PERL_SUBVERSION) && PERL_SUBVERSION > 0
+ sprintf(PL_patchlevel, "%7.5f", (double) PERL_REVISION
+ + ((double) PERL_VERSION / (double) 1000)
+ + ((double) PERL_SUBVERSION / (double) 100000));
#else
- sprintf(PL_patchlevel, "%5.3f", (double) 5 +
- ((double) PATCHLEVEL / (double) 1000));
+ sprintf(PL_patchlevel, "%5.3f", (double) PERL_REVISION +
+ ((double) PERL_VERSION / (double) 1000));
#endif
#if defined(LOCAL_PATCH_COUNT)
s++;
return s;
case 'v':
-#if defined(SUBVERSION) && SUBVERSION > 0
- printf("\nThis is perl, version 5.%03d_%02d built for %s",
- PATCHLEVEL, SUBVERSION, ARCHNAME);
+#if defined(PERL_SUBVERSION) && PERL_SUBVERSION > 0
+ printf("\nThis is perl, version %d.%03d_%02d built for %s",
+ PERL_REVISION, PERL_VERSION, PERL_SUBVERSION, ARCHNAME);
#else
printf("\nThis is perl, version %s built for %s",
PL_patchlevel, ARCHNAME);
#endif /* IAMSUID */
/* and finally... */
+#define PERL_PATCHLEVEL_H_IMPLICIT
#include "patchlevel.h"
+#undef PERL_PATCHLEVEL_H_IMPLICIT
#endif /* Include guard */
if (open(PL,"${outdir}patchlevel.h")) {
while (<PL>) {
- if (/^#define PATCHLEVEL\s+(\S+)/) { print OUT "PATCHLEVEL='$1'\n"; }
- elsif (/^#define SUBVERSION\s+(\S+)/) { print OUT "SUBVERSION='$1'\n"; }
+ if (/^#define PERL_VERSION\s+(\S+)/) {
+ print OUT "PERL_VERSION='$1'\n";
+ print OUT "PATCHLEVEL='$1'\n"; # XXX compat
+ }
+ elsif (/^#define PERL_SUBVERSION\s+(\S+)/) {
+ print OUT "PERL_SUBVERSION='$1'\n";
+ print OUT "SUBVERSION='$1'\n"; # XXX compat
+ }
}
close PL;
}
-else { warn "Can't read ${outdir}patchlevel.h - skipping 'PATCHLEVEL'"; }
+else { warn "Can't read ${outdir}patchlevel.h - skipping 'PERL_VERSION'"; }
print OUT "pager='/bin/p'\n";
$spitshell<<!GROK!THIS!
-Summary of my $package ($baserev patchlevel $PATCHLEVEL) configuration:
+Summary of my $package ($baserev version $PERL_VERSION subversion $PERL_SUBVERSION) configuration:
Platform:
osname=$osname, osver=$osvers, archname=$archname
uname='$myuname'
-/PATCHLEVEL/ {base = $3}
-/SUBVERSION/ {subvers = $3}
+/PERL_VERSION/ {base = $3}
+/PERL_SUBVERSION/ {subvers = $3}
END {
if (subvers == 0)
printf "p9pvers = 5.%03d\n", base> "buildinfo";
in @=Config::myconfig() from /dev/nul:0
in $=Config::FETCH(ref(Config), 'package') from lib/Config.pm:574
in $=Config::FETCH(ref(Config), 'baserev') from lib/Config.pm:574
- in $=Config::FETCH(ref(Config), 'PATCHLEVEL') from lib/Config.pm:574
- in $=Config::FETCH(ref(Config), 'SUBVERSION') from lib/Config.pm:574
+ in $=Config::FETCH(ref(Config), 'PERL_VERSION') from lib/Config.pm:574
+ in $=Config::FETCH(ref(Config), 'PERL_SUBVERSION') from lib/Config.pm:574
in $=Config::FETCH(ref(Config), 'osname') from lib/Config.pm:574
in $=Config::FETCH(ref(Config), 'osvers') from lib/Config.pm:574
out $=Config::FETCH(ref(Config), 'package') from lib/Config.pm:574
in $=Config::FETCH(ref(Config), 'baserev') from lib/Config.pm:574
out $=Config::FETCH(ref(Config), 'baserev') from lib/Config.pm:574
- in $=Config::FETCH(ref(Config), 'PATCHLEVEL') from lib/Config.pm:574
- out $=Config::FETCH(ref(Config), 'PATCHLEVEL') from lib/Config.pm:574
- in $=Config::FETCH(ref(Config), 'SUBVERSION') from lib/Config.pm:574
+ in $=Config::FETCH(ref(Config), 'PERL_VERSION') from lib/Config.pm:574
+ out $=Config::FETCH(ref(Config), 'PERL_VERSION') from lib/Config.pm:574
+ in $=Config::FETCH(ref(Config), 'PERL_SUBVERSION') from lib/Config.pm:574
=item 14
=back
+=head2 Compatible C Source API Changes
+
+=over
+
+=item C<PATCHLEVEL> is now C<PERL_VERSION>
+
+The cpp macros C<PERL_REVISION>, C<PERL_VERSION> and C<PERL_SUBVERSION>
+are now available by default from perl.h, and reflect the base revision,
+patchlevel and subversion respectively. C<PERL_REVISION> had no
+prior equivalent, while C<PERL_VERSION> and C<PERL_SUBVERSION> were
+previously available as C<PATCHLEVEL> and C<SUBVERSION>.
+
+The new names cause less pollution of the cpp namespace, and reflect what
+the numbers have come to stand for in common practice. For compatibility,
+the old names are still supported when patchlevel.h is explicitly
+included (as required before), so there is no source incompatibility
+due to the change.
+
+=back
+
=head2 Binary Incompatibilities
This release is not binary compatible with the 5.005 release and its
if (open(PL,"${outdir}patchlevel.h")) {
while (<PL>) {
- if (/^#define PATCHLEVEL\s+(\S+)/) { print OUT "PATCHLEVEL='$1'\n"; }
- elsif (/^#define SUBVERSION\s+(\S+)/) { print OUT "SUBVERSION='$1'\n"; }
+ if (/^#define PERL_VERSION\s+(\S+)/) {
+ print OUT "PERL_VERSION='$1'\n";
+ print OUT "PATCHLEVEL='$1'\n"; # XXX compat
+ }
+ elsif (/^#define PERL_SUBVERSION\s+(\S+)/) {
+ print OUT "PERL_SUBVERSION='$1'\n";
+ print OUT "SUBVERSION='$1'\n"; # XXX compat
+ }
}
close PL;
}
$ open/read RATHER_LONG_CONFIG_FILE_HANDLE 'RATHER_LONG_FILENAME_SEARCH'
$read_patchlevel_h:
$ read/end_of_file = patchlevel_h_Done RATHER_LONG_CONFIG_FILE_HANDLE line
-$ if f$locate("PATCHLEVEL",line).ne.f$length(line)
+$ if f$locate("PERL_VERSION",line).ne.f$length(line)
$ then
$ line = f$edit(line,"TRIM,COMPRESS")
$ $PATCHLEVEL = f$element(2," ",line)
$ if f$type($SUBVERSION).nes."" then goto patchlevel_h_Done
$ endif
-$ if f$locate("SUBVERSION",line).ne.f$length(line)
+$ if f$locate("PERL_SUBVERSION",line).ne.f$length(line)
$ then
$ line = f$edit(line,"TRIM,COMPRESS")
$ $SUBVERSION = f$element(2," ",line)
$ close RATHER_LONG_CONFIG_FILE_HANDLE
$ if $PATCHLEVEL.eqs.""
$ then
-$ echo "warning: PATCHLEVEL was not found in ''RATHER_LONG_FILENAME_TO_FIND':"
+$ echo "warning: PERL_VERSION was not found in ''RATHER_LONG_FILENAME_TO_FIND':"
$ endif
$look_for_genconfig_pl:
$spit_it_out:
$! $spitshell = ECHO !<<!GROK!THIS!
$ ECHO " "
-$ ECHO "Summary of my ''$package' (patchlevel ''$PATCHLEVEL' subversion ''$SUBVERSION') configuration:"
+$ ECHO "Summary of my ''$package' (version ''$PATCHLEVEL' subversion ''$SUBVERSION') configuration:"
$ ECHO " Platform:"
$ ECHO " osname=''$osname', osvers=''$osvers', archname=''$archname'"
$ ECHO " uname=''$myuname'" !->d_has_uname?
$ WC "d_eunice='" + perl_d_eunice + "'"
$ WC "libs='" + perl_libs + "'"
$ WC "libc='" + perl_libc + "'"
+$ tempstring = "PERL_VERSION='" + "''perl_patchlevel'" + "'"
+$ WC tempstring
+$ tempstring = "PERL_SUBVERSION='" + "''perl_patchlevel'" + "'"
+$ WC tempstring
$ tempstring = "PATCHLEVEL='" + "''perl_patchlevel'" + "'"
$ WC tempstring
$ tempstring = "SUBVERSION='" + "''perl_SUBVERSION'" + "'"
Locker=''
Log='$Log'
Mcc='Mcc'
-PATCHLEVEL='~PATCHLEVEL~'
+PERL_VERSION='~PERL_VERSION~'
+PERL_SUBVERSION='~PERL_SUBVERSION~'
+PATCHLEVEL='~PERL_VERSION~'
RCSfile='$RCSfile'
Revision='$Revision'
-SUBVERSION='~SUBVERSION~'
+SUBVERSION='~PERL_SUBVERSION~'
Source=''
State=''
_a='.lib'
Locker=''
Log='$Log'
Mcc='Mcc'
-PATCHLEVEL='~PATCHLEVEL~'
+PERL_VERSION='~PERL_VERSION~'
+PERL_SUBVERSION='~PERL_SUBVERSION~'
+PATCHLEVEL='~PERL_VERSION~'
RCSfile='$RCSfile'
Revision='$Revision'
-SUBVERSION='~SUBVERSION~'
+SUBVERSION='~PERL_SUBVERSION~'
Source=''
State=''
_a='.a'
Locker=''
Log='$Log'
Mcc='Mcc'
-PATCHLEVEL='~PATCHLEVEL~'
+PERL_VERSION='~PERL_VERSION~'
+PERL_SUBVERSION='~PERL_SUBVERSION~'
+PATCHLEVEL='~PERL_VERSION~'
RCSfile='$RCSfile'
Revision='$Revision'
-SUBVERSION='~SUBVERSION~'
+SUBVERSION='~PERL_SUBVERSION~'
Source=''
State=''
_a='.lib'
$opt{VERSION} = $];
$opt{INST_VER} =~ s|~VERSION~|$]|g;
if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true
- $opt{PATCHLEVEL} = int($1 || 0);
- $opt{SUBVERSION} = $2 || '00';
+ $opt{PERL_VERSION} = int($1 || 0);
+ $opt{PERL_SUBVERSION} = $2 || '00';
}
$opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'};
#include "EXTERN.h"
#include "perl.h"
-#include "patchlevel.h"
-
#define NO_XSLOCKS
#ifdef PERL_OBJECT
extern CPerlObj* pPerl;
va_start(ap, trailing_path);
strip = va_arg(ap, char *);
- sprintf(base, "%5.3f", (double) 5 + ((double) PATCHLEVEL / (double) 1000));
+ sprintf(base, "%5.3f",
+ (double)PERL_REVISION + ((double)PERL_VERSION / (double)1000));
GetModuleFileName((HMODULE)((w32_perldll_handle == INVALID_HANDLE_VALUE)
? GetModuleHandle(NULL) : w32_perldll_handle),
static void
usage()
{
- printf("\nThis is the AWK to PERL translator, version 5.0, patchlevel %d\n", PATCHLEVEL);
+ printf("\nThis is the AWK to PERL translator, revision %d.0, version %d\n", PERL_REVISION, PERL_VERSION);
printf("\nUsage: %s [-D<number>] [-F<char>] [-n<fieldlist>] [-<number>] filename\n", myname);
printf("\n -D<number> sets debugging flags."
"\n -F<character> the awk script to translate is always invoked with"