]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
Part of Kconfig used in kconfig_parser exported to shared directory and updated to...
authorKarel Kočí <cynerd@email.cz>
Fri, 10 Apr 2015 13:45:16 +0000 (15:45 +0200)
committerKarel Kočí <cynerd@email.cz>
Fri, 10 Apr 2015 13:45:16 +0000 (15:45 +0200)
16 files changed:
scripts/kconfig_parser/Makefile
scripts/kconfig_parser/cnfexpr.h
scripts/kconfig_parser/parser.c
scripts/shared/kconfig/confdata.c [moved from scripts/kconfig_parser/kconfig/confdata.c with 99% similarity]
scripts/shared/kconfig/expr.c [moved from scripts/kconfig_parser/kconfig/expr.c with 100% similarity]
scripts/shared/kconfig/expr.h [moved from scripts/kconfig_parser/kconfig/expr.h with 100% similarity]
scripts/shared/kconfig/files.mk [new file with mode: 0644]
scripts/shared/kconfig/list.h [moved from scripts/kconfig_parser/kconfig/list.h with 95% similarity]
scripts/shared/kconfig/lkc.h [moved from scripts/kconfig_parser/kconfig/lkc.h with 100% similarity]
scripts/shared/kconfig/lkc_proto.h [moved from scripts/kconfig_parser/kconfig/lkc_proto.h with 100% similarity]
scripts/shared/kconfig/menu.c [moved from scripts/kconfig_parser/kconfig/menu.c with 99% similarity]
scripts/shared/kconfig/symbol.c [moved from scripts/kconfig_parser/kconfig/symbol.c with 100% similarity]
scripts/shared/kconfig/util.c [moved from scripts/kconfig_parser/kconfig/util.c with 100% similarity]
scripts/shared/kconfig/zconf.gperf [moved from scripts/kconfig_parser/kconfig/zconf.gperf with 100% similarity]
scripts/shared/kconfig/zconf.l [moved from scripts/kconfig_parser/kconfig/zconf.l with 100% similarity]
scripts/shared/kconfig/zconf.y [moved from scripts/kconfig_parser/kconfig/zconf.y with 100% similarity]

index 68fbb9322026e8d29387c571e4c91b993065ddcc..f582673e0021c52d67784484f893aa0f34d393ef 100644 (file)
@@ -1,24 +1,19 @@
+.PHONY: all clean
 .SUFFIXES:
 
+all: parser
+
+KCONFIG_PREFIX = ../shared/kconfig
+include $(KCONFIG_PREFIX)/files.mk
+
 SRC  = parser.c \
               cnfexpr.c \
               symlist.c \
               output.c
-SRC += kconfig/zconf.tab.c
 CFLAGS = -O0 -w -ggdb
 
-parser: $(SRC) kconfig/zconf.lex.c kconfig/zconf.hash.c
-       gcc $(CFLAGS) -o $@ $(SRC)
-
-%.hash.c: %.gperf
-       gperf -t --output-file $@ -a -C -E -g -k '1,3,$$' -p -t $<
-
-%.lex.c: %.l
-       flex -o $@  -L -P zconf $<
-
-%.tab.c: %.y kconfig/zconf.lex.c kconfig/zconf.hash.c
-       bison -o $@ $< -p zconf -t -l
+parser: $(SRC) $(KCONFIG_SRC)
+       gcc $(CFLAGS) -o $@ $^ -I$(KCONFIG_PREFIX)
 
-clean:
-       $(RM) kconfig/zconf.tab.c kconfig/zconf.lex.c kconfig/zconf.hash.c
+clean::
        $(RM) parser
index 04733684bcddc0dad08976f39cf0e1883e5b376c..1d0edd477ec39a5affed806b2ac58cfa2d2dcfbe 100644 (file)
@@ -5,7 +5,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include "symlist.h"
-#include "kconfig/lkc.h"
+#include "lkc.h"
 
 enum cnfexpr_type {
     CT_EXPR, CT_FALSE, CT_TRUE
index a0425db5756f8322f51244e3ec7f0fd11eec31d7..933c26cfac6a8b6cb7fbdbf1df6e4e63418cddd0 100644 (file)
@@ -11,7 +11,7 @@
 #include <locale.h>
 #include <stdbool.h>
 #include <argp.h>
-#include "kconfig/lkc.h"
+#include "lkc.h"
 #include "symlist.h"
 #include "output.h"
 #include "macros.h"
@@ -50,7 +50,7 @@ int main(int argc, char **argv) {
     textdomain(PACKAGE);
 
     conf_parse(argv[1]);
-    sym_clear_all_valid();
+    //sym_clear_all_valid();
 
     gsymlist = symlist_create();
 
similarity index 99%
rename from scripts/kconfig_parser/kconfig/confdata.c
rename to scripts/shared/kconfig/confdata.c
index f88d90f20228e8783b5ca39accc436140af7b3ff..28df18dd1147f60b555fea428afe42513b592410 100644 (file)
@@ -59,6 +59,7 @@ static void conf_message(const char *fmt, ...)
        va_start(ap, fmt);
        if (conf_message_callback)
                conf_message_callback(fmt, ap);
+       va_end(ap);
 }
 
 const char *conf_get_configname(void)
diff --git a/scripts/shared/kconfig/files.mk b/scripts/shared/kconfig/files.mk
new file mode 100644 (file)
index 0000000..36a3eec
--- /dev/null
@@ -0,0 +1,22 @@
+.PHONY: clean
+
+ifndef KCONFIG_PREFIX
+       $(error "Please specify variable KCONFIG_SRC in your makefile before importing kconfig files.mk")
+endif
+
+KCONFIG_SRC = $(KCONFIG_PREFIX)/zconf.tab.c
+
+%.hash.c: %.gperf
+       gperf -t --output-file $@ -a -C -E -g -k '1,3,$$' -p -t $<
+
+%.lex.c: %.l
+       flex -o $@  -L -P zconf $<
+
+%.tab.c: %.y %.lex.c %.hash.c
+       bison -o $@ $< -p zconf -t -l
+
+
+clean::
+       $(RM) $(KCONFIG_PREFIX)/zconf.tab.c
+       $(RM) $(KCONFIG_PREFIX)/zconf.lex.c
+       $(RM) $(KCONFIG_PREFIX)/zconf.hash.c
similarity index 95%
rename from scripts/kconfig_parser/kconfig/list.h
rename to scripts/shared/kconfig/list.h
index 685d80e1bb0e77de75a97a2ada22991131597b58..2cf23f002d3f48f6b51ac9898fde7681ea39cf53 100644 (file)
@@ -34,7 +34,7 @@ struct list_head {
  * list_entry - get the struct for this entry
  * @ptr:       the &struct list_head pointer.
  * @type:      the type of the struct this is embedded in.
- * @member:    the name of the list_struct within the struct.
+ * @member:    the name of the list_head within the struct.
  */
 #define list_entry(ptr, type, member) \
        container_of(ptr, type, member)
@@ -43,7 +43,7 @@ struct list_head {
  * list_for_each_entry -       iterate over list of given type
  * @pos:       the type * to use as a loop cursor.
  * @head:      the head for your list.
- * @member:    the name of the list_struct within the struct.
+ * @member:    the name of the list_head within the struct.
  */
 #define list_for_each_entry(pos, head, member)                         \
        for (pos = list_entry((head)->next, typeof(*pos), member);      \
@@ -55,7 +55,7 @@ struct list_head {
  * @pos:       the type * to use as a loop cursor.
  * @n:         another type * to use as temporary storage
  * @head:      the head for your list.
- * @member:    the name of the list_struct within the struct.
+ * @member:    the name of the list_head within the struct.
  */
 #define list_for_each_entry_safe(pos, n, head, member)                 \
        for (pos = list_entry((head)->next, typeof(*pos), member),      \
similarity index 99%
rename from scripts/kconfig_parser/kconfig/menu.c
rename to scripts/shared/kconfig/menu.c
index a26cc5d2a9b0217d9c3d52bf0dab21b7337e95d2..72c9dba84c5dbd46cb8ae2824a85d54603dbaafe 100644 (file)
@@ -548,7 +548,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
 {
        int i, j;
        struct menu *submenu[8], *menu, *location = NULL;
-       struct jump_key *jump;
+       struct jump_key *jump = NULL;
 
        str_printf(r, _("Prompt: %s\n"), _(prop->text));
        menu = prop->menu->parent;
@@ -586,7 +586,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
                str_printf(r, _("  Location:\n"));
                for (j = 4; --i >= 0; j += 2) {
                        menu = submenu[i];
-                       if (head && location && menu == location)
+                       if (jump && menu == location)
                                jump->offset = strlen(r->s);
                        str_printf(r, "%*c-> %s", j, ' ',
                                   _(menu_get_prompt(menu)));