}
}
+my @ifelse = ();
while (<>) {
chomp;
last if (/^EOF$/);
$data->{'default_doc'} = "";
$data->{'default_if_none'} = "";
- print "DEBUG: new option: $name\n" if $verbose;
+ print "DEBUG: line $.: new option: $name\n" if $verbose;
next;
+ } elsif ($_ =~ /^IF (.*)$/) {
+ my $cond = $1;
+ push(@ifelse, "$.: $1");
+ if (! defined $defines{$1}) {
+ print "NOTICE: line $.: unknown ./configure option '$1'\n";
+ } else {
+ $cond = $defines{$1};
+ }
+ if ($state eq "doc") {
+ $data->{"doc"} .= "if " . $cond . "\n";
+ } elsif ($state eq "comment") {
+ $comment .= "if " . $cond . "\n";
+ }
+ } elsif ($_ =~ /^ENDIF$/) {
+ pop(@ifelse);
+ if ($state eq "doc") {
+ $data->{"doc"} .= "endif\n";
+ } elsif ($state eq "comment") {
+ $comment .= "endif\n";
+ }
} elsif ($_ =~ /^COMMENT: (.*)$/) {
$data->{"comment"} = $1;
} elsif ($_ =~ /^TYPE: (.*)$/) {
} else {
$data->{"default"} .= "$name $1\n";
}
+ } elsif ($_ =~ /^POSTSCRIPTUM: (.*)$/) {
+ if ($data->{"default"} eq "none") {
+ $data->{"default"} = "";
+ }
+ $data->{"default"} .= "$name $1\n";
} elsif ($_ =~ /^DEFAULT_DOC: (.*)$/) {
$data->{"default_doc"} .= "$1\n";
} elsif ($_ =~ /^DEFAULT_IF_NONE: (.*)$/) {
} elsif (/^#/) {
next;
} elsif ($_ ne "") {
- print "NOTICE: unknown line '$_'\n";
+ print "NOTICE: line $.: unknown line '$_'\n";
}
}
+foreach my $condition (@ifelse) {
+ print "ERROR: missing ENDIF to match $condition\n";
+}
end_options;
print $index "<p><a href=\"index_all.html\">Alphabetic index</a></p>\n" if $format eq "splithtml";
print $index "<p><a href=\"#index\">Alphabetic index</a></p>\n" if $format eq "singlehtml";