1#!/usr/bin/env perl
2use strict;
3
4print <<EOF;
5config ALL
6	bool
7	default y
8
9EOF
10
11while (<>) {
12	chomp;
13	next if /^CONFIG_SIGNED_PACKAGES/;
14	next unless /^CONFIG_([^=]+)=(.*)$/;
15
16	my $var = $1;
17	my $val = $2;
18	my $type;
19
20	next if $var eq 'ALL';
21
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;
33	}
34
35	print <<EOF;
36config $var
37	$type
38	default $val
39
40EOF
41}
42