diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-13 13:06:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-13 13:06:28 -0400 |
commit | 5453a3df2a5eb49bc24615d4cf0d66b2aae05e5f (patch) | |
tree | 1afe217f7de7e956039f3b72298aaf99a741a8b7 /scripts/kconfig | |
parent | add8462a60421ca1b03a6864e295d22de532a5e7 (diff) | |
parent | 8741908b3e29d35a33eeab6de60175958db8e54b (diff) |
Merge tag 'kconfig-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kconfig updates from Masahiro Yamada:
- rename lexer and parse files
- fix 'Save as' menu of xconfig
* tag 'kconfig-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kconfig: fix 'Save As' menu of xconfig
kconfig: rename zconf.y to parser.y
kconfig: rename zconf.l to lexer.l
Diffstat (limited to 'scripts/kconfig')
-rw-r--r-- | scripts/kconfig/Makefile | 9 | ||||
-rw-r--r-- | scripts/kconfig/expr.h | 2 | ||||
-rw-r--r-- | scripts/kconfig/lexer.l (renamed from scripts/kconfig/zconf.l) | 2 | ||||
-rw-r--r-- | scripts/kconfig/lkc.h | 2 | ||||
-rw-r--r-- | scripts/kconfig/parser.y (renamed from scripts/kconfig/zconf.y) | 0 | ||||
-rw-r--r-- | scripts/kconfig/qconf.cc | 42 | ||||
-rw-r--r-- | scripts/kconfig/qconf.h | 1 |
7 files changed, 44 insertions, 14 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 181973509a05..7c5dc31c1d95 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -143,11 +143,12 @@ help: | |||
143 | 143 | ||
144 | # =========================================================================== | 144 | # =========================================================================== |
145 | # object files used by all kconfig flavours | 145 | # object files used by all kconfig flavours |
146 | common-objs := confdata.o expr.o symbol.o preprocess.o zconf.lex.o zconf.tab.o | 146 | common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \ |
147 | symbol.o | ||
147 | 148 | ||
148 | $(obj)/zconf.lex.o: $(obj)/zconf.tab.h | 149 | $(obj)/lexer.lex.o: $(obj)/parser.tab.h |
149 | HOSTCFLAGS_zconf.lex.o := -I$(src) | 150 | HOSTCFLAGS_lexer.lex.o := -I$(src) |
150 | HOSTCFLAGS_zconf.tab.o := -I$(src) | 151 | HOSTCFLAGS_parser.tab.o := -I$(src) |
151 | 152 | ||
152 | # conf: Used for defconfig, oldconfig and related targets | 153 | # conf: Used for defconfig, oldconfig and related targets |
153 | hostprogs-y += conf | 154 | hostprogs-y += conf |
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 999edb60cd53..8dde65bc3165 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
@@ -172,7 +172,7 @@ struct symbol { | |||
172 | * int "BAZ Value" | 172 | * int "BAZ Value" |
173 | * range 1..255 | 173 | * range 1..255 |
174 | * | 174 | * |
175 | * Please, also check zconf.y:print_symbol() when modifying the | 175 | * Please, also check parser.y:print_symbol() when modifying the |
176 | * list of property types! | 176 | * list of property types! |
177 | */ | 177 | */ |
178 | enum prop_type { | 178 | enum prop_type { |
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/lexer.l index b2d0a3b0bce9..c9df1c8b9824 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/lexer.l | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <unistd.h> | 15 | #include <unistd.h> |
16 | 16 | ||
17 | #include "lkc.h" | 17 | #include "lkc.h" |
18 | #include "zconf.tab.h" | 18 | #include "parser.tab.h" |
19 | 19 | ||
20 | #define YY_DECL static int yylex1(void) | 20 | #define YY_DECL static int yylex1(void) |
21 | 21 | ||
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 531ff7c57d92..d871539e4b45 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
@@ -90,7 +90,7 @@ void *xrealloc(void *p, size_t size); | |||
90 | char *xstrdup(const char *s); | 90 | char *xstrdup(const char *s); |
91 | char *xstrndup(const char *s, size_t n); | 91 | char *xstrndup(const char *s, size_t n); |
92 | 92 | ||
93 | /* zconf.l */ | 93 | /* lexer.l */ |
94 | int yylex(void); | 94 | int yylex(void); |
95 | 95 | ||
96 | struct gstr { | 96 | struct gstr { |
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/parser.y index 60936c76865b..60936c76865b 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/parser.y | |||
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 8be8a70c5542..ce7fc87a49a7 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
@@ -1392,6 +1392,8 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1392 | conf_set_changed_callback(conf_changed); | 1392 | conf_set_changed_callback(conf_changed); |
1393 | // Set saveAction's initial state | 1393 | // Set saveAction's initial state |
1394 | conf_changed(); | 1394 | conf_changed(); |
1395 | configname = xstrdup(conf_get_configname()); | ||
1396 | |||
1395 | QAction *saveAsAction = new QAction("Save &As...", this); | 1397 | QAction *saveAsAction = new QAction("Save &As...", this); |
1396 | connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs())); | 1398 | connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs())); |
1397 | QAction *searchAction = new QAction("&Find", this); | 1399 | QAction *searchAction = new QAction("&Find", this); |
@@ -1520,17 +1522,29 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1520 | 1522 | ||
1521 | void ConfigMainWindow::loadConfig(void) | 1523 | void ConfigMainWindow::loadConfig(void) |
1522 | { | 1524 | { |
1523 | QString s = QFileDialog::getOpenFileName(this, "", conf_get_configname()); | 1525 | QString str; |
1524 | if (s.isNull()) | 1526 | QByteArray ba; |
1527 | const char *name; | ||
1528 | |||
1529 | str = QFileDialog::getOpenFileName(this, "", configname); | ||
1530 | if (str.isNull()) | ||
1525 | return; | 1531 | return; |
1526 | if (conf_read(QFile::encodeName(s))) | 1532 | |
1533 | ba = str.toLocal8Bit(); | ||
1534 | name = ba.data(); | ||
1535 | |||
1536 | if (conf_read(name)) | ||
1527 | QMessageBox::information(this, "qconf", "Unable to load configuration!"); | 1537 | QMessageBox::information(this, "qconf", "Unable to load configuration!"); |
1538 | |||
1539 | free(configname); | ||
1540 | configname = xstrdup(name); | ||
1541 | |||
1528 | ConfigView::updateListAll(); | 1542 | ConfigView::updateListAll(); |
1529 | } | 1543 | } |
1530 | 1544 | ||
1531 | bool ConfigMainWindow::saveConfig(void) | 1545 | bool ConfigMainWindow::saveConfig(void) |
1532 | { | 1546 | { |
1533 | if (conf_write(NULL)) { | 1547 | if (conf_write(configname)) { |
1534 | QMessageBox::information(this, "qconf", "Unable to save configuration!"); | 1548 | QMessageBox::information(this, "qconf", "Unable to save configuration!"); |
1535 | return false; | 1549 | return false; |
1536 | } | 1550 | } |
@@ -1541,10 +1555,24 @@ bool ConfigMainWindow::saveConfig(void) | |||
1541 | 1555 | ||
1542 | void ConfigMainWindow::saveConfigAs(void) | 1556 | void ConfigMainWindow::saveConfigAs(void) |
1543 | { | 1557 | { |
1544 | QString s = QFileDialog::getSaveFileName(this, "", conf_get_configname()); | 1558 | QString str; |
1545 | if (s.isNull()) | 1559 | QByteArray ba; |
1560 | const char *name; | ||
1561 | |||
1562 | str = QFileDialog::getSaveFileName(this, "", configname); | ||
1563 | if (str.isNull()) | ||
1546 | return; | 1564 | return; |
1547 | saveConfig(); | 1565 | |
1566 | ba = str.toLocal8Bit(); | ||
1567 | name = ba.data(); | ||
1568 | |||
1569 | if (conf_write(name)) { | ||
1570 | QMessageBox::information(this, "qconf", "Unable to save configuration!"); | ||
1571 | } | ||
1572 | conf_write_autoconf(0); | ||
1573 | |||
1574 | free(configname); | ||
1575 | configname = xstrdup(name); | ||
1548 | } | 1576 | } |
1549 | 1577 | ||
1550 | void ConfigMainWindow::searchConfig(void) | 1578 | void ConfigMainWindow::searchConfig(void) |
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index 41df466e67d9..45bfe9b2b966 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h | |||
@@ -291,6 +291,7 @@ protected: | |||
291 | class ConfigMainWindow : public QMainWindow { | 291 | class ConfigMainWindow : public QMainWindow { |
292 | Q_OBJECT | 292 | Q_OBJECT |
293 | 293 | ||
294 | char *configname; | ||
294 | static QAction *saveAction; | 295 | static QAction *saveAction; |
295 | static void conf_changed(void); | 296 | static void conf_changed(void); |
296 | public: | 297 | public: |