public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Pawel Moll <pawel.moll@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools: perf: Avoid error message when building with no python installed
Date: Mon, 27 Jul 2015 20:36:01 +0200	[thread overview]
Message-ID: <20150727183601.GE20509@krava.brq.redhat.com> (raw)
In-Reply-To: <1438012255-26462-1-git-send-email-pawel.moll@arm.com>

On Mon, Jul 27, 2015 at 04:50:55PM +0100, Pawel Moll wrote:
> When run on a system without a python interpreter installed, the makefile
> probing python will try to execute
> 
> 	/bin/sh -c 'command -v -config [...]'
> 
> instead of
> 
> 	/bin/sh -c 'command -v python-config [...]'
> 
> resulting in the following error message:
> 
> 	sh: 1: command: Illegal option -c
> 
> Although harmless, the message can be quite confusing and hard to track.
> 
> Signed-off-by: Pawel Moll <pawel.moll@arm.com>
> ---
>  tools/perf/config/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
> index 094ddae..b4a9c29 100644
> --- a/tools/perf/config/Makefile
> +++ b/tools/perf/config/Makefile
> @@ -150,7 +150,7 @@ ifndef NO_LIBPYTHON
>    PYTHON2 := $(if $(call get-executable,python2),python2,python)
>    override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON2))
>    PYTHON2_CONFIG := \
> -    $(if $(call get-executable,$(PYTHON)-config),$(PYTHON)-config,python-config)
> +    $(if $(PYTHON),$(if $(call get-executable,$(PYTHON)-config),$(PYTHON)-config,python-config))
>    override PYTHON_CONFIG := \
>      $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON2_CONFIG))

haven't tried, but seems like we want to add also the else part
to get default into PYTHON_CONFIG?

it fails anyway later either way, but seems like the 'python-config'
was the default case that was meant to fail later

jirka


---
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f04f92093e37..7cf71a4d3a1f 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -150,7 +150,7 @@ ifndef NO_LIBPYTHON
   PYTHON2 := $(if $(call get-executable,python2),python2,python)
   override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON2))
   PYTHON2_CONFIG := \
-    $(if $(PYTHON),$(if $(call get-executable,$(PYTHON)-config),$(PYTHON)-config,python-config))
+    $(if $(PYTHON),$(if $(call get-executable,$(PYTHON)-config),$(PYTHON)-config,python-config),python-config)
   override PYTHON_CONFIG := \
     $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON2_CONFIG))
 

  reply	other threads:[~2015-07-27 18:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 15:50 [PATCH] tools: perf: Avoid error message when building with no python installed Pawel Moll
2015-07-27 18:36 ` Jiri Olsa [this message]
2015-07-28 12:49   ` Pawel Moll
2015-07-28 13:44     ` Jiri Olsa

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=20150727183601.GE20509@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=pawel.moll@arm.com \
    /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