projects
/
librecmc
/
librecmc.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
target/sdk: use .config instead of unconditionally enabling all build dirs
[librecmc/librecmc.git]
/
target
/
sdk
/
convert-config.pl
1
#!/usr/bin/env perl
2
use strict;
3
4
print <<EOF;
5
config ALL
6
bool
7
default y
8
9
EOF
10
11
while (<>) {
12
chomp;
13
next unless /^CONFIG_([^=]+)=(.*)$/;
14
15
my $var = $1;
16
my $val = $2;
17
my $type;
18
19
next if $var eq 'ALL';
20
21
if ($val eq 'y') {
22
$type = "bool";
23
} elsif ($val eq 'm') {
24
$type = "tristate";
25
} elsif ($val =~ /^".*"$/) {
26
$type = "string";
27
} elsif ($val =~ /^\d+$/) {
28
$type = "int";
29
} else {
30
warn "WARNING: no type found for symbol CONFIG_$var=$val\n";
31
next;
32
}
33
34
print <<EOF;
35
config $var
36
$type
37
default $val
38
39
EOF
40
}