rpcd: iwinfo plugin fixes
[openwrt.git] / target / sdk / convert-config.pl
blobe701b42eb93af249a3c59c0d12235806b1e82e51
1 #!/usr/bin/env perl
2 use strict;
4 print <<EOF;
5 config ALL
6 bool
7 default y
9 EOF
11 while (<>) {
12 chomp;
13 next if /^CONFIG_SIGNED_PACKAGES/;
14 next unless /^CONFIG_([^=]+)=(.*)$/;
16 my $var = $1;
17 my $val = $2;
18 my $type;
20 next if $var eq 'ALL';
22 if ($val eq 'y') {
23 $type = "bool";
24 } elsif ($val eq 'm') {
25 $type = "tristate";
26 } elsif ($val =~ /^".*"$/) {
27 $type = "string";
28 } elsif ($val =~ /^\d+$/) {
29 $type = "int";
30 } else {
31 warn "WARNING: no type found for symbol CONFIG_$var=$val\n";
32 next;
35 print <<EOF;
36 config $var
37 $type
38 default $val
40 EOF