History

Merge branch 'kconfig-trivial' of git://github.com/lacombar/linux-2.6 into kbuild/kconfig

Michal Marek committed 15 years ago

Commit 36fee532 parents a61944c 1ea3ad419 files · +26 −112Browse files

Showing the changes to scripts (19 of 19 files). Show all

Unified · Split

19 files
  1. scripts/kconfig/Makefile +8 −15
  2. scripts/kconfig/conf.c +4 −1
  3. scripts/kconfig/confdata.c +7 −2
  4. scripts/kconfig/expr.c +0 −1
  5. scripts/kconfig/expr.h +0 −3
  6. scripts/kconfig/gconf.c +1 −37
  7. scripts/kconfig/kconfig_load.c +0 −35
  8. scripts/kconfig/kxgettext.c +0 −1
  9. scripts/kconfig/lex.zconf.c_shipped +0 −1
  10. scripts/kconfig/lkc.h +0 −5
  11. scripts/kconfig/mconf.c +1 −1
  12. scripts/kconfig/menu.c +2 −1
  13. scripts/kconfig/nconf.c +1 −1
  14. scripts/kconfig/qconf.cc +0 −4
  15. scripts/kconfig/symbol.c +0 −1
  16. scripts/kconfig/util.c +2 −0
  17. scripts/kconfig/zconf.l +0 −1
  18. scripts/kconfig/zconf.tab.c_shipped +0 −1
  19. scripts/kconfig/zconf.y +0 −1
scripts/kconfig/Makefile+8−15
@@ -170,8 +170,8 @@ mconf-objs := mconf.o zconf.tab.o $(lxdialog) · 169 unmodified lines
170nconf-objs := nconf.o zconf.tab.o nconf.gui.o170nconf-objs := nconf.o zconf.tab.o nconf.gui.o
171kxgettext-objs := kxgettext.o zconf.tab.o171kxgettext-objs := kxgettext.o zconf.tab.o
172qconf-cxxobjs := qconf.o172qconf-cxxobjs := qconf.o
173qconf-objs := kconfig_load.o zconf.tab.o173qconf-objs := zconf.tab.o
174gconf-objs := gconf.o kconfig_load.o zconf.tab.o174gconf-objs := gconf.o zconf.tab.o
175 175
176hostprogs-y := conf176hostprogs-y := conf
177 177
@@ -203,7 +203,7 @@ ifeq ($(gconf-target),1) · 25 unmodified lines
203 hostprogs-y += gconf203 hostprogs-y += gconf
204endif204endif
205 205
206clean-files := lkc_defs.h qconf.moc .tmp_qtcheck .tmp_gtkcheck206clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck
207clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h207clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
208clean-files += mconf qconf gconf nconf208clean-files += mconf qconf gconf nconf
209clean-files += config.pot linux.pot209clean-files += config.pot linux.pot
@@ -223,12 +223,12 @@ HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) · 13 unmodified lines
223HOSTCFLAGS_lex.zconf.o := -I$(src)223HOSTCFLAGS_lex.zconf.o := -I$(src)
224HOSTCFLAGS_zconf.tab.o := -I$(src)224HOSTCFLAGS_zconf.tab.o := -I$(src)
225 225
226HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl226HOSTLOADLIBES_qconf = $(KC_QT_LIBS)
227HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK227HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS)
228 228
229HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` -ldl229HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
230HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \230HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
231 -D LKC_DIRECT_LINK231 -Wno-missing-prototypes
232 232
233HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))233HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
234 234
@@ -318,18 +318,11 @@ endif · 83 unmodified lines
318 318
319$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c319$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c
320 320
321$(obj)/kconfig_load.o: $(obj)/lkc_defs.h321$(obj)/qconf.o: $(obj)/qconf.moc
322
323$(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
324
325$(obj)/gconf.o: $(obj)/lkc_defs.h
326 322
327$(obj)/%.moc: $(src)/%.h323$(obj)/%.moc: $(src)/%.h
328 $(KC_QT_MOC) -i $< -o $@324 $(KC_QT_MOC) -i $< -o $@
329 325
330$(obj)/lkc_defs.h: $(src)/lkc_proto.h
331 $(Q)sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
332
333# Extract gconf menu items for I18N support326# Extract gconf menu items for I18N support
334$(obj)/gconf.glade.h: $(obj)/gconf.glade327$(obj)/gconf.glade.h: $(obj)/gconf.glade
335 $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \328 $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
scripts/kconfig/conf.c+4−1
@@ -14,7 +14,6 @@ · 13 unmodified lines
14#include <sys/stat.h>14#include <sys/stat.h>
15#include <sys/time.h>15#include <sys/time.h>
16 16
17#define LKC_DIRECT_LINK
18#include "lkc.h"17#include "lkc.h"
19 18
20static void conf(struct menu *menu);19static void conf(struct menu *menu);
@@ -106,6 +105,7 @@ static int conf_askvalue(struct symbol *sym, const char *def) · 85 unmodified lines
106 return 0;105 return 0;
107 }106 }
108 check_stdin();107 check_stdin();
108 /* fall through */
109 case oldaskconfig:109 case oldaskconfig:
110 fflush(stdout);110 fflush(stdout);
111 xfgets(line, 128, stdin);111 xfgets(line, 128, stdin);
@@ -150,6 +150,7 @@ static int conf_string(struct menu *menu) · 38 unmodified lines
150 def = NULL;150 def = NULL;
151 break;151 break;
152 }152 }
153 /* fall through */
153 default:154 default:
154 line[strlen(line)-1] = 0;155 line[strlen(line)-1] = 0;
155 def = line;156 def = line;
@@ -304,6 +305,7 @@ static int conf_choice(struct menu *menu) · 148 unmodified lines
304 break;305 break;
305 }306 }
306 check_stdin();307 check_stdin();
308 /* fall through */
307 case oldaskconfig:309 case oldaskconfig:
308 fflush(stdout);310 fflush(stdout);
309 xfgets(line, 128, stdin);311 xfgets(line, 128, stdin);
@@ -369,6 +371,7 @@ static void conf(struct menu *menu) · 59 unmodified lines
369 check_conf(menu);371 check_conf(menu);
370 return;372 return;
371 }373 }
374 /* fall through */
372 case P_COMMENT:375 case P_COMMENT:
373 prompt = menu_get_prompt(menu);376 prompt = menu_get_prompt(menu);
374 if (prompt)377 if (prompt)
scripts/kconfig/confdata.c+7−2
@@ -7,13 +7,13 @@ · 6 unmodified lines
7#include <ctype.h>7#include <ctype.h>
8#include <errno.h>8#include <errno.h>
9#include <fcntl.h>9#include <fcntl.h>
10#include <stdarg.h>
10#include <stdio.h>11#include <stdio.h>
11#include <stdlib.h>12#include <stdlib.h>
12#include <string.h>13#include <string.h>
13#include <time.h>14#include <time.h>
14#include <unistd.h>15#include <unistd.h>
15 16
16#define LKC_DIRECT_LINK
17#include "lkc.h"17#include "lkc.h"
18 18
19static void conf_warning(const char *fmt, ...)19static void conf_warning(const char *fmt, ...)
@@ -128,6 +128,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 108 unmodified lines
128 sym->flags |= def_flags;128 sym->flags |= def_flags;
129 break;129 break;
130 }130 }
131 /* fall through */
131 case S_BOOLEAN:132 case S_BOOLEAN:
132 if (p[0] == 'y') {133 if (p[0] == 'y') {
133 sym->def[def].tri = yes;134 sym->def[def].tri = yes;
@@ -140,7 +141,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 6 unmodified lines
140 break;141 break;
141 }142 }
142 conf_warning("symbol value '%s' invalid for %s", p, sym->name);143 conf_warning("symbol value '%s' invalid for %s", p, sym->name);
143 break;144 return 1;
144 case S_OTHER:145 case S_OTHER:
145 if (*p != '"') {146 if (*p != '"') {
146 for (p2 = p; *p2 && !isspace(*p2); p2++)147 for (p2 = p; *p2 && !isspace(*p2); p2++)
@@ -148,6 +149,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 1 unmodified line
148 sym->type = S_STRING;149 sym->type = S_STRING;
149 goto done;150 goto done;
150 }151 }
152 /* fall through */
151 case S_STRING:153 case S_STRING:
152 if (*p++ != '"')154 if (*p++ != '"')
153 break;155 break;
@@ -162,6 +164,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 8 unmodified lines
162 conf_warning("invalid string found");164 conf_warning("invalid string found");
163 return 1;165 return 1;
164 }166 }
167 /* fall through */
165 case S_INT:168 case S_INT:
166 case S_HEX:169 case S_HEX:
167 done:170 done:
@@ -237,6 +240,7 @@ load: · 69 unmodified lines
237 case S_STRING:240 case S_STRING:
238 if (sym->def[def].val)241 if (sym->def[def].val)
239 free(sym->def[def].val);242 free(sym->def[def].val);
243 /* fall through */
240 default:244 default:
241 sym->def[def].val = NULL;245 sym->def[def].val = NULL;
242 sym->def[def].tri = no;246 sym->def[def].tri = no;
@@ -363,6 +367,7 @@ int conf_read(const char *name) · 120 unmodified lines
363 break;367 break;
364 if (!sym_is_choice(sym))368 if (!sym_is_choice(sym))
365 goto sym_ok;369 goto sym_ok;
370 /* fall through */
366 default:371 default:
367 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val))372 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val))
368 goto sym_ok;373 goto sym_ok;
scripts/kconfig/expr.c+0−1
@@ -7,7 +7,6 @@ · 6 unmodified lines
7#include <stdlib.h>7#include <stdlib.h>
8#include <string.h>8#include <string.h>
9 9
10#define LKC_DIRECT_LINK
11#include "lkc.h"10#include "lkc.h"
12 11
13#define DEBUG_EXPR 012#define DEBUG_EXPR 0
scripts/kconfig/expr.h+0−3
@@ -172,8 +172,6 @@ struct menu { · 171 unmodified lines
172#define MENU_CHANGED 0x0001172#define MENU_CHANGED 0x0001
173#define MENU_ROOT 0x0002173#define MENU_ROOT 0x0002
174 174
175#ifndef SWIG
176
177extern struct file *file_list;175extern struct file *file_list;
178extern struct file *current_file;176extern struct file *current_file;
179struct file *lookup_file(const char *name);177struct file *lookup_file(const char *name);
@@ -218,7 +216,6 @@ static inline int expr_is_no(struct expr *e) · 38 unmodified lines
218{216{
219 return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no);217 return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no);
220}218}
221#endif
222 219
223#ifdef __cplusplus220#ifdef __cplusplus
224}221}
scripts/kconfig/gconf.c+1−37
@@ -285,8 +285,6 @@ void init_left_tree(void) · 284 unmodified lines
285static void renderer_edited(GtkCellRendererText * cell,285static void renderer_edited(GtkCellRendererText * cell,
286 const gchar * path_string,286 const gchar * path_string,
287 const gchar * new_text, gpointer user_data);287 const gchar * new_text, gpointer user_data);
288static void renderer_toggled(GtkCellRendererToggle * cellrenderertoggle,
289 gchar * arg1, gpointer user_data);
290 288
291void init_right_tree(void)289void init_right_tree(void)
292{290{
@@ -320,8 +318,6 @@ void init_right_tree(void) · 27 unmodified lines
320 "inconsistent", COL_BTNINC,318 "inconsistent", COL_BTNINC,
321 "visible", COL_BTNVIS,319 "visible", COL_BTNVIS,
322 "radio", COL_BTNRAD, NULL);320 "radio", COL_BTNRAD, NULL);
323 /*g_signal_connect(G_OBJECT(renderer), "toggled",
324 G_CALLBACK(renderer_toggled), NULL); */
325 renderer = gtk_cell_renderer_text_new();321 renderer = gtk_cell_renderer_text_new();
326 gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),322 gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
327 renderer, FALSE);323 renderer, FALSE);
@@ -888,35 +884,6 @@ static void toggle_sym_value(struct menu *menu) · 560 unmodified lines
888 display_tree_part(); //fixme: keep exp/coll884 display_tree_part(); //fixme: keep exp/coll
889}885}
890 886
891static void renderer_toggled(GtkCellRendererToggle * cell,
892 gchar * path_string, gpointer user_data)
893{
894 GtkTreePath *path, *sel_path = NULL;
895 GtkTreeIter iter, sel_iter;
896 GtkTreeSelection *sel;
897 struct menu *menu;
898
899 path = gtk_tree_path_new_from_string(path_string);
900 if (!gtk_tree_model_get_iter(model2, &iter, path))
901 return;
902
903 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree2_w));
904 if (gtk_tree_selection_get_selected(sel, NULL, &sel_iter))
905 sel_path = gtk_tree_model_get_path(model2, &sel_iter);
906 if (!sel_path)
907 goto out1;
908 if (gtk_tree_path_compare(path, sel_path))
909 goto out2;
910
911 gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
912 toggle_sym_value(menu);
913
914 out2:
915 gtk_tree_path_free(sel_path);
916 out1:
917 gtk_tree_path_free(path);
918}
919
920static gint column2index(GtkTreeViewColumn * column)887static gint column2index(GtkTreeViewColumn * column)
921{888{
922 gint i;889 gint i;
@@ -1172,6 +1139,7 @@ static gchar **fill_row(struct menu *menu) · 249 unmodified lines
1172 row[COL_BTNVIS] = GINT_TO_POINTER(TRUE);1139 row[COL_BTNVIS] = GINT_TO_POINTER(TRUE);
1173 if (sym_is_choice(sym))1140 if (sym_is_choice(sym))
1174 break;1141 break;
1142 /* fall through */
1175 case S_TRISTATE:1143 case S_TRISTATE:
1176 val = sym_get_tristate_value(sym);1144 val = sym_get_tristate_value(sym);
1177 switch (val) {1145 switch (val) {
@@ -1506,10 +1474,6 @@ int main(int ac, char *av[]) · 328 unmodified lines
1506 char *env;1474 char *env;
1507 gchar *glade_file;1475 gchar *glade_file;
1508 1476
1509#ifndef LKC_DIRECT_LINK
1510 kconfig_load();
1511#endif
1512
1513 bindtextdomain(PACKAGE, LOCALEDIR);1477 bindtextdomain(PACKAGE, LOCALEDIR);
1514 bind_textdomain_codeset(PACKAGE, "UTF-8");1478 bind_textdomain_codeset(PACKAGE, "UTF-8");
1515 textdomain(PACKAGE);1479 textdomain(PACKAGE);
scripts/kconfig/kconfig_load.c+0−35
@@ -1,35 +0,0 @@
1#include <dlfcn.h>
2#include <stdio.h>
3#include <stdlib.h>
4
5#include "lkc.h"
6
7#define P(name,type,arg) type (*name ## _p) arg
8#include "lkc_proto.h"
9#undef P
10
11void kconfig_load(void)
12{
13 void *handle;
14 char *error;
15
16 handle = dlopen("./libkconfig.so", RTLD_LAZY);
17 if (!handle) {
18 handle = dlopen("./scripts/kconfig/libkconfig.so", RTLD_LAZY);
19 if (!handle) {
20 fprintf(stderr, "%s\n", dlerror());
21 exit(1);
22 }
23 }
24
25#define P(name,type,arg) \
26{ \
27 name ## _p = dlsym(handle, #name); \
28 if ((error = dlerror())) { \
29 fprintf(stderr, "%s\n", error); \
30 exit(1); \
31 } \
32}
33#include "lkc_proto.h"
34#undef P
35}
scripts/kconfig/kxgettext.c+0−1
@@ -7,7 +7,6 @@ · 6 unmodified lines
7#include <stdlib.h>7#include <stdlib.h>
8#include <string.h>8#include <string.h>
9 9
10#define LKC_DIRECT_LINK
11#include "lkc.h"10#include "lkc.h"
12 11
13static char *escape(const char* text, char *bf, int len)12static char *escape(const char* text, char *bf, int len)
scripts/kconfig/lex.zconf.c_shipped+0−1
@@ -785,7 +785,6 @@ char *zconftext; · 784 unmodified lines
785#include <string.h>785#include <string.h>
786#include <unistd.h>786#include <unistd.h>
787 787
788#define LKC_DIRECT_LINK
789#include "lkc.h"788#include "lkc.h"
790 789
791#define START_STRSIZE 16790#define START_STRSIZE 16
scripts/kconfig/lkc.h+0−5
@@ -21,12 +21,7 @@ static inline char *bind_textdomain_codeset(const char *dn, char *c) { return c; · 20 unmodified lines
21extern "C" {21extern "C" {
22#endif22#endif
23 23
24#ifdef LKC_DIRECT_LINK
25#define P(name,type,arg) extern type name arg24#define P(name,type,arg) extern type name arg
26#else
27#include "lkc_defs.h"
28#define P(name,type,arg) extern type (*name ## _p) arg
29#endif
30#include "lkc_proto.h"25#include "lkc_proto.h"
31#undef P26#undef P
32 27
scripts/kconfig/mconf.c+1−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
18#include <unistd.h>18#include <unistd.h>
19#include <locale.h>19#include <locale.h>
20 20
21#define LKC_DIRECT_LINK
22#include "lkc.h"21#include "lkc.h"
23#include "lxdialog/dialog.h"22#include "lxdialog/dialog.h"
24 23
@@ -845,6 +844,7 @@ int main(int ac, char **av) · 820 unmodified lines
845 "\n\n"));844 "\n\n"));
846 return 1;845 return 1;
847 }846 }
847 /* fall through */
848 case -1:848 case -1:
849 printf(_("\n\n"849 printf(_("\n\n"
850 "*** End of the configuration.\n"850 "*** End of the configuration.\n"
scripts/kconfig/menu.c+2−1
@@ -3,10 +3,11 @@ · 2 unmodified lines
3 * Released under the terms of the GNU GPL v2.0.3 * Released under the terms of the GNU GPL v2.0.
4 */4 */
5 5
6#include <ctype.h>
7#include <stdarg.h>
6#include <stdlib.h>8#include <stdlib.h>
7#include <string.h>9#include <string.h>
8 10
9#define LKC_DIRECT_LINK
10#include "lkc.h"11#include "lkc.h"
11 12
12static const char nohelp_text[] = N_(13static const char nohelp_text[] = N_(
scripts/kconfig/nconf.c+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
7 */7 */
8#define _GNU_SOURCE8#define _GNU_SOURCE
9#include <string.h>9#include <string.h>
10#define LKC_DIRECT_LINK10
11#include "lkc.h"11#include "lkc.h"
12#include "nconf.h"12#include "nconf.h"
13#include <ctype.h>13#include <ctype.h>
scripts/kconfig/qconf.cc+0−4
@@ -1745,10 +1745,6 @@ int main(int ac, char** av) · 1744 unmodified lines
1745 bindtextdomain(PACKAGE, LOCALEDIR);1745 bindtextdomain(PACKAGE, LOCALEDIR);
1746 textdomain(PACKAGE);1746 textdomain(PACKAGE);
1747 1747
1748#ifndef LKC_DIRECT_LINK
1749 kconfig_load();
1750#endif
1751
1752 progname = av[0];1748 progname = av[0];
1753 configApp = new QApplication(ac, av);1749 configApp = new QApplication(ac, av);
1754 if (ac > 1 && av[1][0] == '-') {1750 if (ac > 1 && av[1][0] == '-') {
scripts/kconfig/symbol.c+0−1
@@ -9,7 +9,6 @@ · 8 unmodified lines
9#include <regex.h>9#include <regex.h>
10#include <sys/utsname.h>10#include <sys/utsname.h>
11 11
12#define LKC_DIRECT_LINK
13#include "lkc.h"12#include "lkc.h"
14 13
15struct symbol symbol_yes = {14struct symbol symbol_yes = {
scripts/kconfig/util.c+2−0
@@ -5,6 +5,8 @@ · 4 unmodified lines
5 * Released under the terms of the GNU GPL v2.0.5 * Released under the terms of the GNU GPL v2.0.
6 */6 */
7 7
8#include <stdarg.h>
9#include <stdlib.h>
8#include <string.h>10#include <string.h>
9#include "lkc.h"11#include "lkc.h"
10 12
scripts/kconfig/zconf.l+0−1
@@ -14,7 +14,6 @@ · 13 unmodified lines
14#include <string.h>14#include <string.h>
15#include <unistd.h>15#include <unistd.h>
16 16
17#define LKC_DIRECT_LINK
18#include "lkc.h"17#include "lkc.h"
19 18
20#define START_STRSIZE 1619#define START_STRSIZE 16
scripts/kconfig/zconf.tab.c_shipped+0−1
@@ -88,7 +88,6 @@ · 87 unmodified lines
88#include <string.h>88#include <string.h>
89#include <stdbool.h>89#include <stdbool.h>
90 90
91#define LKC_DIRECT_LINK
92#include "lkc.h"91#include "lkc.h"
93 92
94#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)93#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
scripts/kconfig/zconf.y+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
11#include <string.h>11#include <string.h>
12#include <stdbool.h>12#include <stdbool.h>
13 13
14#define LKC_DIRECT_LINK
15#include "lkc.h"14#include "lkc.h"
16 15
17#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)16#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)