aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-08-19 10:04:53 -0400
committerMichal Marek <mmarek@suse.cz>2011-08-19 10:04:53 -0400
commitdb57630b7a4f6991e6d5997fbc3cf6be55d76d23 (patch)
treee68a0cc1f3b8746255978f0293cb654b99fc6ec1 /scripts/kconfig
parent57e6292da67c30acf92f08604f918192a886838a (diff)
parent50bce3e80773e06316fcb92796ff26b42348d30b (diff)
Merge branch 'master/kconfig-localmodconfig' of git://github.com/lacombar/linux-2.6 into kbuild/kconfig
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/Makefile28
-rw-r--r--scripts/kconfig/streamline_config.pl22
2 files changed, 21 insertions, 29 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 82d2eb285b70..ba573fe7c74d 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -33,17 +33,9 @@ silentoldconfig: $(obj)/conf
33 $(Q)mkdir -p include/generated 33 $(Q)mkdir -p include/generated
34 $< --$@ $(Kconfig) 34 $< --$@ $(Kconfig)
35 35
36# if no path is given, then use src directory to find file 36localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
37ifdef LSMOD
38LSMOD_F := $(LSMOD)
39ifeq ($(findstring /,$(LSMOD)),)
40 LSMOD_F := $(objtree)/$(LSMOD)
41endif
42endif
43
44localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
45 $(Q)mkdir -p include/generated 37 $(Q)mkdir -p include/generated
46 $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config 38 $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
47 $(Q)if [ -f .config ]; then \ 39 $(Q)if [ -f .config ]; then \
48 cmp -s .tmp.config .config || \ 40 cmp -s .tmp.config .config || \
49 (mv -f .config .config.old.1; \ 41 (mv -f .config .config.old.1; \
@@ -56,22 +48,6 @@ localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
56 fi 48 fi
57 $(Q)rm -f .tmp.config 49 $(Q)rm -f .tmp.config
58 50
59localyesconfig: $(obj)/streamline_config.pl $(obj)/conf
60 $(Q)mkdir -p include/generated
61 $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
62 $(Q)sed -i s/=m/=y/ .tmp.config
63 $(Q)if [ -f .config ]; then \
64 cmp -s .tmp.config .config || \
65 (mv -f .config .config.old.1; \
66 mv -f .tmp.config .config; \
67 $(obj)/conf --silentoldconfig $(Kconfig); \
68 mv -f .config.old.1 .config.old) \
69 else \
70 mv -f .tmp.config .config; \
71 $(obj)/conf --silentoldconfig $(Kconfig); \
72 fi
73 $(Q)rm -f .tmp.config
74
75# Create new linux.pot file 51# Create new linux.pot file
76# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files 52# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
77# The symlink is used to repair a deficiency in arch/um 53# The symlink is used to repair a deficiency in arch/um
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index a4fe923c0131..ec7afce4c88d 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -43,6 +43,7 @@
43# make oldconfig 43# make oldconfig
44# 44#
45use strict; 45use strict;
46use Getopt::Long;
46 47
47my $config = ".config"; 48my $config = ".config";
48 49
@@ -112,10 +113,17 @@ sub find_config {
112 113
113find_config; 114find_config;
114 115
116# Parse options
117my $localmodconfig = 0;
118my $localyesconfig = 0;
119
120GetOptions("localmodconfig" => \$localmodconfig,
121 "localyesconfig" => \$localyesconfig);
122
115# Get the build source and top level Kconfig file (passed in) 123# Get the build source and top level Kconfig file (passed in)
116my $ksource = $ARGV[0]; 124my $ksource = $ARGV[0];
117my $kconfig = $ARGV[1]; 125my $kconfig = $ARGV[1];
118my $lsmod_file = $ARGV[2]; 126my $lsmod_file = $ENV{'LSMOD'};
119 127
120my @makefiles = `find $ksource -name Makefile 2>/dev/null`; 128my @makefiles = `find $ksource -name Makefile 2>/dev/null`;
121chomp @makefiles; 129chomp @makefiles;
@@ -296,7 +304,11 @@ my %modules;
296 304
297if (defined($lsmod_file)) { 305if (defined($lsmod_file)) {
298 if ( ! -f $lsmod_file) { 306 if ( ! -f $lsmod_file) {
299 die "$lsmod_file not found"; 307 if ( -f $ENV{'objtree'}."/".$lsmod_file) {
308 $lsmod_file = $ENV{'objtree'}."/".$lsmod_file;
309 } else {
310 die "$lsmod_file not found";
311 }
300 } 312 }
301 if ( -x $lsmod_file) { 313 if ( -x $lsmod_file) {
302 # the file is executable, run it 314 # the file is executable, run it
@@ -421,7 +433,11 @@ while(<CIN>) {
421 433
422 if (/^(CONFIG.*)=(m|y)/) { 434 if (/^(CONFIG.*)=(m|y)/) {
423 if (defined($configs{$1})) { 435 if (defined($configs{$1})) {
424 $setconfigs{$1} = $2; 436 if ($localyesconfig) {
437 $setconfigs{$1} = 'y';
438 } else {
439 $setconfigs{$1} = $2;
440 }
425 } elsif ($2 eq "m") { 441 } elsif ($2 eq "m") {
426 print "# $1 is not set\n"; 442 print "# $1 is not set\n";
427 next; 443 next;