7 my $class = ref($proto) || $proto;
11 my $output = \
${$self->{OUTPUT
}};
12 my $functions = \
%{$self->{FUNCTIONS
}};
13 my $conditionals = \
%{$self->{CONDITIONALS
}};
14 my $conditional_headers = \
%{$self->{CONDITIONAL_HEADERS
}};
15 my $conditional_functions = \
%{$self->{CONDITIONAL_FUNCTIONS
}};
19 my $configure_in_file = shift;
20 my $config_h_in_file = shift;
22 $api_file =~ s/^\.\///;
23 $configure_in_file =~ s/^\.\///;
24 $config_h_in_file =~ s/^\.\///;
26 $$output->progress("$api_file");
28 open(IN
, "< $api_file");
31 s/^\s*?(.*?)\s*$/$1/; # remove whitespace at begin and end of line
32 s/^(.*?)\s*#.*$/$1/; # remove comments
33 /^$/ && next; # skip empty lines
39 $$output->progress("$configure_in_file");
42 open(IN
, "< $configure_in_file");
44 while($again || (defined($_ = <IN
>))) {
50 $_ = $1 . " " . $line;
55 # remove leading and trailing whitespace
58 if(/^AC_CHECK_HEADERS\(\s*(.*?)\)\s*$/) {
59 my @arguments = split(/,/,$1);
60 foreach my $name (split(/\s+/, $arguments[0])) {
61 $$conditional_headers{$name}++;
63 } elsif(/^AC_CHECK_FUNCS\(\s*(.*?)\)\s*$/) {
64 my @arguments = split(/,/,$1);
65 foreach my $name (split(/\s+/, $arguments[0])) {
66 $$conditional_functions{$name}++;
68 } elsif(/^AC_FUNC_ALLOCA/) {
69 $$conditional_headers{"alloca.h"}++;
75 $$output->progress("$config_h_in_file");
77 open(IN
, "< $config_h_in_file");
80 if(/^\#undef\s+(\S+)$/) {
91 my $functions = \
%{$self->{FUNCTIONS
}};
95 return $$functions{$name};
100 my $conditionals = \
%{$self->{CONDITIONALS
}};
104 return $$conditionals{$name};
107 sub is_conditional_header
{
109 my $conditional_headers = \
%{$self->{CONDITIONAL_HEADERS
}};
113 return $$conditional_headers{$name};
116 sub is_conditional_function
{
118 my $conditional_functions = \
%{$self->{CONDITIONAL_FUNCTIONS
}};
122 return $$conditional_functions{$name};