diff --git a/Configure.pl b/Configure.pl index 42daa58efa..f1723fcf9f 100644 --- a/Configure.pl +++ b/Configure.pl @@ -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 diff --git a/config/gen/config_h.pm b/config/gen/config_h.pm index 56b90d0f46..e07acd74a3 100644 --- a/config/gen/config_h.pm +++ b/config/gen/config_h.pm @@ -48,6 +48,7 @@ sub runstep { ); 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: $!"; diff --git a/config/gen/config_pm.pm b/config/gen/config_pm.pm index 71da580095..ebb8f72c07 100644 --- a/config/gen/config_pm.pm +++ b/config/gen/config_pm.pm @@ -19,6 +19,7 @@ use strict; 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 @@ sub runstep { 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 @@ sub runstep { 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 @@ END } 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; } diff --git a/config/gen/core_pmcs.pm b/config/gen/core_pmcs.pm index c73266d2c8..0cba75719f 100644 --- a/config/gen/core_pmcs.pm +++ b/config/gen/core_pmcs.pm @@ -43,6 +43,7 @@ sub generate_h { 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 @@ sub generate_c { 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 @@ sub generate_pm { 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'; diff --git a/config/gen/makefiles.pm b/config/gen/makefiles.pm index 0fe0e8afa0..36c7e8a854 100644 --- a/config/gen/makefiles.pm +++ b/config/gen/makefiles.pm @@ -76,6 +76,7 @@ sub runstep { my ( $self, $conf ) = @_; $self->makefiles($conf); + $conf->append_configure_log('docs/Makefile'); $self->cflags($conf); return 1; diff --git a/config/gen/makefiles/root.in b/config/gen/makefiles/root.in index b80f0ebc5b..fe4d43fdc8 100644 --- a/config/gen/makefiles/root.in +++ b/config/gen/makefiles/root.in @@ -224,7 +224,8 @@ STICKY_FILES = \ $(GEN_MAKEFILES) \ ext/Parrot-Embed/Makefile.PL \ myconfig \ - $(GEN_PASM_INCLUDES) + $(GEN_PASM_INCLUDES) \ + MANIFEST.configure.generated ############################################################################### diff --git a/config/gen/parrot_include.pm b/config/gen/parrot_include.pm index 0cdc88996f..2d3bb18fe2 100644 --- a/config/gen/parrot_include.pm +++ b/config/gen/parrot_include.pm @@ -158,6 +158,7 @@ sub runstep { $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"; diff --git a/config/gen/platform.pm b/config/gen/platform.pm index 62d31610f2..beac67c5a9 100644 --- a/config/gen/platform.pm +++ b/config/gen/platform.pm @@ -19,7 +19,7 @@ use warnings; 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 @@ CODA 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 @@ END_HERE 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"; /* diff --git a/config/init/manifest.pm b/config/init/manifest.pm index 6a58620518..483053b4c3 100644 --- a/config/init/manifest.pm +++ b/config/init/manifest.pm @@ -19,6 +19,7 @@ use warnings; 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 _init { sub runstep { my ( $self, $conf ) = @_; + $conf->append_configure_log('MANIFEST.configure.generated'); if ( $conf->options->get('nomanicheck') ) { $self->set_result('skipped'); return 1; diff --git a/lib/Parrot/Configure/Compiler.pm b/lib/Parrot/Configure/Compiler.pm index 5e1bde0ef2..c46b21d056 100644 --- a/lib/Parrot/Configure/Compiler.pm +++ b/lib/Parrot/Configure/Compiler.pm @@ -258,6 +258,11 @@ sub genfile { 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 @@ sub genfile { # 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 @@ sub genfile { 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 diff --git a/lib/Parrot/Configure/Utils.pm b/lib/Parrot/Configure/Utils.pm index 194ad8fb42..4dde501ad7 100644 --- a/lib/Parrot/Configure/Utils.pm +++ b/lib/Parrot/Configure/Utils.pm @@ -44,7 +44,7 @@ our %EXPORT_TAGS = ( 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 @@ sub _slurp { =back +=cut + =head1 SEE ALSO =over 4