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 $$output->progress("$api_file");
24 open(IN, "< $api_file");
27 s/^\s*?(.*?)\s*$/$1/; # remove whitespace at begin and end of line
28 s/^(.*?)\s*#.*$/$1/; # remove comments
29 /^$/ && next; # skip empty lines
35 $$output->progress("$configure_in_file");
38 open(IN, "< $configure_in_file");
40 while($again || (defined($_ = <IN>))) {
46 $_ = $1 . " " . $line;
51 # remove leading and trailing whitespace
54 if(/^AC_CHECK_HEADERS\(\s*(.*?)\)\s*$/) {
55 my @arguments = split(/,/,$1);
56 foreach my $name (split(/\s+/, $arguments[0])) {
57 $$conditional_headers{$name}++;
59 } elsif(/^AC_CHECK_FUNCS\(\s*(.*?)\)\s*$/) {
60 my @arguments = split(/,/,$1);
61 foreach my $name (split(/\s+/, $arguments[0])) {
62 $$conditional_functions{$name}++;
64 } elsif(/^AC_FUNC_ALLOCA/) {
65 $$conditional_headers{"alloca.h"}++;
71 $$output->progress("$config_h_in_file");
73 open(IN, "< $config_h_in_file");
76 if(/^\#undef\s+(\S+)$/) {
87 my $functions = \%{$self->{FUNCTIONS}};
91 return $$functions{$name};
96 my $conditionals = \%{$self->{CONDITIONALS}};
100 return $$conditionals{$name};
103 sub is_conditional_header {
105 my $conditional_headers = \%{$self->{CONDITIONAL_HEADERS}};
109 return $$conditional_headers{$name};
112 sub is_conditional_function {
114 my $conditional_functions = \%{$self->{CONDITIONAL_FUNCTIONS}};
118 return $$conditional_functions{$name};