8 # This program generates a partial Haskell list of Strings from
9 # words passed via stdin suitable for use in package.conf, e.g.:
11 # foo bar --> "foo", "bar"
12 # "foo bar" --> "foo bar"
13 # foo\"bar --> "foo\"bar"
15 # Invoking genargs.pl with -comma will print an initial comma if
16 # there's anything to print at all.
18 # Sample application in a Makefile:
19 # HSIFIED_EXTRA_LD_OPTS= `echo "$(EXTRA_LD_OPTS)" | $(PERL) genargs.pl`
20 # PACKAGE_CPP_OPTS += -DHSIFIED_EXTRA_LD_OPTS="$(HSIFIED_EXTRA_LD_OPTS)"
24 if ($ARGV[0] eq "-comma") {
38 if ($c eq $quote_char) {
46 if (($c eq ' ') || ($c eq "\n")) {
47 if (!($accum eq "")) {
51 } elsif ($c eq "\\") {
55 } elsif (($c eq '"') || ($c eq "\'")) {