Alright, take 3:  Store the fact that this is real configuration in the
Parrot::Configure object just before calling runsteps().
Index: lib/Parrot/Configure/Compiler.pm
===================================================================
--- lib/Parrot/Configure/Compiler.pm    (revision 26526)
+++ lib/Parrot/Configure/Compiler.pm    (working copy)
@@ -258,6 +258,11 @@
     my $conf = shift;
     my ( $source, $target, %options ) = @_;
 
+    my $calling_sub = (caller(1))[3] || q{};
+    if ( $calling_sub !~ /cc_gen$/ ) {
+        $conf->append_configure_log($target);
+    }
+
     open my $in,  '<', $source       or die "Can't open $source: $!";
     open my $out, '>', "$target.tmp" or die "Can't open $target.tmp: $!";
 
@@ -303,7 +308,9 @@
 
             # OUT was/is used at the output filehandle in eval'ed scripts
             # e.g. feature.pl or feature_h.in
+            no warnings 'once';
             local *OUT = $out;
+            use warnings;
             my $text = do { local $/; <$in> };
 
             # interpolate @foo@ values
@@ -418,6 +425,18 @@
     move_if_diff( "$target.tmp", $target, $options{ignore_pattern} );
 }
 
+sub append_configure_log {
+    my $conf = shift;
+    my $target = shift;
+    if ( $conf->{active_configuration} ) {
+        my $generated_log = 'MANIFEST.configure.generated';
+        open my $GEN, '>>', $generated_log
+            or die "Can't open $generated_log for appending: $!";
+        print $GEN "$target\n";
+        close $GEN or die "Can't close $generated_log after appending: $!";
+    }
+}
+
 =head1 SEE ALSO
 
 =over 4
Index: lib/Parrot/Configure/Utils.pm
===================================================================
--- lib/Parrot/Configure/Utils.pm       (revision 26526)
+++ lib/Parrot/Configure/Utils.pm       (working copy)
@@ -44,7 +44,7 @@
     auto  => [
         qw(capture_output check_progs)
     ],
-    gen => [qw(copy_if_diff move_if_diff)]
+    gen => [qw( copy_if_diff move_if_diff )]
 );
 
 =item C<_run_command($command, $out, $err)>
@@ -311,6 +311,8 @@
 
 =back
 
+=cut
+
 =head1 SEE ALSO
 
 =over 4
Index: Configure.pl
===================================================================
--- Configure.pl        (revision 26526)
+++ Configure.pl        (working copy)
@@ -58,6 +58,7 @@
 
 # Run the actual steps
 # from Parrot::Configure
+$conf->{active_configuration} = 1;
 $conf->runsteps or exit(1);
 
 # build tests will only be run if you requested them
Index: config/init/manifest.pm
===================================================================
--- config/init/manifest.pm     (revision 26526)
+++ config/init/manifest.pm     (working copy)
@@ -19,6 +19,7 @@
 use base qw(Parrot::Configure::Step);
 
 use Parrot::Configure::Step;
+use Parrot::Configure::Utils ':gen';
 use ExtUtils::Manifest qw(manicheck);
 
 
@@ -33,6 +34,7 @@
 sub runstep {
     my ( $self, $conf ) = @_;
 
+    $conf->append_configure_log('MANIFEST.configure.generated');
     if ( $conf->options->get('nomanicheck') ) {
         $self->set_result('skipped');
         return 1;
Index: config/gen/platform.pm
===================================================================
--- config/gen/platform.pm      (revision 26526)
+++ config/gen/platform.pm      (working copy)
@@ -19,7 +19,7 @@
 
 use base qw(Parrot::Configure::Step);
 
-use Parrot::Configure::Utils qw(copy_if_diff);
+use Parrot::Configure::Utils ':gen';
 
 sub _init {
     my $self = shift;
@@ -74,8 +74,10 @@
         string.h
         /;
 
-    open my $PLATFORM_H, ">", "include/parrot/platform.h"
-        or die "Can't open include/parrot/platform.h: $!";
+    my $plat_h = q{include/parrot/platform.h};
+    $conf->append_configure_log($plat_h);
+    open my $PLATFORM_H, ">", $plat_h
+        or die "Can't open $plat_h: $!";
 
     print {$PLATFORM_H} <<"END_HERE";
 /* ex: set ro:
@@ -176,8 +178,10 @@
         misc.c
         /;
 
-    open my $PLATFORM_C, ">", "src/platform.c"
-        or die "Can't open src/platform.c: $!";
+    my $plat_c = q{src/platform.c};
+    $conf->append_configure_log($plat_c);
+    open my $PLATFORM_C, ">", $plat_c
+        or die "Can't open $plat_c: $!";
 
     print {$PLATFORM_C} <<"END_HERE";
 /*
Index: config/gen/makefiles/root.in
===================================================================
--- config/gen/makefiles/root.in        (revision 26526)
+++ config/gen/makefiles/root.in        (working copy)
@@ -225,7 +225,8 @@
     $(GEN_MAKEFILES) \
     ext/Parrot-Embed/Makefile.PL \
     myconfig  \
-    $(GEN_PASM_INCLUDES)
+    $(GEN_PASM_INCLUDES) \
+    MANIFEST.configure.generated
 
 
 ###############################################################################
Index: config/gen/core_pmcs.pm
===================================================================
--- config/gen/core_pmcs.pm     (revision 26526)
+++ config/gen/core_pmcs.pm     (working copy)
@@ -43,6 +43,7 @@
     my ( $self, $conf ) = @_;
 
     my $file = "include/parrot/core_pmcs.h";
+    $conf->append_configure_log($file);
     open( my $OUT, ">", "$file.tmp" );
 
     print {$OUT} <<"END_H";
@@ -95,6 +96,7 @@
     my $file = "src/core_pmcs.c";
     my @pmcs = split( / /, $conf->data->get('pmc_names') );
 
+    $conf->append_configure_log($file);
     open( my $OUT, ">", "$file.tmp" );
 
     print {$OUT} <<"END_C";
@@ -180,6 +182,7 @@
     my $file = "lib/Parrot/PMC.pm";
     my @pmcs = split( / /, $conf->data->get('pmc_names') );
 
+    $conf->append_configure_log($file);
     open( my $OUT, ">", "$file.tmp" );
 
     print $OUT <<'END_PM';
Index: config/gen/parrot_include.pm
===================================================================
--- config/gen/parrot_include.pm        (revision 26526)
+++ config/gen/parrot_include.pm        (working copy)
@@ -158,6 +158,7 @@
                 $conf->options->get('verbose') and print "$target ";
                 my $gen = join "\n",
                     ( $target =~ /\.pl$/ ? \&const_to_perl : \&const_to_parrot 
)->(@defs);
+                $conf->append_configure_log(qq{$destdir/$target});
                 my $target_tmp = "$target.tmp";
                 open my $out, '>', $target_tmp or die "Can't open $target_tmp: 
$!\n";
 
Index: config/gen/config_h.pm
===================================================================
--- config/gen/config_h.pm      (revision 26526)
+++ config/gen/config_h.pm      (working copy)
@@ -48,6 +48,7 @@
     );
 
     my $hh = "include/parrot/has_header.h";
+    $conf->append_configure_log($hh);
     open( my $HH, ">", "$hh.tmp" )
         or die "Can't open has_header.h: $!";
 
Index: config/gen/makefiles.pm
===================================================================
--- config/gen/makefiles.pm     (revision 26526)
+++ config/gen/makefiles.pm     (working copy)
@@ -76,6 +76,7 @@
     my ( $self, $conf ) = @_;
 
     $self->makefiles($conf);
+    $conf->append_configure_log('docs/Makefile');
     $self->cflags($conf);
 
     return 1;
Index: config/gen/config_pm.pm
===================================================================
--- config/gen/config_pm.pm     (revision 26526)
+++ config/gen/config_pm.pm     (working copy)
@@ -19,6 +19,7 @@
 use warnings;
 
 use base qw(Parrot::Configure::Step);
+use Parrot::Configure::Utils ':gen';
 
 use Cwd qw(cwd);
 use File::Spec::Functions qw(catdir);
@@ -46,8 +47,10 @@
         mkdir $configdir
             or die "Can't create dir $configdir: $!";
     }
-    open( my $OUT, ">", "lib/Parrot/Config/Generated.pm" )
-        or die "Can't open lib/Parrot/Config/Generated.pm: $!";
+    my $gen_pm = q{lib/Parrot/Config/Generated.pm};
+    $conf->append_configure_log($gen_pm);
+    open( my $OUT, ">", $gen_pm )
+        or die "Can't open $gen_pm: $!";
 
     print {$OUT} "# Generated by config/gen/config_pm.pm\n";
 
@@ -62,7 +65,9 @@
 
     my $template = "config/gen/config_pm/config_lib.in";
     open( $IN,  "<", $template )         or die "Can't open '$template': $!";
-    open( $OUT, ">", "config_lib.pasm" ) or die "Can't open config_lib.pasm: 
$!";
+    my $c_l_pasm = q{config_lib.pasm};
+    $conf->append_configure_log($c_l_pasm);
+    open( $OUT, ">", $c_l_pasm ) or die "Can't open $c_l_pasm: $!";
 
     print {$OUT} <<"END";
 # Generated by config/gen/config_pm.pm from the template
@@ -95,7 +100,7 @@
     }
 
     close $IN  or die "Can't close config_lib.in: $!";
-    close $OUT or die "Can't close config_lib.pasm: $!";
+    close $OUT or die "Can't close $c_l_pasm: $!";
 
     return 1;
 }

Reply via email to