regcomp.h Private declarations for above
regcomp.pl Builder of regnodes.h
regcomp.sym Data for regnodes.h
-regen.pl Common file routines for generator scripts
-regen_headers.pl Run all scripts that (re)generate files
+regen.pl Run all scripts that (re)generate files
+regen_lib.pl Common file routines for generator scripts
regexec.c Regular expression evaluator
regexp.h Public declarations for the above
regnodes.h Description of nodes of RE engine
CHMOD_W = chmod +w
# The following files are generated automatically
-# keywords.pl: keywords.h
-# opcode.pl: opcode.h opnames.h pp_proto.h pp.sym
-# [* embed.pl needs pp.sym generated by opcode.pl! *]
-# embed.pl: proto.h embed.h embedvar.h global.sym
-# perlapi.h perlapi.c pod/perlintern.pod
-# pod/perlapi.pod
+# autodoc.pl: pod/perlapi.pod pod/perlintern.pod
# bytecode.pl: ext/ByteLoader/byterun.h ext/ByteLoader/byterun.c
# ext/B/B/Asmdata.pm
+# embed.pl: proto.h embed.h embedvar.h global.sym
+# perlapi.h perlapi.c
+# [* embed.pl needs pp.sym generated by opcode.pl! *]
+# keywords.pl: keywords.h
+# opcode.pl: opcode.h opnames.h pp_proto.h pp.sym
# regcomp.pl: regnodes.h
# warnings.pl: warnings.h lib/warnings.pm
# The correct versions should be already supplied with the perl kit,
# in case you don't have perl available.
# To force them to be regenerated, run
-# perl regen_headers.pl
+# perl regen.pl
# with your existing copy of perl
# (make regen_headers is kept for backwards compatibility)
.PHONY: regen_headers regen_pods regen_all
-regen_headers: FORCE
- -perl regen_headers.pl
+regen regen_headers: FORCE
+ -perl regen.pl
regen_pods: FORCE
-cd pod; $(LDLIBPTH) $(MAKE) regen_pods
-regen_all: $(PERLYVMS) regen_headers regen_pods
+regen_all: $(PERLYVMS) regen regen_pods
# Extensions:
# Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will
BEGIN {
push @INC, 'lib';
- require 'regen.pl';
+ require 'regen_lib.pl';
} # glob() below requires File::Glob
BEGIN {
push @INC, './lib';
- require 'regen.pl';
+ require 'regen_lib.pl';
}
use strict;
my %alias_to = (
BEGIN {
# Get function prototypes
- require 'regen.pl';
+ require 'regen_lib.pl';
}
#
#!/usr/bin/perl
-require 'regen.pl';
+require 'regen_lib.pl';
safer_unlink ("keywords.h");
open(KW, ">keywords.h") || die "Can't create keywords.h: $!\n";
select KW;
#!/usr/bin/perl
BEGIN {
# Get function prototypes
- require 'regen.pl';
+ require 'regen_lib.pl';
}
$opcode_new = 'opcode.h-new';
BEGIN {
# Get function prototypes
- require 'regen.pl';
+ require 'regen_lib.pl';
}
#use Fatal qw(open close rename chmod unlink);
open DESC, 'regcomp.sym';
#!/usr/bin/perl -w
-use strict;
-use vars qw($Is_W32 $Is_OS2 $Is_Cygwin $Is_NetWare $Needs_Write);
-use Config; # Remember, this is running using an existing perl
-
-# Common functions needed by the regen scripts
-
-$Is_W32 = $^O eq 'MSWin32';
-$Is_OS2 = $^O eq 'os2';
-$Is_Cygwin = $^O eq 'cygwin';
-$Is_NetWare = $Config{osname} eq 'NetWare';
-if ($Is_NetWare) {
- $Is_W32 = 0;
-}
+require 5.003; # keep this compatible, an old perl is all we may have before
+ # we build the new one
-$Needs_Write = $Is_OS2 || $Is_W32 || $Is_Cygwin || $Is_NetWare;
+# The idea is to move the regen_headers target out of the Makefile so that
+# it is possible to rebuild the headers before the Makefile is available.
+# (and the Makefile is unavailable until after Configure is run, and we may
+# wish to make a clean source tree but with current headers without running
+# anything else.
-sub safer_unlink {
- my @names = @_;
- my $cnt = 0;
+use strict;
+my $perl = $^X;
- my $name;
- foreach $name (@names) {
- next unless -e $name;
- chmod 0777, $name if $Needs_Write;
- ( CORE::unlink($name) and ++$cnt
- or warn "Couldn't unlink $name: $!\n" );
- }
- return $cnt;
-}
+require 'regen_lib.pl';
+# keep warnings.pl in sync with the CPAN distribution by not requiring core
+# changes
+safer_unlink ("warnings.h", "lib/warnings.pm");
-sub safer_rename_silent {
- my ($from, $to) = @_;
+my %gen = (
+ 'autodoc.pl' => [qw[pod/perlapi.pod pod/perlintern.pod]],
+ 'bytecode.pl' => [qw[ext/ByteLoader/byterun.h
+ ext/ByteLoader/byterun.c
+ ext/B/B/Asmdata.pm]],
+ 'embed.pl' => [qw[proto.h embed.h embedvar.h global.sym
+ perlapi.h perlapi.c]],
+ 'keywords.pl' => [qw[keywords.h]],
+ 'opcode.pl' => [qw[opcode.h opnames.h pp_proto.h pp.sym]],
+ 'regcomp.pl' => [qw[regnodes.h]],
+ 'warnings.pl' => [qw[warnings.h lib/warnings.pm]]
+ );
- # Some dosish systems can't rename over an existing file:
- safer_unlink $to;
- chmod 0600, $from if $Needs_Write;
- rename $from, $to;
+sub do_cksum {
+ my $pl = shift;
+ my %cksum;
+ for my $f (@{ $gen{$pl} }) {
+ local *FH;
+ if (open(FH, $f)) {
+ local $/;
+ $cksum{$f} = unpack("%32C*", <FH>);
+ close FH;
+ } else {
+ warn "$0: $f: $!\n";
+ }
+ }
+ return %cksum;
}
-sub safer_rename {
- my ($from, $to) = @_;
- safer_rename_silent($from, $to) or die "renaming $from to $to: $!";
+foreach my $pl (qw (keywords.pl opcode.pl embed.pl bytecode.pl
+ regcomp.pl warnings.pl autodoc.pl)) {
+ print "$^X $pl\n";
+ my %cksum0;
+ %cksum0 = do_cksum($pl) unless $pl eq 'warnings.pl'; # the files were removed
+ system "$^X $pl";
+ next if $pl eq 'warnings.pl'; # the files were removed
+ my %cksum1 = do_cksum($pl);
+ my @chg;
+ for my $f (@{ $gen{$pl} }) {
+ push(@chg, $f)
+ if !defined($cksum0{$f}) ||
+ !defined($cksum1{$f}) ||
+ $cksum0{$f} ne $cksum1{$f};
+ }
+ print "Changed: @chg\n" if @chg;
}
-1;
+++ /dev/null
-#!/usr/bin/perl -w
-require 5.003; # keep this compatible, an old perl is all we may have before
- # we build the new one
-
-# The idea is to move the regen_headers target out of the Makefile so that
-# it is possible to rebuild the headers before the Makefile is available.
-# (and the Makefile is unavailable until after Configure is run, and we may
-# wish to make a clean source tree but with current headers without running
-# anything else.
-
-use strict;
-my $perl = $^X;
-
-require 'regen.pl';
-# keep warnings.pl in sync with the CPAN distribution by not requiring core
-# changes
-safer_unlink ("warnings.h", "lib/warnings.pm");
-
-foreach (qw (keywords.pl opcode.pl embed.pl bytecode.pl regcomp.pl
- warnings.pl autodoc.pl)) {
- print "$^X $_\n";
- system "$^X $_";
-}
--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+use vars qw($Is_W32 $Is_OS2 $Is_Cygwin $Is_NetWare $Needs_Write);
+use Config; # Remember, this is running using an existing perl
+
+# Common functions needed by the regen scripts
+
+$Is_W32 = $^O eq 'MSWin32';
+$Is_OS2 = $^O eq 'os2';
+$Is_Cygwin = $^O eq 'cygwin';
+$Is_NetWare = $Config{osname} eq 'NetWare';
+if ($Is_NetWare) {
+ $Is_W32 = 0;
+}
+
+$Needs_Write = $Is_OS2 || $Is_W32 || $Is_Cygwin || $Is_NetWare;
+
+sub safer_unlink {
+ my @names = @_;
+ my $cnt = 0;
+
+ my $name;
+ foreach $name (@names) {
+ next unless -e $name;
+ chmod 0777, $name if $Needs_Write;
+ ( CORE::unlink($name) and ++$cnt
+ or warn "Couldn't unlink $name: $!\n" );
+ }
+ return $cnt;
+}
+
+sub safer_rename_silent {
+ my ($from, $to) = @_;
+
+ # Some dosish systems can't rename over an existing file:
+ safer_unlink $to;
+ chmod 0600, $from if $Needs_Write;
+ rename $from, $to;
+}
+
+sub safer_rename {
+ my ($from, $to) = @_;
+ safer_rename_silent($from, $to) or die "renaming $from to $to: $!";
+}
+1;