[ID 20000928.002] perlcc & ByteCode.pm option mismatch
authorNicholas Clark <nick@ccl4.org>
Thu, 28 Sep 2000 12:18:10 +0000 (13:18 +0100)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 2 Oct 2000 23:57:51 +0000 (23:57 +0000)
Message-Id: <E13ebha-0004IV-00@fruitbat.babyhippo.co.uk>

Did not apply cleanly, manual intervention was needed.

p4raw-id: //depot/perl@7117

ext/B/B/Bytecode.pm
utils/perlcc.PL

index ef59c4a..bea023a 100644 (file)
@@ -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<assemble> lives in the C<B> 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
 
index 0215c8d..0c4b726 100644 (file)
@@ -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: $!";