From: Nicholas Clark Date: Thu, 28 Sep 2000 12:18:10 +0000 (+0100) Subject: [ID 20000928.002] perlcc & ByteCode.pm option mismatch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d873810b3537a2d7375918c521de90017ed077b7;p=p5sagit%2Fp5-mst-13.2.git [ID 20000928.002] perlcc & ByteCode.pm option mismatch Message-Id: Did not apply cleanly, manual intervention was needed. p4raw-id: //depot/perl@7117 --- diff --git a/ext/B/B/Bytecode.pm b/ext/B/B/Bytecode.pm index ef59c4a..bea023a 100644 --- a/ext/B/B/Bytecode.pm +++ b/ext/B/B/Bytecode.pm @@ -850,7 +850,7 @@ sub compile { $compress_nullops = 1; $omit_seq = 1; } - } elsif ($opt eq "P") { + } elsif ($opt eq "u") { $arg ||= shift @options; push @packages, $arg; } else { @@ -975,7 +975,7 @@ Prints each CV taken from the final symbol tree walk. Output (bytecode) assembler source rather than piping it through the assembler and outputting bytecode. -=item B<-Ppackage> +=item B<-upackage> Stores package in the output. @@ -983,16 +983,16 @@ Stores package in the output. =head1 EXAMPLES - perl -MO=Bytecode,-O6,-ofoo.plc,-Pmain foo.pl + perl -MO=Bytecode,-O6,-ofoo.plc,-umain foo.pl - perl -MO=Bytecode,-S,-Pmain foo.pl > foo.S + perl -MO=Bytecode,-S,-umain foo.pl > foo.S assemble foo.S > foo.plc Note that C lives in the C subdirectory of your perl library directory. The utility called perlcc may also be used to help make use of this compiler. - perl -MO=Bytecode,-PFoo,-oFoo.pmc Foo.pm + perl -MO=Bytecode,-uFoo,-oFoo.pmc Foo.pm =head1 BUGS diff --git a/utils/perlcc.PL b/utils/perlcc.PL index 0215c8d..0c4b726 100644 --- a/utils/perlcc.PL +++ b/utils/perlcc.PL @@ -231,17 +231,18 @@ EOF vprint 1, "Compiling..."; vprint 3, "Calling $command"; - my ($output_r, $error_r) = spawnit($command); - my @output = @$output_r; - my @error = @$error_r; + my ($output_r, $error_r) = spawnit($command); - if (@error && $? != 0) { - die "$0: $Input did not compile, which can't happen:\n@error\n"; + if (@$error_r && $? != 0) { + die "$0: $Input did not compile, which can't happen:\n@$error_r\n"; + } else { + my @error = grep { !/^$Input syntax OK$/o } @$error_r; + warn "$0: Unexpected compiler output:\n@error" if @error; } - + # Write it and leave. - print OUT @output or die "can't write $Output: $!"; - close OUT or die "can't close $Output: $!"; + print OUT @$output_r or die "can't write $Output: $!"; + close OUT or die "can't close $Output: $!"; # wait, how could it be anything but what you see next? chmod 0777 & ~umask, $Output or die "can't chmod $Output: $!";