diff options
author | Sergei Trofimovich <siarheit@google.com> | 2016-12-17 22:19:29 +0000 |
---|---|---|
committer | Sergei Trofimovich <siarheit@google.com> | 2016-12-17 22:49:25 +0000 |
commit | 6c816c56c674221173e725b5718c8052dda0c8f4 (patch) | |
tree | c7d4c2f6b59f96224d61fccce743412322be745e /utils | |
parent | 87c3b1d4395c3d4fc7a5272717c48f3f525da959 (diff) | |
download | haskell-6c816c56c674221173e725b5718c8052dda0c8f4.tar.gz |
utils/genargs: delete unused tool
The tool was added in 2003 but never used at least in ghc tree.
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/genargs/Makefile | 8 | ||||
-rw-r--r-- | utils/genargs/genargs.pl | 65 |
2 files changed, 0 insertions, 73 deletions
diff --git a/utils/genargs/Makefile b/utils/genargs/Makefile deleted file mode 100644 index 3c31e6a39f..0000000000 --- a/utils/genargs/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -comma = , -BAR= "-L\"foo bar\"" -FOO= $(patsubst %,$(comma)"%",$(BAR)) - -test: - @echo "$(FOO)" - @echo "$(BAR)" | $(PERL) genargs.pl -comma - @echo diff --git a/utils/genargs/genargs.pl b/utils/genargs/genargs.pl deleted file mode 100644 index 33dd2a0c8c..0000000000 --- a/utils/genargs/genargs.pl +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env perl - -use warnings; - -my $quote_open = 0; -my $quote_char = ''; -my $accum = ""; -my $once = 1; -my $c; - -# This program generates a partial Haskell list of Strings from -# words passed via stdin suitable for use in package.conf, e.g.: -# -# foo bar --> "foo", "bar" -# "foo bar" --> "foo bar" -# foo\"bar --> "foo\"bar" -# -# Invoking genargs.pl with -comma will print an initial comma if -# there's anything to print at all. -# -# Sample application in a Makefile: -# HSIFIED_EXTRA_LD_OPTS= `echo "$(EXTRA_LD_OPTS)" | $(PERL) genargs.pl` -# PACKAGE_CPP_OPTS += -DHSIFIED_EXTRA_LD_OPTS="$(HSIFIED_EXTRA_LD_OPTS)" - -sub printaccum { - if ($once) { - if ($ARGV[0] eq "-comma") { - print ", "; - } - } else { - print ", "; - } - $once=0; - print '"'; - print $accum; - print '"'; -} - -while ($c = getc) { - if ($quote_open) { - if ($c eq $quote_char) { - $quote_open = 0; - } elsif ($c eq '"') { - $accum .= '\"'; - } else { - $accum .= $c; - } - } else { - if (($c eq ' ') || ($c eq "\n")) { - if (!($accum eq "")) { - printaccum; - $accum = ""; - } - } elsif ($c eq "\\") { - $accum .= $c; - $c = getc; - $accum .= $c; - } elsif (($c eq '"') || ($c eq "\'")) { - $quote_open = 1; - $quote_char = $c; - } else { - $accum .= $c - } - } -} |