Skip to content

Commit

Permalink
kconfig/streamline_config.pl: use options to determine operating mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lacombar committed Aug 8, 2011
1 parent f597a71 commit 22d550a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ silentoldconfig: $(obj)/conf

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

localyesconfig: $(obj)/streamline_config.pl $(obj)/conf
$(Q)mkdir -p include/generated
$(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
$(Q)sed -i s/=m/=y/ .tmp.config
$(Q)if [ -f .config ]; then \
cmp -s .tmp.config .config || \
Expand Down
14 changes: 13 additions & 1 deletion scripts/kconfig/streamline_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
# make oldconfig
#
use strict;
use Getopt::Long;

my $config = ".config";

Expand Down Expand Up @@ -112,6 +113,13 @@ sub find_config {

find_config;

# Parse options
my $localmodconfig = 0;
my $localyesconfig = 0;

GetOptions("localmodconfig" => \$localmodconfig,
"localyesconfig" => \$localyesconfig);

# Get the build source and top level Kconfig file (passed in)
my $ksource = $ARGV[0];
my $kconfig = $ARGV[1];
Expand Down Expand Up @@ -425,7 +433,11 @@ sub parse_config_dep_select

if (/^(CONFIG.*)=(m|y)/) {
if (defined($configs{$1})) {
$setconfigs{$1} = $2;
if ($localyesconfig) {
$setconfigs{$1} = 'y';
} else {
$setconfigs{$1} = $2;
}
} elsif ($2 eq "m") {
print "# $1 is not set\n";
next;
Expand Down

0 comments on commit 22d550a

Please sign in to comment.