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