projects
/
15.05
/
openwrt.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
9fd2c362e6b2ea5b3c4e1fc69747e91b1ffe1d24
[15.05/openwrt.git]
/
target
/
sdk
/
convert-config.pl
1
#!/usr/bin/env perl
2
use strict;
3
4
while (<>) {
5
chomp;
6
next unless /^CONFIG_([^=]+)=(.*)$/;
7
8
my $var = $1;
9
my $val = $2;
10
my $type;
11
12
if ($val eq 'y') {
13
$type = "bool";
14
} elsif ($val eq 'm') {
15
$type = "tristate";
16
} elsif ($val =~ /^".*"$/) {
17
$type = "string";
18
} elsif ($val =~ /^\d+$/) {
19
$type = "int";
20
} else {
21
warn "WARNING: no type found for symbol CONFIG_$var=$val\n";
22
next;
23
}
24
25
print <<EOF;
26
config $var
27
$type
28
default $val
29
30
EOF
31
}