3 # This script generates licence.h (containing the PuTTY licence in the
4 # form of macros expanding to C string literals) from the LICENCE
10 $outfile = "licence.h";
11 open my $in, $infile or die "$infile: open: $!\n";
12 open my $out, ">", $outfile or die "$outfile: open: $!\n";
16 print " * $outfile - macro definitions for the PuTTY licence.\n";
18 print " * Generated by @{[basename __FILE__]} from $infile.\n";
19 print " * You should edit those files rather than editing this one.\n";
30 # Format into paragraphs.
33 for my $line (@lines) {
36 } elsif (!defined $para) {
38 $para = \$paras[$#paras];
40 $$para .= " " . $line;
44 print "#define LICENCE_TEXT(parsep) \\\n";
45 for my $i (0..$#paras) {
46 my $lit = &stringlit($paras[$i]);
47 print " parsep \\\n" if $i > 0;
49 print " \\" if $i < $#paras;
54 die "bad format of first paragraph\n"
55 unless $paras[0] =~ m!copyright ([^\.]*)\.!i;
57 printf "#define SHORT_COPYRIGHT_DETAILS \"%s\"\n", &stringlit($1);