From: Nicholas Clark Date: Tue, 22 Mar 2011 15:53:20 +0000 (+0000) Subject: Add regen/uconfig_h.pl to regenerate uconfig.h X-Git-Tag: accepted/trunk/20130322.191538~4554 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0817dbe582693d4dbd2f1ae8097b9b0f5f8530e;p=platform%2Fupstream%2Fperl.git Add regen/uconfig_h.pl to regenerate uconfig.h Most of the work is done by config_h.SH, but the wrapper is needed to add the digest lines, so that t/porting/regen.t can verify that it's up to date. I think that we need to take the "digest" approach, rather than "build to a temporary file during testing", as we can't rely on a working Unix shell on all platforms, and we couldn't even be sure that we get the skip list correct. --- diff --git a/MANIFEST b/MANIFEST index 1e2189e..7ded3ce 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4572,6 +4572,7 @@ regen/reentr.pl Reentrant interfaces regen/regcharclass.pl Generate regcharclass.h from inline data regen/regcomp.pl Builder of regnodes.h regen/regen_lib.pl Common file routines for generator scripts +regen/uconfig_h.pl generate uconfig.h (requires /bin/sh) regen/warnings.pl Program to write warnings.h and lib/warnings.pm regexec.c Regular expression evaluator regexp.h Public declarations for the above diff --git a/Porting/exec-bit.txt b/Porting/exec-bit.txt index 854fcb9..5d45917 100644 --- a/Porting/exec-bit.txt +++ b/Porting/exec-bit.txt @@ -21,6 +21,7 @@ regen/embed.pl regen/keywords.pl regen/opcode.pl regen/regcharclass.pl +regen/uconfig_h.pl runtests.SH t/TEST vms/ext/filespec.t diff --git a/regen/uconfig_h.pl b/regen/uconfig_h.pl new file mode 100755 index 0000000..8f714e2 --- /dev/null +++ b/regen/uconfig_h.pl @@ -0,0 +1,30 @@ +#!/usr/bin/perl -w +# +# Regenerate (overwriting only if changed): +# +# uconfig.h +# +# from uconfig.h config_h.SH +# +# Accepts the standard regen_lib -q and -v args. + +use strict; +use Config; +require 'regen/regen_lib.pl'; + +my ($uconfig_h, $uconfig_h_new, $config_h_sh) + = ('uconfig.h', 'uconfig.h-new', 'config_h.SH'); + +$ENV{CONFIG_SH} = 'uconfig.sh'; +$ENV{CONFIG_H} = $uconfig_h_new; +safer_unlink($uconfig_h_new); + +my $command = 'sh ./config_h.SH'; +system $command and die "`$command` failed, \$?=$?"; + +open FH, ">>$uconfig_h_new" or die "Can't append to $uconfig_h_new: $!"; + +print FH "\n", read_only_bottom([$ENV{CONFIG_SH}, 'config_h.SH']); + +safer_close(*FH); +rename_if_different($uconfig_h_new, $uconfig_h); diff --git a/t/porting/regen.t b/t/porting/regen.t index d5b3c52..78d0599 100644 --- a/t/porting/regen.t +++ b/t/porting/regen.t @@ -28,7 +28,7 @@ if ( $^O eq "VMS" ) { } my $in_regen_pl = 17; # I can't see a clean way to calculate this automatically. -my @files = qw(perly.act perly.h perly.tab keywords.c keywords.h); +my @files = qw(perly.act perly.h perly.tab keywords.c keywords.h uconfig.h); my @progs = qw(Porting/makemeta regen/regcharclass.pl regen/mk_PL_charclass.pl); plan (tests => $in_regen_pl + @files + @progs); diff --git a/uconfig.h b/uconfig.h index 6678e86..913ceed 100644 --- a/uconfig.h +++ b/uconfig.h @@ -4684,3 +4684,8 @@ #define Uid_t int /* UID type */ #endif + +/* Generated from: + * 323778627146f2762cd41f4dd1db6659f59006ec9bcaaf6bcc645d0380dda938 config_h.SH + * 0a1e8a170495d354031144ac47835fc8f8fc03739bc761d973cc3a4aa347797e uconfig.sh + * ex: set ro: */