]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
Integrate allconfig
authorKarel Kočí <cynerd@email.cz>
Fri, 17 Jul 2015 11:42:03 +0000 (13:42 +0200)
committerKarel Kočí <cynerd@email.cz>
Fri, 17 Jul 2015 11:42:03 +0000 (13:42 +0200)
allconfig is now integrated in project.
It is going to replace permute_conf for generating.
For this reason is default behaviour changed to print only changeable configurtaion options.
Previous behaviour can be used with --all switch.

Also add .gitignore and remove compiled file from repository.

Makefile
scripts/allconfig/.gitignore [new file with mode: 0644]
scripts/allconfig/allconfig [deleted file]
scripts/allconfig/allconfig.c

index e22358c14bb4a1a0166df3d547228c9e5c745828..e95c742cd5689b21ea97f2810a4e41c34c77a37b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
 
 -include .conf.mk
 
-all: parse_kconfig write_config permute_conf picosat
+all: parse_kconfig write_config allconfig permute_conf picosat
 
 help:
        @echo "all         - Builds basic programs and prints message about next steps."
@@ -60,6 +60,7 @@ clean:
        @$(MAKE) -C scripts/parse_kconfig clean
        @$(MAKE) -C scripts/write_config clean
        @$(MAKE) -C scripts/permute_conf clean
+       @$(MAKE) -C scripts/allconfig clean
        @if [ -e scripts/picosat-959/makefile ]; then $(MAKE) -C scripts/picosat-959 clean; fi
        $(RM) .conf.mk
        $(RM) -r jobfiles output result
@@ -90,6 +91,9 @@ parse_kconfig:
 write_config:
        @$(MAKE) -C scripts/write_config/
 
+allconfig:
+       @$(MAKE) -C scripts/allconfig/
+
 permute_conf:
        @$(MAKE) -C scripts/permute_conf/
 
diff --git a/scripts/allconfig/.gitignore b/scripts/allconfig/.gitignore
new file mode 100644 (file)
index 0000000..14a250f
--- /dev/null
@@ -0,0 +1 @@
+allconfig
diff --git a/scripts/allconfig/allconfig b/scripts/allconfig/allconfig
deleted file mode 100755 (executable)
index cc714c1..0000000
Binary files a/scripts/allconfig/allconfig and /dev/null differ
index 65c8b56cffbd0f3f0c448a29676ad3fcb221f08d..acd105097ca6907d7b0318bca9b15e6d7292938a 100644 (file)
@@ -2,23 +2,33 @@
 #include <stdio.h>
 #include <string.h>
 #include <locale.h>
+#include <stdbool.h>
 
 #include <kconfig/lkc.h>
 #include <build_files.h>
 #include <macros.h>
 
 int verbose_level;
+bool full_config;
 
 char *kconfig_file;
 char *output_config_file;
 char *input_config_file;
 
-int main(int argc, char ** argv) {
+void print_help();
+
+int main(int argc, char **argv) {
+    full_config = false;
     verbose_level = 1;
     int i;
     for (i = 1; i < argc; i++) {
-        if (!strcmp(argv[i], "-v")) {
+        if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) {
+            print_help();
+            exit(0);
+        } else if (!strcmp(argv[i], "-v")) {
             verbose_level++;
+        } else if (!strcmp(argv[i], "--all")) {
+            full_config = true;
         } else if (kconfig_file == NULL) {
             kconfig_file = argv[i];
         } else if (input_config_file == NULL) {
@@ -31,8 +41,10 @@ int main(int argc, char ** argv) {
         }
     }
 
-    if (output_config_file == NULL || kconfig_file == NULL || input_config_file == NULL) {
-        Eprintf("Use with parameters: kconfig_file input_config output_config\n");
+    if (output_config_file == NULL || kconfig_file == NULL
+        || input_config_file == NULL) {
+        Eprintf("Parameters mismatch.\n");
+        print_help();
         exit(-2);
     }
 
@@ -59,8 +71,18 @@ int main(int argc, char ** argv) {
         exit(-3);
     }
 
+    struct property *prop;
     for_all_symbols(i, sym) {
-        if ((sym->type == S_BOOLEAN || sym->type == S_TRISTATE) && sym->name != NULL) {
+        if ((sym->type == S_BOOLEAN || sym->type == S_TRISTATE)
+            && sym->name != NULL) {
+            if (!full_config) {
+                for_all_prompts(sym, prop) {
+                    goto printit;
+                }
+            } else
+                goto printit;
+            continue;
+          printit:
             fprintf(f, "CONFIG_%s=%s\n", sym->name,
                     sym_get_tristate_value(sym) == no ? "n" : "y");
         }
@@ -69,3 +91,9 @@ int main(int argc, char ** argv) {
 
     return 0;
 }
+
+void print_help() {
+    printf("Usage: allconfig [-v] [-h] Kconfig Input Output\n");
+    printf("  This is generating full configuration.\n");
+    printf("  Output configuration has all configuration options.\n");
+}