Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261625
b: refs/heads/master
c: 36fee53
h: refs/heads/master
i:
  261623: cdea5de
v: v3
  • Loading branch information
Michal Marek committed Jun 8, 2011
1 parent 4ed403d commit e6dc055
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ea3ad4e93222faf1d138ceb10291376d2da7cc6
refs/heads/master: 36fee53510f91d8ac5eb5dcba0e431a21ebdd5cd
27 changes: 27 additions & 0 deletions trunk/scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,29 @@ static int conf_split_config(void)
return res;
}

static void conf_write_function_autoconf(FILE *out, char* conf, char* name,
int val)
{
char c;
char *tmp, *d;

d = strdup(conf);
tmp = d;
while ((c = *conf++))
*d++ = tolower(c);

fprintf(out, "#define %sis_", tmp);
free(tmp);

d = strdup(name);
tmp = d;
while ((c = *name++))
*d++ = tolower(c);
fprintf(out, "%s%s() %d\n", tmp, (val > 1) ? "_module" : "",
val ? 1 : 0);
free(tmp);
}

int conf_write_autoconf(void)
{
struct symbol *sym;
Expand Down Expand Up @@ -820,6 +843,7 @@ int conf_write_autoconf(void)
rootmenu.prompt->text);

for_all_symbols(i, sym) {
int fct_val = 0;
sym_calc_value(sym);
if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
continue;
Expand All @@ -839,15 +863,18 @@ int conf_write_autoconf(void)
CONFIG_, sym->name);
fprintf(out_h, "#define %s%s_MODULE 1\n",
CONFIG_, sym->name);
fct_val = 2;
break;
case yes:
if (sym->type == S_TRISTATE)
fprintf(tristate,"%s%s=Y\n",
CONFIG_, sym->name);
fprintf(out_h, "#define %s%s 1\n",
CONFIG_, sym->name);
fct_val = 1;
break;
}
conf_write_function_autoconf(out_h, CONFIG_, sym->name, fct_val);
break;
case S_STRING:
conf_write_string(true, sym->name, sym_get_string_value(sym), out_h);
Expand Down

0 comments on commit e6dc055

Please sign in to comment.