aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2006-06-09 01:12:42 -0400
committerSam Ravnborg <sam@mars.ravnborg.org>2006-06-09 01:31:30 -0400
commit2e3646e51b2d6415549b310655df63e7e0d7a080 (patch)
treef717c0ede91122ab776a6b0fce9b8c941797f170
parent669bfad906522e74ee8d962801552a8c224c0d63 (diff)
kconfig: integrate split config into silentoldconfig
Now that kconfig can load multiple configurations, it becomes simple to integrate the split config step, by simply comparing the new .config file with the old auto.conf (and then saving the new auto.conf). A nice side effect is that this saves a bit of disk space and cache, as no data needs to be read from or saved into the splitted config files anymore (e.g. include/config is now 648KB instead of 5.2MB). Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r--Makefile11
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/sh/Makefile4
-rw-r--r--arch/xtensa/Makefile2
-rw-r--r--scripts/basic/Makefile6
-rw-r--r--scripts/basic/split-include.c226
-rw-r--r--scripts/kconfig/confdata.c121
-rw-r--r--scripts/kconfig/expr.h3
8 files changed, 129 insertions, 246 deletions
diff --git a/Makefile b/Makefile
index b1610562a65..4b996c8fb70 100644
--- a/Makefile
+++ b/Makefile
@@ -418,7 +418,7 @@ ifeq ($(KBUILD_EXTMOD),)
418# Carefully list dependencies so we do not try to build scripts twice 418# Carefully list dependencies so we do not try to build scripts twice
419# in parrallel 419# in parrallel
420PHONY += scripts 420PHONY += scripts
421scripts: scripts_basic include/config/MARKER 421scripts: scripts_basic include/config/auto.conf
422 $(Q)$(MAKE) $(build)=$(@) 422 $(Q)$(MAKE) $(build)=$(@)
423 423
424# Objects we will link into vmlinux / subdirs we need to visit 424# Objects we will link into vmlinux / subdirs we need to visit
@@ -787,7 +787,7 @@ endif
787prepare2: prepare3 outputmakefile 787prepare2: prepare3 outputmakefile
788 788
789prepare1: prepare2 include/linux/version.h include/asm \ 789prepare1: prepare2 include/linux/version.h include/asm \
790 include/config/MARKER 790 include/config/auto.conf
791ifneq ($(KBUILD_MODULES),) 791ifneq ($(KBUILD_MODULES),)
792 $(Q)mkdir -p $(MODVERDIR) 792 $(Q)mkdir -p $(MODVERDIR)
793 $(Q)rm -f $(MODVERDIR)/* 793 $(Q)rm -f $(MODVERDIR)/*
@@ -815,13 +815,6 @@ include/asm:
815 $(Q)if [ ! -d include ]; then mkdir -p include; fi; 815 $(Q)if [ ! -d include ]; then mkdir -p include; fi;
816 @ln -fsn asm-$(ARCH) $@ 816 @ln -fsn asm-$(ARCH) $@
817 817
818# Split autoconf.h into include/linux/config/*
819
820include/config/MARKER: scripts/basic/split-include include/config/auto.conf
821 @echo ' SPLIT include/linux/autoconf.h -> include/config/*'
822 @scripts/basic/split-include include/linux/autoconf.h include/config
823 @touch $@
824
825# Generate some files 818# Generate some files
826# --------------------------------------------------------------------------- 819# ---------------------------------------------------------------------------
827 820
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 6f8e84c1c1f..9791d870ae7 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -175,7 +175,7 @@ boot := arch/arm/boot
175# them changed. We use .arch to indicate when they were updated 175# them changed. We use .arch to indicate when they were updated
176# last, otherwise make uses the target directory mtime. 176# last, otherwise make uses the target directory mtime.
177 177
178include/asm-arm/.arch: $(wildcard include/config/arch/*.h) include/config/MARKER 178include/asm-arm/.arch: $(wildcard include/config/arch/*.h) include/config/auto.conf
179 @echo ' SYMLINK include/asm-arm/arch -> include/asm-arm/$(INCDIR)' 179 @echo ' SYMLINK include/asm-arm/arch -> include/asm-arm/$(INCDIR)'
180ifneq ($(KBUILD_SRC),) 180ifneq ($(KBUILD_SRC),)
181 $(Q)mkdir -p include/asm-arm 181 $(Q)mkdir -p include/asm-arm
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index c72e17a96ee..e467a450662 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -147,7 +147,7 @@ endif
147# them changed. We use .arch and .mach to indicate when they were 147# them changed. We use .arch and .mach to indicate when they were
148# updated last, otherwise make uses the target directory mtime. 148# updated last, otherwise make uses the target directory mtime.
149 149
150include/asm-sh/.cpu: $(wildcard include/config/cpu/*.h) include/config/MARKER 150include/asm-sh/.cpu: $(wildcard include/config/cpu/*.h) include/config/auto.conf
151 @echo ' SYMLINK include/asm-sh/cpu -> include/asm-sh/$(cpuincdir-y)' 151 @echo ' SYMLINK include/asm-sh/cpu -> include/asm-sh/$(cpuincdir-y)'
152 $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi 152 $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
153 $(Q)ln -fsn $(incdir-prefix)$(cpuincdir-y) include/asm-sh/cpu 153 $(Q)ln -fsn $(incdir-prefix)$(cpuincdir-y) include/asm-sh/cpu
@@ -157,7 +157,7 @@ include/asm-sh/.cpu: $(wildcard include/config/cpu/*.h) include/config/MARKER
157# don't, just reference the parent directory so the semantics are 157# don't, just reference the parent directory so the semantics are
158# kept roughly the same. 158# kept roughly the same.
159 159
160include/asm-sh/.mach: $(wildcard include/config/sh/*.h) include/config/MARKER 160include/asm-sh/.mach: $(wildcard include/config/sh/*.h) include/config/auto.conf
161 @echo -n ' SYMLINK include/asm-sh/mach -> ' 161 @echo -n ' SYMLINK include/asm-sh/mach -> '
162 $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi 162 $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
163 $(Q)if [ -d $(incdir-prefix)$(incdir-y) ]; then \ 163 $(Q)if [ -d $(incdir-prefix)$(incdir-y) ]; then \
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 98fac8489ae..3a3a4c66ef8 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -71,7 +71,7 @@ archprepare: $(archinc)/.platform
71# Update machine cpu and platform symlinks if something which affects 71# Update machine cpu and platform symlinks if something which affects
72# them changed. 72# them changed.
73 73
74$(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/MARKER 74$(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/auto.conf
75 @echo ' SYMLINK $(archinc)/xtensa/config -> $(archinc)/xtensa/config-$(CPU)' 75 @echo ' SYMLINK $(archinc)/xtensa/config -> $(archinc)/xtensa/config-$(CPU)'
76 $(Q)mkdir -p $(archinc) 76 $(Q)mkdir -p $(archinc)
77 $(Q)mkdir -p $(archinc)/xtensa 77 $(Q)mkdir -p $(archinc)/xtensa
diff --git a/scripts/basic/Makefile b/scripts/basic/Makefile
index f22e94c3a2d..2f60070f973 100644
--- a/scripts/basic/Makefile
+++ b/scripts/basic/Makefile
@@ -1,17 +1,15 @@
1### 1###
2# Makefile.basic list the most basic programs used during the build process. 2# Makefile.basic list the most basic programs used during the build process.
3# The programs listed herein is what is needed to do the basic stuff, 3# The programs listed herein is what is needed to do the basic stuff,
4# such as splitting .config and fix dependency file. 4# such as fix dependency file.
5# This initial step is needed to avoid files to be recompiled 5# This initial step is needed to avoid files to be recompiled
6# when kernel configuration changes (which is what happens when 6# when kernel configuration changes (which is what happens when
7# .config is included by main Makefile. 7# .config is included by main Makefile.
8# --------------------------------------------------------------------------- 8# ---------------------------------------------------------------------------
9# fixdep: Used to generate dependency information during build process 9# fixdep: Used to generate dependency information during build process
10# split-include: Divide all config symbols up in a number of files in
11# include/config/...
12# docproc: Used in Documentation/docbook 10# docproc: Used in Documentation/docbook
13 11
14hostprogs-y := fixdep split-include docproc 12hostprogs-y := fixdep docproc
15always := $(hostprogs-y) 13always := $(hostprogs-y)
16 14
17# fixdep is needed to compile other host programs 15# fixdep is needed to compile other host programs
diff --git a/scripts/basic/split-include.c b/scripts/basic/split-include.c
deleted file mode 100644
index 459c45276cb..00000000000
--- a/scripts/basic/split-include.c
+++ /dev/null
@@ -1,226 +0,0 @@
1/*
2 * split-include.c
3 *
4 * Copyright abandoned, Michael Chastain, <mailto:mec@shout.net>.
5 * This is a C version of syncdep.pl by Werner Almesberger.
6 *
7 * This program takes autoconf.h as input and outputs a directory full
8 * of one-line include files, merging onto the old values.
9 *
10 * Think of the configuration options as key-value pairs. Then there
11 * are five cases:
12 *
13 * key old value new value action
14 *
15 * KEY-1 VALUE-1 VALUE-1 leave file alone
16 * KEY-2 VALUE-2A VALUE-2B write VALUE-2B into file
17 * KEY-3 - VALUE-3 write VALUE-3 into file
18 * KEY-4 VALUE-4 - write an empty file
19 * KEY-5 (empty) - leave old empty file alone
20 */
21
22#include <sys/stat.h>
23#include <sys/types.h>
24
25#include <ctype.h>
26#include <errno.h>
27#include <fcntl.h>
28#include <stdio.h>
29#include <stdlib.h>
30#include <string.h>
31#include <unistd.h>
32
33#define ERROR_EXIT(strExit) \
34 { \
35 const int errnoSave = errno; \
36 fprintf(stderr, "%s: ", str_my_name); \
37 errno = errnoSave; \
38 perror((strExit)); \
39 exit(1); \
40 }
41
42
43
44int main(int argc, const char * argv [])
45{
46 const char * str_my_name;
47 const char * str_file_autoconf;
48 const char * str_dir_config;
49
50 FILE * fp_config;
51 FILE * fp_target;
52 FILE * fp_find;
53
54 int buffer_size;
55
56 char * line;
57 char * old_line;
58 char * list_target;
59 char * ptarget;
60
61 struct stat stat_buf;
62
63 /* Check arg count. */
64 if (argc != 3)
65 {
66 fprintf(stderr, "%s: wrong number of arguments.\n", argv[0]);
67 exit(1);
68 }
69
70 str_my_name = argv[0];
71 str_file_autoconf = argv[1];
72 str_dir_config = argv[2];
73
74 /* Find a buffer size. */
75 if (stat(str_file_autoconf, &stat_buf) != 0)
76 ERROR_EXIT(str_file_autoconf);
77 buffer_size = 2 * stat_buf.st_size + 4096;
78
79 /* Allocate buffers. */
80 if ( (line = malloc(buffer_size)) == NULL