Skip to content

Commit 22d550a

Browse files
committed
kconfig/streamline_config.pl: use options to determine operating mode
The options introduced are --localmodconfig (default) and --localyesconfig. They match the Makefile target behavior. Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
1 parent f597a71 commit 22d550a

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

‎scripts/kconfig/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ silentoldconfig: $(obj)/conf
3535

3636
localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
3737
$(Q)mkdir -p include/generated
38-
$(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
38+
$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
3939
$(Q)if [ -f .config ]; then \
4040
cmp -s .tmp.config .config || \
4141
(mv -f .config .config.old.1; \
@@ -50,7 +50,7 @@ localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
5050

5151
localyesconfig: $(obj)/streamline_config.pl $(obj)/conf
5252
$(Q)mkdir -p include/generated
53-
$(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
53+
$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
5454
$(Q)sed -i s/=m/=y/ .tmp.config
5555
$(Q)if [ -f .config ]; then \
5656
cmp -s .tmp.config .config || \

‎scripts/kconfig/streamline_config.pl‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
# make oldconfig
4444
#
4545
use strict;
46+
use Getopt::Long;
4647

4748
my $config = ".config";
4849

@@ -112,6 +113,13 @@ sub find_config {
112113

113114
find_config;
114115

116+
# Parse options
117+
my $localmodconfig = 0;
118+
my $localyesconfig = 0;
119+
120+
GetOptions("localmodconfig" => \$localmodconfig,
121+
"localyesconfig" => \$localyesconfig);
122+
115123
# Get the build source and top level Kconfig file (passed in)
116124
my $ksource = $ARGV[0];
117125
my $kconfig = $ARGV[1];
@@ -425,7 +433,11 @@ sub parse_config_dep_select
425433

426434
if (/^(CONFIG.*)=(m|y)/) {
427435
if (defined($configs{$1})) {
428-
$setconfigs{$1} = $2;
436+
if ($localyesconfig) {
437+
$setconfigs{$1} = 'y';
438+
} else {
439+
$setconfigs{$1} = $2;
440+
}
429441
} elsif ($2 eq "m") {
430442
print "# $1 is not set\n";
431443
next;

0 commit comments

Comments
 (0)