summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl.old/lib/B/assemble
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl.old/lib/B/assemble')
-rw-r--r--Master/tlpkg/tlperl.old/lib/B/assemble30
1 files changed, 30 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl.old/lib/B/assemble b/Master/tlpkg/tlperl.old/lib/B/assemble
new file mode 100644
index 00000000000..43cc5bc4b33
--- /dev/null
+++ b/Master/tlpkg/tlperl.old/lib/B/assemble
@@ -0,0 +1,30 @@
+use B::Assembler qw(assemble_fh);
+use FileHandle;
+
+my ($filename, $fh, $out);
+
+if ($ARGV[0] eq "-d") {
+ B::Assembler::debug(1);
+ shift;
+}
+
+$out = \*STDOUT;
+
+if (@ARGV == 0) {
+ $fh = \*STDIN;
+ $filename = "-";
+} elsif (@ARGV == 1) {
+ $filename = $ARGV[0];
+ $fh = new FileHandle "<$filename";
+} elsif (@ARGV == 2) {
+ $filename = $ARGV[0];
+ $fh = new FileHandle "<$filename";
+ $out = new FileHandle ">$ARGV[1]";
+} else {
+ die "Usage: assemble [filename] [outfilename]\n";
+}
+
+binmode $out;
+$SIG{__WARN__} = sub { warn "$filename:@_" };
+$SIG{__DIE__} = sub { die "$filename: @_" };
+assemble_fh($fh, sub { print $out @_ });