1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/perl # used to convert version.m4 to simple # definition format while (<STDIN>) { chomp; if (/^\s*$/) { print "\n"; } elsif (/^define\((\w+),\[(.*?)\]\)/) { print "!define $1 \"$2\"\n"; } elsif (/^dnl(.*)$/) { print "#$1\n"; } }