Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kconfig updates from Michal Marek:
"Here is the kconfig stuff for v4.1-rc1:

- fixes for mergeconfig (used by make kvmconfig/tinyconfig)

- header cleanup

- make -s *config is silent now"

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
kconfig: Do not print status messages in make -s mode
kconfig: Simplify Makefile
kbuild: add generic mergeconfig target, %.config
merge_config.sh: rename MAKE to RUNMAKE
merge_config.sh: improve indentation
kbuild: mergeconfig: remove redundant $(objtree)
kbuild: mergeconfig: move an error check to merge_config.sh
kbuild: mergeconfig: fix "jobserver unavailable" warning
kconfig: Remove unnecessary prototypes from headers
kconfig: Remove dead code
kconfig: Get rid of the P() macro in headers
kconfig: fix a misspelling in scripts/kconfig/merge_config.sh

+174 -198
+39 -41
scripts/kconfig/Makefile
··· 2 2 # Kernel configuration targets 3 3 # These targets are used from top-level makefile 4 4 5 - PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \ 5 + PHONY += xconfig gconfig menuconfig config silentoldconfig update-po-config \ 6 6 localmodconfig localyesconfig 7 7 8 8 ifdef KBUILD_KCONFIG ··· 11 11 Kconfig := Kconfig 12 12 endif 13 13 14 + ifeq ($(quiet),silent_) 15 + silent := -s 16 + endif 17 + 14 18 # We need this, in case the user has it in its environment 15 19 unexport CONFIG_ 16 20 17 21 xconfig: $(obj)/qconf 18 - $< $(Kconfig) 22 + $< $(silent) $(Kconfig) 19 23 20 24 gconfig: $(obj)/gconf 21 - $< $(Kconfig) 25 + $< $(silent) $(Kconfig) 22 26 23 27 menuconfig: $(obj)/mconf 24 - $< $(Kconfig) 28 + $< $(silent) $(Kconfig) 25 29 26 30 config: $(obj)/conf 27 - $< --oldaskconfig $(Kconfig) 31 + $< $(silent) --oldaskconfig $(Kconfig) 28 32 29 33 nconfig: $(obj)/nconf 30 - $< $(Kconfig) 31 - 32 - oldconfig: $(obj)/conf 33 - $< --$@ $(Kconfig) 34 + $< $(silent) $(Kconfig) 34 35 35 36 silentoldconfig: $(obj)/conf 36 37 $(Q)mkdir -p include/config include/generated 37 - $< --$@ $(Kconfig) 38 + $< $(silent) --$@ $(Kconfig) 38 39 39 40 localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf 40 41 $(Q)mkdir -p include/config include/generated ··· 44 43 cmp -s .tmp.config .config || \ 45 44 (mv -f .config .config.old.1; \ 46 45 mv -f .tmp.config .config; \ 47 - $(obj)/conf --silentoldconfig $(Kconfig); \ 46 + $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \ 48 47 mv -f .config.old.1 .config.old) \ 49 48 else \ 50 49 mv -f .tmp.config .config; \ 51 - $(obj)/conf --silentoldconfig $(Kconfig); \ 50 + $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \ 52 51 fi 53 52 $(Q)rm -f .tmp.config 54 53 55 54 # Create new linux.pot file 56 55 # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files 57 56 update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h 58 - $(Q)echo " GEN config.pot" 57 + $(Q)$(kecho) " GEN config.pot" 59 58 $(Q)xgettext --default-domain=linux \ 60 59 --add-comments --keyword=_ --keyword=N_ \ 61 60 --from-code=UTF-8 \ ··· 66 65 $(Q)(for i in `ls $(srctree)/arch/*/Kconfig \ 67 66 $(srctree)/arch/*/um/Kconfig`; \ 68 67 do \ 69 - echo " GEN $$i"; \ 68 + $(kecho) " GEN $$i"; \ 70 69 $(obj)/kxgettext $$i \ 71 70 >> $(obj)/config.pot; \ 72 71 done ) 73 - $(Q)echo " GEN linux.pot" 72 + $(Q)$(kecho) " GEN linux.pot" 74 73 $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ 75 74 --output $(obj)/linux.pot 76 75 $(Q)rm -f $(obj)/config.pot 77 76 78 - PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig 77 + # These targets map 1:1 to the commandline options of 'conf' 78 + simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \ 79 + alldefconfig randconfig listnewconfig olddefconfig 80 + PHONY += $(simple-targets) 79 81 80 - allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf 81 - $< --$@ $(Kconfig) 82 + $(simple-targets): $(obj)/conf 83 + $< $(silent) --$@ $(Kconfig) 82 84 83 - PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig 84 - 85 - listnewconfig olddefconfig: $(obj)/conf 86 - $< --$@ $(Kconfig) 85 + PHONY += oldnoconfig savedefconfig defconfig 87 86 88 87 # oldnoconfig is an alias of olddefconfig, because people already are dependent 89 88 # on its behavior(sets new symbols to their default value but not 'n') with the 90 89 # counter-intuitive name. 91 - oldnoconfig: $(obj)/conf 92 - $< --olddefconfig $(Kconfig) 90 + oldnoconfig: olddefconfig 93 91 94 92 savedefconfig: $(obj)/conf 95 - $< --$@=defconfig $(Kconfig) 93 + $< $(silent) --$@=defconfig $(Kconfig) 96 94 97 95 defconfig: $(obj)/conf 98 96 ifeq ($(KBUILD_DEFCONFIG),) 99 - $< --defconfig $(Kconfig) 97 + $< $(silent) --defconfig $(Kconfig) 100 98 else 101 - @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" 102 - $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) 99 + @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" 100 + $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) 103 101 endif 104 102 105 103 %_defconfig: $(obj)/conf 106 - $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) 104 + $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) 107 105 108 - configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config) 106 + configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@) 109 107 110 - define mergeconfig 111 - $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target)) 112 - $(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture)) 113 - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1)) 114 - $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig 115 - endef 108 + %.config: $(obj)/conf 109 + $(if $(call configfiles),, $(error No configuration exists for this target on this architecture)) 110 + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles) 111 + +$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig 116 112 117 113 PHONY += kvmconfig 118 - kvmconfig: 119 - $(call mergeconfig,kvm_guest) 114 + kvmconfig: kvm_guest.config 115 + @: 120 116 121 117 PHONY += tinyconfig 122 - tinyconfig: allnoconfig 123 - $(call mergeconfig,tiny) 118 + tinyconfig: 119 + $(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config 124 120 125 121 # Help text used by make help 126 122 help: ··· 219 221 220 222 # QT needs some extra effort... 221 223 $(obj)/.tmp_qtcheck: 222 - @set -e; echo " CHECK qt"; dir=""; pkg=""; \ 224 + @set -e; $(kecho) " CHECK qt"; dir=""; pkg=""; \ 223 225 if ! pkg-config --exists QtCore 2> /dev/null; then \ 224 226 echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ 225 227 pkg-config --exists qt 2> /dev/null && pkg=qt; \
+6 -2
scripts/kconfig/conf.c
··· 471 471 static void conf_usage(const char *progname) 472 472 { 473 473 474 - printf("Usage: %s [option] <kconfig-file>\n", progname); 474 + printf("Usage: %s [-s] [option] <kconfig-file>\n", progname); 475 475 printf("[option] is _one_ of the following:\n"); 476 476 printf(" --listnewconfig List new options\n"); 477 477 printf(" --oldaskconfig Start a new configuration using a line-oriented program\n"); ··· 501 501 502 502 tty_stdio = isatty(0) && isatty(1) && isatty(2); 503 503 504 - while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { 504 + while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) { 505 + if (opt == 's') { 506 + conf_set_message_callback(NULL); 507 + continue; 508 + } 505 509 input_mode = (enum input_mode)opt; 506 510 switch (opt) { 507 511 case silentoldconfig:
+5
scripts/kconfig/confdata.c
··· 16 16 17 17 #include "lkc.h" 18 18 19 + struct conf_printer { 20 + void (*print_symbol)(FILE *, struct symbol *, const char *, void *); 21 + void (*print_comment)(FILE *, const char *, void *); 22 + }; 23 + 19 24 static void conf_warning(const char *fmt, ...) 20 25 __attribute__ ((format (printf, 1, 2))); 21 26
+12 -10
scripts/kconfig/expr.c
··· 11 11 12 12 #define DEBUG_EXPR 0 13 13 14 + static int expr_eq(struct expr *e1, struct expr *e2); 15 + static struct expr *expr_eliminate_yn(struct expr *e); 16 + static struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2); 17 + static struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2); 18 + static void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2); 19 + 14 20 struct expr *expr_alloc_symbol(struct symbol *sym) 15 21 { 16 22 struct expr *e = xcalloc(1, sizeof(*e)); ··· 192 186 #undef e1 193 187 #undef e2 194 188 195 - int expr_eq(struct expr *e1, struct expr *e2) 189 + static int expr_eq(struct expr *e1, struct expr *e2) 196 190 { 197 191 int res, old_count; 198 192 ··· 234 228 return 0; 235 229 } 236 230 237 - struct expr *expr_eliminate_yn(struct expr *e) 231 + static struct expr *expr_eliminate_yn(struct expr *e) 238 232 { 239 233 struct expr *tmp; 240 234 ··· 829 823 return false; 830 824 } 831 825 832 - struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2) 826 + static struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2) 833 827 { 834 828 struct expr *tmp = NULL; 835 829 expr_extract_eq(E_AND, &tmp, ep1, ep2); ··· 840 834 return tmp; 841 835 } 842 836 843 - struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2) 837 + static struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2) 844 838 { 845 839 struct expr *tmp = NULL; 846 840 expr_extract_eq(E_OR, &tmp, ep1, ep2); ··· 851 845 return tmp; 852 846 } 853 847 854 - void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2) 848 + static void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2) 855 849 { 856 850 #define e1 (*ep1) 857 851 #define e2 (*ep2) ··· 982 976 } 983 977 } 984 978 985 - int expr_compare_type(enum expr_type t1, enum expr_type t2) 979 + static int expr_compare_type(enum expr_type t1, enum expr_type t2) 986 980 { 987 - #if 0 988 - return 1; 989 - #else 990 981 if (t1 == t2) 991 982 return 0; 992 983 switch (t1) { ··· 1008 1005 } 1009 1006 printf("[%dgt%d?]", t1, t2); 1010 1007 return 0; 1011 - #endif 1012 1008 } 1013 1009 1014 1010 static inline struct expr *
-5
scripts/kconfig/expr.h
··· 205 205 struct expr *expr_alloc_or(struct expr *e1, struct expr *e2); 206 206 struct expr *expr_copy(const struct expr *org); 207 207 void expr_free(struct expr *e); 208 - int expr_eq(struct expr *e1, struct expr *e2); 209 208 void expr_eliminate_eq(struct expr **ep1, struct expr **ep2); 210 209 tristate expr_calc_value(struct expr *e); 211 - struct expr *expr_eliminate_yn(struct expr *e); 212 210 struct expr *expr_trans_bool(struct expr *e); 213 211 struct expr *expr_eliminate_dups(struct expr *e); 214 212 struct expr *expr_transform(struct expr *e); 215 213 int expr_contains_symbol(struct expr *dep, struct symbol *sym); 216 214 bool expr_depends_symbol(struct expr *dep, struct symbol *sym); 217 - struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2); 218 - struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2); 219 - void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2); 220 215 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym); 221 216 struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2); 222 217
+4 -25
scripts/kconfig/gconf.c
··· 169 169 style = gtk_widget_get_style(main_wnd); 170 170 widget = glade_xml_get_widget(xml, "toolbar1"); 171 171 172 - #if 0 /* Use stock Gtk icons instead */ 173 - replace_button_icon(xml, main_wnd->window, style, 174 - "button1", (gchar **) xpm_back); 175 - replace_button_icon(xml, main_wnd->window, style, 176 - "button2", (gchar **) xpm_load); 177 - replace_button_icon(xml, main_wnd->window, style, 178 - "button3", (gchar **) xpm_save); 179 - #endif 180 172 replace_button_icon(xml, main_wnd->window, style, 181 173 "button4", (gchar **) xpm_single_view); 182 174 replace_button_icon(xml, main_wnd->window, style, ··· 176 184 replace_button_icon(xml, main_wnd->window, style, 177 185 "button6", (gchar **) xpm_tree_view); 178 186 179 - #if 0 180 - switch (view_mode) { 181 - case SINGLE_VIEW: 182 - widget = glade_xml_get_widget(xml, "button4"); 183 - g_signal_emit_by_name(widget, "clicked"); 184 - break; 185 - case SPLIT_VIEW: 186 - widget = glade_xml_get_widget(xml, "button5"); 187 - g_signal_emit_by_name(widget, "clicked"); 188 - break; 189 - case FULL_VIEW: 190 - widget = glade_xml_get_widget(xml, "button6"); 191 - g_signal_emit_by_name(widget, "clicked"); 192 - break; 193 - } 194 - #endif 195 187 txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w)); 196 188 tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1", 197 189 "foreground", "red", ··· 1474 1498 case 'a': 1475 1499 //showAll = 1; 1476 1500 break; 1501 + case 's': 1502 + conf_set_message_callback(NULL); 1503 + break; 1477 1504 case 'h': 1478 1505 case '?': 1479 - printf("%s <config>\n", av[0]); 1506 + printf("%s [-s] <config>\n", av[0]); 1480 1507 exit(0); 1481 1508 } 1482 1509 name = av[2];
-14
scripts/kconfig/lkc.h
··· 21 21 extern "C" { 22 22 #endif 23 23 24 - #define P(name,type,arg) extern type name arg 25 24 #include "lkc_proto.h" 26 - #undef P 27 25 28 26 #define SRCTREE "srctree" 29 27 ··· 68 70 enum symbol_type stype; 69 71 }; 70 72 71 - extern int zconfdebug; 72 - 73 - int zconfparse(void); 74 73 void zconfdump(FILE *out); 75 74 void zconf_starthelp(void); 76 75 FILE *zconf_fopen(const char *name); ··· 84 89 void sym_add_change_count(int count); 85 90 bool conf_set_all_new_symbols(enum conf_def_mode mode); 86 91 void set_all_choice_values(struct symbol *csym); 87 - 88 - struct conf_printer { 89 - void (*print_symbol)(FILE *, struct symbol *, const char *, void *); 90 - void (*print_comment)(FILE *, const char *, void *); 91 - }; 92 92 93 93 /* confdata.c and expr.c */ 94 94 static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) ··· 103 113 void menu_end_entry(void); 104 114 void menu_add_dep(struct expr *dep); 105 115 void menu_add_visibility(struct expr *dep); 106 - struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep); 107 116 struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); 108 117 void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); 109 118 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); ··· 126 137 int max_width; 127 138 }; 128 139 struct gstr str_new(void); 129 - struct gstr str_assign(const char *s); 130 140 void str_free(struct gstr *gs); 131 141 void str_append(struct gstr *gs, const char *s); 132 142 void str_printf(struct gstr *gs, const char *fmt, ...); ··· 136 148 137 149 void sym_init(void); 138 150 void sym_clear_all_valid(void); 139 - void sym_set_all_changed(void); 140 - void sym_set_changed(struct symbol *sym); 141 151 struct symbol *sym_choice_default(struct symbol *sym); 142 152 const char *sym_get_string_default(struct symbol *sym); 143 153 struct symbol *sym_check_deps(struct symbol *sym);
+40 -45
scripts/kconfig/lkc_proto.h
··· 1 1 #include <stdarg.h> 2 2 3 3 /* confdata.c */ 4 - P(conf_parse,void,(const char *name)); 5 - P(conf_read,int,(const char *name)); 6 - P(conf_read_simple,int,(const char *name, int)); 7 - P(conf_write_defconfig,int,(const char *name)); 8 - P(conf_write,int,(const char *name)); 9 - P(conf_write_autoconf,int,(void)); 10 - P(conf_get_changed,bool,(void)); 11 - P(conf_set_changed_callback, void,(void (*fn)(void))); 12 - P(conf_set_message_callback, void,(void (*fn)(const char *fmt, va_list ap))); 4 + void conf_parse(const char *name); 5 + int conf_read(const char *name); 6 + int conf_read_simple(const char *name, int); 7 + int conf_write_defconfig(const char *name); 8 + int conf_write(const char *name); 9 + int conf_write_autoconf(void); 10 + bool conf_get_changed(void); 11 + void conf_set_changed_callback(void (*fn)(void)); 12 + void conf_set_message_callback(void (*fn)(const char *fmt, va_list ap)); 13 13 14 14 /* menu.c */ 15 - P(rootmenu,struct menu,); 15 + extern struct menu rootmenu; 16 16 17 - P(menu_is_empty, bool, (struct menu *menu)); 18 - P(menu_is_visible, bool, (struct menu *menu)); 19 - P(menu_has_prompt, bool, (struct menu *menu)); 20 - P(menu_get_prompt,const char *,(struct menu *menu)); 21 - P(menu_get_root_menu,struct menu *,(struct menu *menu)); 22 - P(menu_get_parent_menu,struct menu *,(struct menu *menu)); 23 - P(menu_has_help,bool,(struct menu *menu)); 24 - P(menu_get_help,const char *,(struct menu *menu)); 25 - P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct list_head 26 - *head)); 27 - P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct list_head 28 - *head)); 29 - P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); 17 + bool menu_is_empty(struct menu *menu); 18 + bool menu_is_visible(struct menu *menu); 19 + bool menu_has_prompt(struct menu *menu); 20 + const char * menu_get_prompt(struct menu *menu); 21 + struct menu * menu_get_root_menu(struct menu *menu); 22 + struct menu * menu_get_parent_menu(struct menu *menu); 23 + bool menu_has_help(struct menu *menu); 24 + const char * menu_get_help(struct menu *menu); 25 + struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head); 26 + void menu_get_ext_help(struct menu *menu, struct gstr *help); 30 27 31 28 /* symbol.c */ 32 - P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); 29 + extern struct symbol * symbol_hash[SYMBOL_HASHSIZE]; 33 30 34 - P(sym_lookup,struct symbol *,(const char *name, int flags)); 35 - P(sym_find,struct symbol *,(const char *name)); 36 - P(sym_expand_string_value,const char *,(const char *in)); 37 - P(sym_escape_string_value, const char *,(const char *in)); 38 - P(sym_re_search,struct symbol **,(const char *pattern)); 39 - P(sym_type_name,const char *,(enum symbol_type type)); 40 - P(sym_calc_value,void,(struct symbol *sym)); 41 - P(sym_get_type,enum symbol_type,(struct symbol *sym)); 42 - P(sym_tristate_within_range,bool,(struct symbol *sym,tristate tri)); 43 - P(sym_set_tristate_value,bool,(struct symbol *sym,tristate tri)); 44 - P(sym_toggle_tristate_value,tristate,(struct symbol *sym)); 45 - P(sym_string_valid,bool,(struct symbol *sym, const char *newval)); 46 - P(sym_string_within_range,bool,(struct symbol *sym, const char *str)); 47 - P(sym_set_string_value,bool,(struct symbol *sym, const char *newval)); 48 - P(sym_is_changable,bool,(struct symbol *sym)); 49 - P(sym_get_choice_prop,struct property *,(struct symbol *sym)); 50 - P(sym_get_default_prop,struct property *,(struct symbol *sym)); 51 - P(sym_get_string_value,const char *,(struct symbol *sym)); 31 + struct symbol * sym_lookup(const char *name, int flags); 32 + struct symbol * sym_find(const char *name); 33 + const char * sym_expand_string_value(const char *in); 34 + const char * sym_escape_string_value(const char *in); 35 + struct symbol ** sym_re_search(const char *pattern); 36 + const char * sym_type_name(enum symbol_type type); 37 + void sym_calc_value(struct symbol *sym); 38 + enum symbol_type sym_get_type(struct symbol *sym); 39 + bool sym_tristate_within_range(struct symbol *sym,tristate tri); 40 + bool sym_set_tristate_value(struct symbol *sym,tristate tri); 41 + tristate sym_toggle_tristate_value(struct symbol *sym); 42 + bool sym_string_valid(struct symbol *sym, const char *newval); 43 + bool sym_string_within_range(struct symbol *sym, const char *str); 44 + bool sym_set_string_value(struct symbol *sym, const char *newval); 45 + bool sym_is_changable(struct symbol *sym); 46 + struct property * sym_get_choice_prop(struct symbol *sym); 47 + const char * sym_get_string_value(struct symbol *sym); 52 48 53 - P(prop_get_type_name,const char *,(enum prop_type type)); 49 + const char * prop_get_type_name(enum prop_type type); 54 50 55 51 /* expr.c */ 56 - P(expr_compare_type,int,(enum expr_type t1, enum expr_type t2)); 57 - P(expr_print,void,(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken)); 52 + void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken);
+21 -10
scripts/kconfig/mconf.c
··· 279 279 static int single_menu_mode; 280 280 static int show_all_options; 281 281 static int save_and_exit; 282 + static int silent; 282 283 283 284 static void conf(struct menu *menu, struct menu *active_menu); 284 285 static void conf_choice(struct menu *menu); ··· 778 777 char buf[PATH_MAX+1]; 779 778 780 779 vsnprintf(buf, sizeof(buf), fmt, ap); 781 - if (save_and_exit) 782 - printf("%s", buf); 783 - else 780 + if (save_and_exit) { 781 + if (!silent) 782 + printf("%s", buf); 783 + } else { 784 784 show_textbox(NULL, buf, 6, 60); 785 + } 785 786 } 786 787 787 788 static void show_help(struct menu *menu) ··· 980 977 } 981 978 /* fall through */ 982 979 case -1: 983 - printf(_("\n\n" 984 - "*** End of the configuration.\n" 985 - "*** Execute 'make' to start the build or try 'make help'." 986 - "\n\n")); 980 + if (!silent) 981 + printf(_("\n\n" 982 + "*** End of the configuration.\n" 983 + "*** Execute 'make' to start the build or try 'make help'." 984 + "\n\n")); 987 985 res = 0; 988 986 break; 989 987 default: 990 - fprintf(stderr, _("\n\n" 991 - "Your configuration changes were NOT saved." 992 - "\n\n")); 988 + if (!silent) 989 + fprintf(stderr, _("\n\n" 990 + "Your configuration changes were NOT saved." 991 + "\n\n")); 993 992 if (res != KEY_ESC) 994 993 res = 0; 995 994 } ··· 1015 1010 1016 1011 signal(SIGINT, sig_handler); 1017 1012 1013 + if (ac > 1 && strcmp(av[1], "-s") == 0) { 1014 + silent = 1; 1015 + /* Silence conf_read() until the real callback is set up */ 1016 + conf_set_message_callback(NULL); 1017 + av++; 1018 + } 1018 1019 conf_parse(av[1]); 1019 1020 conf_read(NULL); 1020 1021
+2 -2
scripts/kconfig/menu.c
··· 125 125 sym_type_name(sym->type), sym_type_name(type)); 126 126 } 127 127 128 - struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep) 128 + static struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep) 129 129 { 130 130 struct property *prop = prop_alloc(type, current_entry->sym); 131 131 ··· 615 615 /* 616 616 * head is optional and may be NULL 617 617 */ 618 - void get_symbol_str(struct gstr *r, struct symbol *sym, 618 + static void get_symbol_str(struct gstr *r, struct symbol *sym, 619 619 struct list_head *head) 620 620 { 621 621 bool hit;
+15 -12
scripts/kconfig/merge_config.sh
··· 35 35 echo " -O dir to put generated output files" 36 36 } 37 37 38 - MAKE=true 38 + RUNMAKE=true 39 39 ALLTARGET=alldefconfig 40 40 WARNREDUN=false 41 41 OUTPUT=. ··· 48 48 continue 49 49 ;; 50 50 "-m") 51 - MAKE=false 51 + RUNMAKE=false 52 52 shift 53 53 continue 54 54 ;; ··· 85 85 INITFILE=$1 86 86 shift; 87 87 88 + if [ ! -r "$INITFILE" ]; then 89 + echo "The base file '$INITFILE' does not exist. Exit." >&2 90 + exit 1 91 + fi 92 + 88 93 MERGE_LIST=$* 89 94 SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" 90 95 TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) ··· 97 92 echo "Using $INITFILE as base" 98 93 cat $INITFILE > $TMP_FILE 99 94 100 - # Merge files, printing warnings on overrided values 95 + # Merge files, printing warnings on overridden values 101 96 for MERGE_FILE in $MERGE_LIST ; do 102 97 echo "Merging $MERGE_FILE" 103 98 CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE) 104 99 105 100 for CFG in $CFG_LIST ; do 106 - grep -q -w $CFG $TMP_FILE 107 - if [ $? -eq 0 ] ; then 108 - PREV_VAL=$(grep -w $CFG $TMP_FILE) 109 - NEW_VAL=$(grep -w $CFG $MERGE_FILE) 110 - if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then 101 + grep -q -w $CFG $TMP_FILE || continue 102 + PREV_VAL=$(grep -w $CFG $TMP_FILE) 103 + NEW_VAL=$(grep -w $CFG $MERGE_FILE) 104 + if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then 111 105 echo Value of $CFG is redefined by fragment $MERGE_FILE: 112 106 echo Previous value: $PREV_VAL 113 107 echo New value: $NEW_VAL 114 108 echo 115 - elif [ "$WARNREDUN" = "true" ]; then 109 + elif [ "$WARNREDUN" = "true" ]; then 116 110 echo Value of $CFG is redundant by fragment $MERGE_FILE: 117 - fi 118 - sed -i "/$CFG[ =]/d" $TMP_FILE 119 111 fi 112 + sed -i "/$CFG[ =]/d" $TMP_FILE 120 113 done 121 114 cat $MERGE_FILE >> $TMP_FILE 122 115 done 123 116 124 - if [ "$MAKE" = "false" ]; then 117 + if [ "$RUNMAKE" = "false" ]; then 125 118 cp $TMP_FILE $OUTPUT/.config 126 119 echo "#" 127 120 echo "# merged configuration written to $OUTPUT/.config (needs make)"
+5
scripts/kconfig/nconf.c
··· 1482 1482 bindtextdomain(PACKAGE, LOCALEDIR); 1483 1483 textdomain(PACKAGE); 1484 1484 1485 + if (ac > 1 && strcmp(av[1], "-s") == 0) { 1486 + /* Silence conf_read() until the real callback is set up */ 1487 + conf_set_message_callback(NULL); 1488 + av++; 1489 + } 1485 1490 conf_parse(av[1]); 1486 1491 conf_read(NULL); 1487 1492
+4 -1
scripts/kconfig/qconf.cc
··· 1746 1746 1747 1747 static void usage(void) 1748 1748 { 1749 - printf(_("%s <config>\n"), progname); 1749 + printf(_("%s [-s] <config>\n"), progname); 1750 1750 exit(0); 1751 1751 } 1752 1752 ··· 1762 1762 configApp = new QApplication(ac, av); 1763 1763 if (ac > 1 && av[1][0] == '-') { 1764 1764 switch (av[1][1]) { 1765 + case 's': 1766 + conf_set_message_callback(NULL); 1767 + break; 1765 1768 case 'h': 1766 1769 case '?': 1767 1770 usage();
+21 -21
scripts/kconfig/symbol.c
··· 112 112 return NULL; 113 113 } 114 114 115 - struct property *sym_get_default_prop(struct symbol *sym) 115 + static struct property *sym_get_default_prop(struct symbol *sym) 116 116 { 117 117 struct property *prop; 118 118 ··· 184 184 else 185 185 sprintf(str, "0x%llx", val2); 186 186 sym->curr.val = strdup(str); 187 + } 188 + 189 + static void sym_set_changed(struct symbol *sym) 190 + { 191 + struct property *prop; 192 + 193 + sym->flags |= SYMBOL_CHANGED; 194 + for (prop = sym->prop; prop; prop = prop->next) { 195 + if (prop->menu) 196 + prop->menu->flags |= MENU_CHANGED; 197 + } 198 + } 199 + 200 + static void sym_set_all_changed(void) 201 + { 202 + struct symbol *sym; 203 + int i; 204 + 205 + for_all_symbols(i, sym) 206 + sym_set_changed(sym); 187 207 } 188 208 189 209 static void sym_calc_visibility(struct symbol *sym) ··· 469 449 sym_add_change_count(1); 470 450 if (modules_sym) 471 451 sym_calc_value(modules_sym); 472 - } 473 - 474 - void sym_set_changed(struct symbol *sym) 475 - { 476 - struct property *prop; 477 - 478 - sym->flags |= SYMBOL_CHANGED; 479 - for (prop = sym->prop; prop; prop = prop->next) { 480 - if (prop->menu) 481 - prop->menu->flags |= MENU_CHANGED; 482 - } 483 - } 484 - 485 - void sym_set_all_changed(void) 486 - { 487 - struct symbol *sym; 488 - int i; 489 - 490 - for_all_symbols(i, sym) 491 - sym_set_changed(sym); 492 452 } 493 453 494 454 bool sym_tristate_within_range(struct symbol *sym, tristate val)
-10
scripts/kconfig/util.c
··· 88 88 return gs; 89 89 } 90 90 91 - /* Allocate and assign growable string */ 92 - struct gstr str_assign(const char *s) 93 - { 94 - struct gstr gs; 95 - gs.s = strdup(s); 96 - gs.len = strlen(s) + 1; 97 - gs.max_width = 0; 98 - return gs; 99 - } 100 - 101 91 /* Free storage for growable string */ 102 92 void str_free(struct gstr *gs) 103 93 {