aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/.gitignore3
-rw-r--r--scripts/kconfig/Makefile4
-rw-r--r--scripts/kconfig/conf.c7
-rw-r--r--scripts/kconfig/confdata.c20
-rw-r--r--scripts/kconfig/lkc.h1
-rw-r--r--scripts/kconfig/lxdialog/checklist.c3
-rw-r--r--scripts/kconfig/mconf.c10
-rw-r--r--scripts/kconfig/qconf.cc48
-rw-r--r--scripts/kconfig/util.c6
9 files changed, 63 insertions, 39 deletions
diff --git a/scripts/kconfig/.gitignore b/scripts/kconfig/.gitignore
index b49584c932cc..6a36a76e6606 100644
--- a/scripts/kconfig/.gitignore
+++ b/scripts/kconfig/.gitignore
@@ -8,6 +8,9 @@ lex.*.c
8zconf.hash.c 8zconf.hash.c
9*.moc 9*.moc
10lkc_defs.h 10lkc_defs.h
11gconf.glade.h
12*.pot
13*.mo
11 14
12# 15#
13# configuration programs 16# configuration programs
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index fa8c2dd9c983..5ddf8becd7a2 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -83,7 +83,7 @@ help:
83 @echo ' xconfig - Update current config utilising a QT based front-end' 83 @echo ' xconfig - Update current config utilising a QT based front-end'
84 @echo ' gconfig - Update current config utilising a GTK based front-end' 84 @echo ' gconfig - Update current config utilising a GTK based front-end'
85 @echo ' oldconfig - Update current config utilising a provided .config as base' 85 @echo ' oldconfig - Update current config utilising a provided .config as base'
86 @echo ' silentoldconfig - Same as oldconfig, but quietly' 86 @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
87 @echo ' randconfig - New config with random answer to all options' 87 @echo ' randconfig - New config with random answer to all options'
88 @echo ' defconfig - New config with default answer to all options' 88 @echo ' defconfig - New config with default answer to all options'
89 @echo ' allmodconfig - New config selecting modules when possible' 89 @echo ' allmodconfig - New config selecting modules when possible'
@@ -104,7 +104,7 @@ HOST_EXTRACFLAGS += -DLOCALE
104# =========================================================================== 104# ===========================================================================
105# Shared Makefile for the various kconfig executables: 105# Shared Makefile for the various kconfig executables:
106# conf: Used for defconfig, oldconfig and related targets 106# conf: Used for defconfig, oldconfig and related targets
107# mconf: Used for the mconfig target. 107# mconf: Used for the menuconfig target
108# Utilizes the lxdialog package 108# Utilizes the lxdialog package
109# qconf: Used for the xconfig target 109# qconf: Used for the xconfig target
110# Based on QT which needs to be installed to compile it 110# Based on QT which needs to be installed to compile it
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index d190092c3b6e..3baaaecd6b13 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -498,14 +498,15 @@ int main(int ac, char **av)
498 conf_parse(name); 498 conf_parse(name);
499 //zconfdump(stdout); 499 //zconfdump(stdout);
500 if (sync_kconfig) { 500 if (sync_kconfig) {
501 if (stat(".config", &tmpstat)) { 501 name = conf_get_configname();
502 if (stat(name, &tmpstat)) {
502 fprintf(stderr, _("***\n" 503 fprintf(stderr, _("***\n"
503 "*** You have not yet configured your kernel!\n" 504 "*** You have not yet configured your kernel!\n"
504 "*** (missing kernel .config file)\n" 505 "*** (missing kernel config file \"%s\")\n"
505 "***\n" 506 "***\n"
506 "*** Please run some configurator (e.g. \"make oldconfig\" or\n" 507 "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
507 "*** \"make menuconfig\" or \"make xconfig\").\n" 508 "*** \"make menuconfig\" or \"make xconfig\").\n"
508 "***\n")); 509 "***\n"), name);
509 exit(1); 510 exit(1);
510 } 511 }
511 } 512 }
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 273d73888f9d..a04da3459f0f 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -41,6 +41,13 @@ const char *conf_get_configname(void)
41 return name ? name : ".config"; 41 return name ? name : ".config";
42} 42}
43 43
44const char *conf_get_autoconfig_name(void)
45{
46 char *name = getenv("KCONFIG_AUTOCONFIG");
47
48 return name ? name : "include/config/auto.conf";
49}
50
44static char *conf_expand_value(const char *in) 51static char *conf_expand_value(const char *in)
45{ 52{
46 struct symbol *sym; 53 struct symbol *sym;
@@ -555,15 +562,14 @@ int conf_write(const char *name)
555 562
556int conf_split_config(void) 563int conf_split_config(void)
557{ 564{
558 char *name, path[128]; 565 const char *name;
566 char path[128];
559 char *s, *d, c; 567 char *s, *d, c;
560 struct symbol *sym; 568 struct symbol *sym;
561 struct stat sb; 569 struct stat sb;
562 int res, i, fd; 570 int res, i, fd;
563 571
564 name = getenv("KCONFIG_AUTOCONFIG"); 572 name = conf_get_autoconfig_name();
565 if (!name)
566 name = "include/config/auto.conf";
567 conf_read_simple(name, S_DEF_AUTO); 573 conf_read_simple(name, S_DEF_AUTO);
568 574
569 if (chdir("include/config")) 575 if (chdir("include/config"))
@@ -670,7 +676,7 @@ int conf_write_autoconf(void)
670{ 676{
671 struct symbol *sym; 677 struct symbol *sym;
672 const char *str; 678 const char *str;
673 char *name; 679 const char *name;
674 FILE *out, *out_h; 680 FILE *out, *out_h;
675 time_t now; 681 time_t now;
676 int i, l; 682 int i, l;
@@ -773,9 +779,7 @@ int conf_write_autoconf(void)
773 name = "include/linux/autoconf.h"; 779 name = "include/linux/autoconf.h";
774 if (rename(".tmpconfig.h", name)) 780 if (rename(".tmpconfig.h", name))
775 return 1; 781 return 1;
776 name = getenv("KCONFIG_AUTOCONFIG"); 782 name = conf_get_autoconfig_name();
777 if (!name)
778 name = "include/config/auto.conf";
779 /* 783 /*
780 * This must be the last step, kbuild has a dependency on auto.conf 784 * This must be the last step, kbuild has a dependency on auto.conf
781 * and this marks the successful completion of the previous steps. 785 * and this marks the successful completion of the previous steps.
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 4a9af6f7886b..f379b0bf8c9e 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -74,6 +74,7 @@ char *zconf_curname(void);
74 74
75/* confdata.c */ 75/* confdata.c */
76const char *conf_get_configname(void); 76const char *conf_get_configname(void);
77const char *conf_get_autoconfig_name(void);
77char *conf_get_default_confname(void); 78char *conf_get_default_confname(void);
78void sym_set_change_count(int count); 79void sym_set_change_count(int count);
79void sym_add_change_count(int count); 80void sym_add_change_count(int count);
diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c
index b2a878c936d6..bcc6f19c3a35 100644
--- a/scripts/kconfig/lxdialog/checklist.c
+++ b/scripts/kconfig/lxdialog/checklist.c
@@ -41,7 +41,8 @@ static void print_item(WINDOW * win, int choice, int selected)
41 wmove(win, choice, check_x); 41 wmove(win, choice, check_x);
42 wattrset(win, selected ? dlg.check_selected.atr 42 wattrset(win, selected ? dlg.check_selected.atr
43 : dlg.check.atr); 43 : dlg.check.atr);
44 wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); 44 if (!item_is_tag(':'))
45 wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' ');
45 46
46 wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); 47 wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr);
47 mvwaddch(win, choice, item_x, item_str()[0]); 48 mvwaddch(win, choice, item_x, item_str()[0]);
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 6841e95c0989..3bcacb4bfd3a 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -732,7 +732,12 @@ static void conf_choice(struct menu *menu)
732 for (child = menu->list; child; child = child->next) { 732 for (child = menu->list; child; child = child->next) {
733 if (!menu_is_visible(child)) 733 if (!menu_is_visible(child))
734 continue; 734 continue;
735 item_make("%s", _(menu_get_prompt(child))); 735 if (child->sym)
736 item_make("%s", _(menu_get_prompt(child)));
737 else {
738 item_make("*** %s ***", _(menu_get_prompt(child)));
739 item_set_tag(':');
740 }
736 item_set_data(child); 741 item_set_data(child);
737 if (child->sym == active) 742 if (child->sym == active)
738 item_set_selected(1); 743 item_set_selected(1);
@@ -748,6 +753,9 @@ static void conf_choice(struct menu *menu)
748 case 0: 753 case 0:
749 if (selected) { 754 if (selected) {
750 child = item_data(); 755 child = item_data();
756 if (!child->sym)
757 break;
758
751 sym_set_tristate_value(child->sym, yes); 759 sym_set_tristate_value(child->sym, yes);
752 } 760 }
753 return; 761 return;
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 5d0fd38b089b..ce7d508c7520 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -5,6 +5,7 @@
5 5
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qmainwindow.h> 7#include <qmainwindow.h>
8#include <qdesktopwidget.h>
8#include <qtoolbar.h> 9#include <qtoolbar.h>
9#include <qlayout.h> 10#include <qlayout.h>
10#include <qvbox.h> 11#include <qvbox.h>
@@ -297,10 +298,10 @@ void ConfigLineEdit::show(ConfigItem* i)
297void ConfigLineEdit::keyPressEvent(QKeyEvent* e) 298void ConfigLineEdit::keyPressEvent(QKeyEvent* e)
298{ 299{
299 switch (e->key()) { 300 switch (e->key()) {
300 case Key_Escape: 301 case Qt::Key_Escape:
301 break; 302 break;
302 case Key_Return: 303 case Qt::Key_Return:
303 case Key_Enter: 304 case Qt::Key_Enter:
304 sym_set_string_value(item->menu->sym, text().latin1()); 305 sym_set_string_value(item->menu->sym, text().latin1());
305 parent()->updateList(item); 306 parent()->updateList(item);
306 break; 307 break;
@@ -639,7 +640,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
639 struct menu *menu; 640 struct menu *menu;
640 enum prop_type type; 641 enum prop_type type;
641 642
642 if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) { 643 if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) {
643 emit parentSelected(); 644 emit parentSelected();
644 ev->accept(); 645 ev->accept();
645 return; 646 return;
@@ -652,8 +653,8 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
652 item = (ConfigItem*)i; 653 item = (ConfigItem*)i;
653 654
654 switch (ev->key()) { 655 switch (ev->key()) {
655 case Key_Return: 656 case Qt::Key_Return:
656 case Key_Enter: 657 case Qt::Key_Enter:
657 if (item->goParent) { 658 if (item->goParent) {
658 emit parentSelected(); 659 emit parentSelected();
659 break; 660 break;
@@ -667,16 +668,16 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
667 emit menuSelected(menu); 668 emit menuSelected(menu);
668 break; 669 break;
669 } 670 }
670 case Key_Space: 671 case Qt::Key_Space:
671 changeValue(item); 672 changeValue(item);
672 break; 673 break;
673 case Key_N: 674 case Qt::Key_N:
674 setValue(item, no); 675 setValue(item, no);
675 break; 676 break;
676 case Key_M: 677 case Qt::Key_M:
677 setValue(item, mod); 678 setValue(item, mod);
678 break; 679 break;
679 case Key_Y: 680 case Qt::Key_Y:
680 setValue(item, yes); 681 setValue(item, yes);
681 break; 682 break;
682 default: 683 default:
@@ -920,7 +921,7 @@ void ConfigView::updateListAll(void)
920} 921}
921 922
922ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) 923ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
923 : Parent(parent, name), menu(0), sym(0) 924 : Parent(parent, name), sym(0), menu(0)
924{ 925{
925 if (name) { 926 if (name) {
926 configSettings->beginGroup(name); 927 configSettings->beginGroup(name);
@@ -1199,7 +1200,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
1199 layout1->addLayout(layout2); 1200 layout1->addLayout(layout2);
1200 1201
1201 split = new QSplitter(this); 1202 split = new QSplitter(this);
1202 split->setOrientation(QSplitter::Vertical); 1203 split->setOrientation(Qt::Vertical);
1203 list = new ConfigView(split, name); 1204 list = new ConfigView(split, name);
1204 list->list->mode = listMode; 1205 list->list->mode = listMode;
1205 info = new ConfigInfoView(split, name); 1206 info = new ConfigInfoView(split, name);
@@ -1275,7 +1276,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1275 int x, y, width, height; 1276 int x, y, width, height;
1276 char title[256]; 1277 char title[256];
1277 1278
1278 QWidget *d = configApp->desktop(); 1279 QDesktopWidget *d = configApp->desktop();
1279 snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"), 1280 snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"),
1280 getenv("KERNELVERSION")); 1281 getenv("KERNELVERSION"));
1281 setCaption(title); 1282 setCaption(title);
@@ -1290,14 +1291,14 @@ ConfigMainWindow::ConfigMainWindow(void)
1290 move(x, y); 1291 move(x, y);
1291 1292
1292 split1 = new QSplitter(this); 1293 split1 = new QSplitter(this);
1293 split1->setOrientation(QSplitter::Horizontal); 1294 split1->setOrientation(Qt::Horizontal);
1294 setCentralWidget(split1); 1295 setCentralWidget(split1);
1295 1296
1296 menuView = new ConfigView(split1, "menu"); 1297 menuView = new ConfigView(split1, "menu");
1297 menuList = menuView->list; 1298 menuList = menuView->list;
1298 1299
1299 split2 = new QSplitter(split1); 1300 split2 = new QSplitter(split1);
1300 split2->setOrientation(QSplitter::Vertical); 1301 split2->setOrientation(Qt::Vertical);
1301 1302
1302 // create config tree 1303 // create config tree
1303 configView = new ConfigView(split2, "config"); 1304 configView = new ConfigView(split2, "config");
@@ -1315,18 +1316,18 @@ ConfigMainWindow::ConfigMainWindow(void)
1315 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); 1316 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this);
1316 connect(backAction, SIGNAL(activated()), SLOT(goBack())); 1317 connect(backAction, SIGNAL(activated()), SLOT(goBack()));
1317 backAction->setEnabled(FALSE); 1318 backAction->setEnabled(FALSE);
1318 QAction *quitAction = new QAction("Quit", _("&Quit"), CTRL+Key_Q, this); 1319 QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this);
1319 connect(quitAction, SIGNAL(activated()), SLOT(close())); 1320 connect(quitAction, SIGNAL(activated()), SLOT(close()));
1320 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), CTRL+Key_L, this); 1321 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this);
1321 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); 1322 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
1322 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), CTRL+Key_S, this); 1323 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this);
1323 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); 1324 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
1324 conf_set_changed_callback(conf_changed); 1325 conf_set_changed_callback(conf_changed);
1325 // Set saveAction's initial state 1326 // Set saveAction's initial state
1326 conf_changed(); 1327 conf_changed();
1327 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); 1328 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this);
1328 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); 1329 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1329 QAction *searchAction = new QAction("Find", _("&Find"), CTRL+Key_F, this); 1330 QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this);
1330 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); 1331 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
1331 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); 1332 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
1332 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); 1333 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
@@ -1447,7 +1448,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1447 1448
1448void ConfigMainWindow::loadConfig(void) 1449void ConfigMainWindow::loadConfig(void)
1449{ 1450{
1450 QString s = QFileDialog::getOpenFileName(".config", NULL, this); 1451 QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this);
1451 if (s.isNull()) 1452 if (s.isNull())
1452 return; 1453 return;
1453 if (conf_read(QFile::encodeName(s))) 1454 if (conf_read(QFile::encodeName(s)))
@@ -1463,7 +1464,7 @@ void ConfigMainWindow::saveConfig(void)
1463 1464
1464void ConfigMainWindow::saveConfigAs(void) 1465void ConfigMainWindow::saveConfigAs(void)
1465{ 1466{
1466 QString s = QFileDialog::getSaveFileName(".config", NULL, this); 1467 QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this);
1467 if (s.isNull()) 1468 if (s.isNull())
1468 return; 1469 return;
1469 if (conf_write(QFile::encodeName(s))) 1470 if (conf_write(QFile::encodeName(s)))
@@ -1524,6 +1525,8 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
1524 case fullMode: 1525 case fullMode:
1525 list = configList; 1526 list = configList;
1526 break; 1527 break;
1528 default:
1529 break;
1527 } 1530 }
1528 1531
1529 if (list) { 1532 if (list) {
@@ -1673,6 +1676,9 @@ void ConfigMainWindow::saveSettings(void)
1673 case fullMode : 1676 case fullMode :
1674 entry = "full"; 1677 entry = "full";
1675 break; 1678 break;
1679
1680 default:
1681 break;
1676 } 1682 }
1677 configSettings->writeEntry("/listMode", entry); 1683 configSettings->writeEntry("/listMode", entry);
1678 1684
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index 3cc9f9369036..b6b2a46af14c 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -46,8 +46,8 @@ int file_write_dep(const char *name)
46 else 46 else
47 fprintf(out, "\t%s\n", file->name); 47 fprintf(out, "\t%s\n", file->name);
48 } 48 }
49 fprintf(out, "\ninclude/config/auto.conf: \\\n" 49 fprintf(out, "\n%s: \\\n"
50 "\t$(deps_config)\n\n"); 50 "\t$(deps_config)\n\n", conf_get_autoconfig_name());
51 51
52 expr_list_for_each_sym(sym_env_list, e, sym) { 52 expr_list_for_each_sym(sym_env_list, e, sym) {
53 struct property *prop; 53 struct property *prop;
@@ -61,7 +61,7 @@ int file_write_dep(const char *name)
61 if (!value) 61 if (!value)
62 value = ""; 62 value = "";
63 fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value); 63 fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value);
64 fprintf(out, "include/config/auto.conf: FORCE\n"); 64 fprintf(out, "%s: FORCE\n", conf_get_autoconfig_name());
65 fprintf(out, "endif\n"); 65 fprintf(out, "endif\n");
66 } 66 }
67 67