diff options
-rw-r--r-- | ext/B/B/Bytecode.pm | 8 | ||||
-rw-r--r-- | utils/perlcc.PL | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/ext/B/B/Bytecode.pm b/ext/B/B/Bytecode.pm index 8764a0d588..c085071f47 100644 --- a/ext/B/B/Bytecode.pm +++ b/ext/B/B/Bytecode.pm @@ -705,6 +705,10 @@ sub compile { $arg ||= shift @options; open(OUT, ">$arg") or return "$arg: $!\n"; binmode OUT; + } elsif ($opt eq "a") { + $arg ||= shift @options; + open(OUT, ">>$arg") or return "$arg: $!\n"; + binmode OUT; } elsif ($opt eq "D") { $arg ||= shift @options; foreach $arg (split(//, $arg)) { @@ -814,6 +818,10 @@ extra arguments, it saves the main program. Output to filename instead of STDOUT. +=item B<-afilename> + +Append output to filename. + =item B<--> Force end of options. diff --git a/utils/perlcc.PL b/utils/perlcc.PL index a585580be0..a8c6ab4fc0 100644 --- a/utils/perlcc.PL +++ b/utils/perlcc.PL @@ -253,6 +253,7 @@ sub _createCode { my ( $backend, $generated_file, $file, $final_output ) = @_; my $return; + my $output_switch = "o"; local($") = " -I"; @@ -264,6 +265,8 @@ sub _createCode print GENFILE "#!$^X\n" if @_ == 3; print GENFILE "use ByteLoader $ByteLoader::VERSION;\n"; + + $output_switch ="a"; } close(GENFILE); @@ -278,7 +281,7 @@ sub _createCode chomp $stash; _print( "$^X -I@INC -MO=$backend,$stash $file\n", 36); - $return = _run("$^X -I@INC -MO=$backend,$stash,-o$generated_file $file", 9); + $return = _run("$^X -I@INC -MO=$backend,$stash,-$output_switch$generated_file $file", 9); $return; } else # compiling a shared object @@ -286,7 +289,7 @@ sub _createCode _print( "$^X -I@INC -MO=$backend,-m$final_output $file\n", 36); $return = - _run("$^X -I@INC -MO=$backend,-m$final_output,-o$generated_file $file ", 9); + _run("$^X -I@INC -MO=$backend,-m$final_output,-$output_switch$generated_file $file ", 9); $return; } } |