diff options
-rw-r--r-- | scripts/kconfig/confdata.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index c257bb0bf90a..a49cf4f7dca5 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -773,6 +773,29 @@ out: | |||
773 | return res; | 773 | return res; |
774 | } | 774 | } |
775 | 775 | ||
776 | static void conf_write_function_autoconf(FILE *out, char* conf, char* name, | ||
777 | int val) | ||
778 | { | ||
779 | char c; | ||
780 | char *tmp, *d; | ||
781 | |||
782 | d = strdup(conf); | ||
783 | tmp = d; | ||
784 | while ((c = *conf++)) | ||
785 | *d++ = tolower(c); | ||
786 | |||
787 | fprintf(out, "#define %sis_", tmp); | ||
788 | free(tmp); | ||
789 | |||
790 | d = strdup(name); | ||
791 | tmp = d; | ||
792 | while ((c = *name++)) | ||
793 | *d++ = tolower(c); | ||
794 | fprintf(out, "%s%s() %d\n", tmp, (val > 1) ? "_module" : "", | ||
795 | val ? 1 : 0); | ||
796 | free(tmp); | ||
797 | } | ||
798 | |||
776 | int conf_write_autoconf(void) | 799 | int conf_write_autoconf(void) |
777 | { | 800 | { |
778 | struct symbol *sym; | 801 | struct symbol *sym; |
@@ -820,6 +843,7 @@ int conf_write_autoconf(void) | |||
820 | rootmenu.prompt->text); | 843 | rootmenu.prompt->text); |
821 | 844 | ||
822 | for_all_symbols(i, sym) { | 845 | for_all_symbols(i, sym) { |
846 | int fct_val = 0; | ||
823 | sym_calc_value(sym); | 847 | sym_calc_value(sym); |
824 | if (!(sym->flags & SYMBOL_WRITE) || !sym->name) | 848 | if (!(sym->flags & SYMBOL_WRITE) || !sym->name) |
825 | continue; | 849 | continue; |
@@ -839,6 +863,7 @@ int conf_write_autoconf(void) | |||
839 | CONFIG_, sym->name); | 863 | CONFIG_, sym->name); |
840 | fprintf(out_h, "#define %s%s_MODULE 1\n", | 864 | fprintf(out_h, "#define %s%s_MODULE 1\n", |
841 | CONFIG_, sym->name); | 865 | CONFIG_, sym->name); |
866 | fct_val = 2; | ||
842 | break; | 867 | break; |
843 | case yes: | 868 | case yes: |
844 | if (sym->type == S_TRISTATE) | 869 | if (sym->type == S_TRISTATE) |
@@ -846,8 +871,10 @@ int conf_write_autoconf(void) | |||
846 | CONFIG_, sym->name); | 871 | CONFIG_, sym->name); |
847 | fprintf(out_h, "#define %s%s 1\n", | 872 | fprintf(out_h, "#define %s%s 1\n", |
848 | CONFIG_, sym->name); | 873 | CONFIG_, sym->name); |
874 | fct_val = 1; | ||
849 | break; | 875 | break; |
850 | } | 876 | } |
877 | conf_write_function_autoconf(out_h, CONFIG_, sym->name, fct_val); | ||
851 | break; | 878 | break; |
852 | case S_STRING: | 879 | case S_STRING: |
853 | conf_write_string(true, sym->name, sym_get_string_value(sym), out_h); | 880 | conf_write_string(true, sym->name, sym_get_string_value(sym), out_h); |