summaryrefslogtreecommitdiff
path: root/install-win32/macro.pl
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2012-11-05 16:28:10 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2012-11-05 16:28:10 +0100
commitd213c4e5576e2fd601679e0d7b2fb1262b807111 (patch)
tree5f0cc82bd0f11fb13b385417604d04c751245a92 /install-win32/macro.pl
parent79c8d3ef7a938f86472e549ef64e1fb820dc80c4 (diff)
parent8dd0350e1607aa30f7a043c8d5ec7a7eeb874115 (diff)
Merge tag 'upstream/2.3_rc1'
Upstream version 2.3_rc1
Diffstat (limited to 'install-win32/macro.pl')
-rw-r--r--install-win32/macro.pl61
1 files changed, 0 insertions, 61 deletions
diff --git a/install-win32/macro.pl b/install-win32/macro.pl
deleted file mode 100644
index 08ba58a..0000000
--- a/install-win32/macro.pl
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/perl
-
-# Simple macro processor.
-
-# Macros are defined in a control file that follows
-# a simple definition-based grammar as documented in the
-# trans script. Stdin is then copied to stdout, and any
-# occurrence of @@MACRO@@ is substituted. Macros can also
-# be specified on the command line.
-
-die "usage: macro [-O<openquote>] [-C<closequote>] [-Dname=var ...] [control-file ...] " if (@ARGV < 1);
-
-%Parms = ();
-$open_quote = "@@";
-$close_quote = "@@";
-
-while ($arg=shift(@ARGV)) {
- if ($arg =~ /^-/) {
- if ($arg =~ /^-D(\w+)(?:=(.*))?$/) {
- $Parms{$1} = $2
- } elsif ($arg =~ /-O(.*)$/) {
- $open_quote = $1;
- } elsif ($arg =~ /-C(.*)$/) {
- $close_quote = $1;
- } else {
- die "unrecognized option: $arg";
- }
- } else {
- open(CONTROL, "< $arg") or die "cannot open $arg";
- while (<CONTROL>) {
- if (/^!define\s+(\w+)(?:\s+['"]?(.*?)['"]?)?\s*$/) {
- $Parms{$1} = $2;
- }
- }
- }
-}
-
-sub print_symbol_table {
- foreach my $k (sort (keys(%Parms))) {
- my $v = $Parms{$k};
- print "[$k] -> \"$v\"\n";
- }
-}
-
-#print_symbol_table ();
-#exit 0;
-
-while (<STDIN>) {
- s{
- \Q$open_quote\E
- \s*
- (
- \w+
- )
- \s*
- \Q$close_quote\E
- }{
- $Parms{$1}
- }xge;
- print;
-}