diff options
| -rw-r--r-- | scripts/kconfig/Makefile | 28 | ||||
| -rw-r--r-- | scripts/kconfig/streamline_config.pl | 22 |
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 | 36 | localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf |
| 37 | ifdef LSMOD | ||
| 38 | LSMOD_F := $(LSMOD) | ||
| 39 | ifeq ($(findstring /,$(LSMOD)),) | ||
| 40 | LSMOD_F := $(objtree)/$(LSMOD) | ||
| 41 | endif | ||
| 42 | endif | ||
| 43 | |||
| 44 | localmodconfig: $(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 | ||
| 59 | localyesconfig: $(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 | # |
| 45 | use strict; | 45 | use strict; |
| 46 | use Getopt::Long; | ||
| 46 | 47 | ||
| 47 | my $config = ".config"; | 48 | my $config = ".config"; |
| 48 | 49 | ||
| @@ -112,10 +113,17 @@ sub find_config { | |||
| 112 | 113 | ||
| 113 | find_config; | 114 | find_config; |
| 114 | 115 | ||
| 116 | # Parse options | ||
| 117 | my $localmodconfig = 0; | ||
| 118 | my $localyesconfig = 0; | ||
| 119 | |||
| 120 | GetOptions("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) |
| 116 | my $ksource = $ARGV[0]; | 124 | my $ksource = $ARGV[0]; |
| 117 | my $kconfig = $ARGV[1]; | 125 | my $kconfig = $ARGV[1]; |
| 118 | my $lsmod_file = $ARGV[2]; | 126 | my $lsmod_file = $ENV{'LSMOD'}; |
| 119 | 127 | ||
| 120 | my @makefiles = `find $ksource -name Makefile 2>/dev/null`; | 128 | my @makefiles = `find $ksource -name Makefile 2>/dev/null`; |
| 121 | chomp @makefiles; | 129 | chomp @makefiles; |
| @@ -296,7 +304,11 @@ my %modules; | |||
| 296 | 304 | ||
| 297 | if (defined($lsmod_file)) { | 305 | if (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; |
