Permalink
Browse files

Applying patch submitted in

http://rt.perl.org/rt3/Ticket/Display.html?id=40817.  This will log files
created during configuration in new file MANIFEST.configure.generated.


git-svn-id: https://svn.parrot.org/parrot/trunk@26761 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent 6bf5194 commit 7bb2d0eb8bf031f6d99aa274f45d59efed88790d @jkeenan jkeenan committed Apr 5, 2008
View
1 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
View
1 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: $!";
View
13 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;
}
View
3 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';
View
1 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;
View
3 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
###############################################################################
View
1 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";
View
14 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";
/*
View
2 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;
View
19 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
View
4 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

0 comments on commit 7bb2d0e

Please sign in to comment.