mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Jenkins <sourcejedi.lkml@googlemail.com>
To: "Luis R. Rodriguez" <lrodriguez@atheros.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Luis Rodriguez <Luis.Rodriguez@atheros.com>,
	"sam@ravnborg.org" <sam@ravnborg.org>,
	"greg@kroah.com" <greg@kroah.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"mcgrof@gmail.com" <mcgrof@gmail.com>
Subject: Re: [PATCH 2/4] kconfig: streamline_config.pl: fix out-of-tree builds
Date: Fri, 20 Nov 2009 17:25:25 +0000	[thread overview]
Message-ID: <9b2b86520911200925r55e08858wceae2471fcf3b063@mail.gmail.com> (raw)
In-Reply-To: <20091120164633.GC13136@tux>

On 11/20/09, Luis R. Rodriguez <lrodriguez@atheros.com> wrote:
> On Fri, Nov 20, 2009 at 07:50:52AM -0800, Alan Jenkins wrote:
>> We should look for Kconfig under $srctree, just like zconf.l does.
>> This allows "make localmodconfig" to work when using a separate build
>> directory (e.g. make O=../build).
>>
>> Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
>> ---
>>  scripts/kconfig/streamline_config.pl |   10 +++++++---
>>  1 files changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/scripts/kconfig/streamline_config.pl
>> b/scripts/kconfig/streamline_config.pl
>> index 7d898e3..7a7bcf7 100644
>> --- a/scripts/kconfig/streamline_config.pl
>> +++ b/scripts/kconfig/streamline_config.pl
>> @@ -46,7 +46,7 @@ use warnings;
>>  #    make oldconfig
>>  #
>>  my $config = ".config";
>> -my $linuxpath = ".";
>> +my $srctree = $ENV{"srctree"} || ".";
>>
>>  my $uname = `uname -r`;
>>  chomp $uname;
>> @@ -114,7 +114,7 @@ sub find_config {
>>
>>  find_config;
>>
>> -my @makefiles = `find $linuxpath -name Makefile`;
>> +my @makefiles = `find $srctree -name Makefile`;
>>  my %depends;
>>  my %selects;
>>  my %prompts;
>> @@ -135,7 +135,11 @@ sub read_kconfig {
>>      my $config;
>>      my @kconfigs;
>>
>> -    open(KIN, $kconfig) || die "Can't open $kconfig";
>> +    open(KIN, $kconfig) || (
>> +       $kconfig =~ "^[^/]" &&
>> +       open(KIN, $srctree . "/" . $kconfig)
>> +    ) || die "Can't open $kconfig";
>> +
>
> God I hate perl, can this be a little perl-un-obfuscated a bit?

Agreed.  I'll simplify it to

$kconfig = $srctree . "/" . $kconfig;
open(KIN, $kconfig) || die "Can't open $kconfig";

I'll re-send when I've figured out how to stop CONFIG_ATA=m being
deselected.  (It looks like I need to handle "menuconfig" as well as
"config").

Thanks
Alan

      reply	other threads:[~2009-11-20 17:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 15:50 [PATCH 0/4] kconfig: streamline_config.pl: optionally accept lsmod output Alan Jenkins
2009-11-20 15:50 ` [PATCH 1/4] kconfig: streamline_config.pl: "use strict" (and fix the errors) Alan Jenkins
2009-11-20 15:50   ` [PATCH 2/4] kconfig: streamline_config.pl: fix out-of-tree builds Alan Jenkins
2009-11-20 15:50     ` [PATCH 3/4] kconfig: streamline_config.pl: add handling for "if" statements in Kconfig Alan Jenkins
2009-11-20 15:50       ` [PATCH 4/4] kconfig: streamline_config.pl: let users specify the list of desired modules Alan Jenkins
2009-11-20 17:51         ` Luis R. Rodriguez
2009-11-20 16:46     ` [PATCH 2/4] kconfig: streamline_config.pl: fix out-of-tree builds Luis R. Rodriguez
2009-11-20 17:25       ` Alan Jenkins [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b2b86520911200925r55e08858wceae2471fcf3b063@mail.gmail.com \
    --to=sourcejedi.lkml@googlemail.com \
    --cc=Luis.Rodriguez@atheros.com \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrodriguez@atheros.com \
    --cc=mcgrof@gmail.com \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®