All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
To: Namhyung Kim <namhyung@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@kernel.org>, Paul Mackerras <paulus@samba.org>,
	Namhyung Kim <namhyung.kim@lge.com>,
	LKML <linux-kernel@vger.kernel.org>, Jiri Olsa <jolsa@redhat.com>
Subject: Re: [PATCH 1/2] perf tools: Fix make PYTHON override
Date: Fri, 25 Jul 2014 09:23:30 +0200	[thread overview]
Message-ID: <53D205F2.1040901@tu-dresden.de> (raw)
In-Reply-To: <1406258045-25726-1-git-send-email-namhyung@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 4338 bytes --]

Hi Namhyung,

On 2014-07-25 05:14, Namhyung Kim wrote:
> Thomas reported that make PYTHON=python2 is not work on some systems.
> I can reproduce it on my ArchLinux box too.
> 
> This is because it's overridden by config/feature-checks/Makefile
> regardless of PYTHON setting.  I guess it's a bug slipped into during
> the feature checking change.
> 
> Actually, we don't need to check python-config in the feature-checks.
> We can just pass appropriate FEATURE_CHECK_*FLAGS.

The patch works fine for me.

Thanks,
Thomas

> 
> Reported-by: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/config/Makefile                | 34 ++++++++++++++++++++-----------
>  tools/perf/config/feature-checks/Makefile | 18 ++--------------
>  2 files changed, 24 insertions(+), 28 deletions(-)
> 
> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
> index 1f67aa02d240..e05d8f99424d 100644
> --- a/tools/perf/config/Makefile
> +++ b/tools/perf/config/Makefile
> @@ -120,6 +120,23 @@ ifdef PARSER_DEBUG
>    CFLAGS             += -DPARSER_DEBUG
>  endif
>  
> +ifndef NO_LIBPYTHON
> +  override PYTHON := \
> +    $(call get-executable-or-default,PYTHON,python)
> +  override PYTHON_CONFIG := \
> +    $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
> +
> +  PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
> +
> +  PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
> +  PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
> +
> +  FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
> +  FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
> +  FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS)
> +  FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS)
> +endif
> +
>  CFLAGS += -fno-omit-frame-pointer
>  CFLAGS += -ggdb3
>  CFLAGS += -funwind-tables
> @@ -482,21 +499,14 @@ define disable-python_code
>    NO_LIBPYTHON := 1
>  endef
>  
> -override PYTHON := \
> -  $(call get-executable-or-default,PYTHON,python)
> -
> -ifndef PYTHON
> -  $(call disable-python,python interpreter)
> +ifdef NO_LIBPYTHON
> +  $(call disable-python)
>  else
>  
> -  PYTHON_WORD := $(call shell-wordify,$(PYTHON))
> -
> -  ifdef NO_LIBPYTHON
> -    $(call disable-python)
> +  ifndef PYTHON
> +    $(call disable-python,python interpreter)
>    else
> -
> -    override PYTHON_CONFIG := \
> -      $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
> +    PYTHON_WORD := $(call shell-wordify,$(PYTHON))
>  
>      ifndef PYTHON_CONFIG
>        $(call disable-python,python-config tool)
> diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile
> index 6088f8d8a434..72ab2984718e 100644
> --- a/tools/perf/config/feature-checks/Makefile
> +++ b/tools/perf/config/feature-checks/Makefile
> @@ -101,25 +101,11 @@ FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
>  test-libperl.bin:
>  	$(BUILD) $(FLAGS_PERL_EMBED)
>  
> -override PYTHON := python
> -override PYTHON_CONFIG := python-config
> -
> -escape-for-shell-sq =  $(subst ','\'',$(1))
> -shell-sq = '$(escape-for-shell-sq)'
> -
> -PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG))
> -
> -PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
> -PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
> -PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
> -PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
> -FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
> -
>  test-libpython.bin:
> -	$(BUILD) $(FLAGS_PYTHON_EMBED)
> +	$(BUILD)
>  
>  test-libpython-version.bin:
> -	$(BUILD) $(FLAGS_PYTHON_EMBED)
> +	$(BUILD)
>  
>  test-libbfd.bin:
>  	$(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
> 

-- 
Dipl. Inf. Thomas Ilsche
Computer Scientist
Highly Adaptive Energy-Efficient Computing
CRC 912 HAEC: http://tu-dresden.de/sfb912
Technische Universität Dresden
Center for Information Services and High Performance Computing (ZIH)
01062 Dresden, Germany

Phone: +49 351 463-42168
Fax: +49 351 463-3773
E-Mail: thomas.ilsche@tu-dresden.de


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5015 bytes --]

      parent reply	other threads:[~2014-07-25  7:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24 16:36 Perf: cannot overide PYTHON(_CONFIG) Thomas Ilsche
2014-07-25  3:14 ` [PATCH 1/2] perf tools: Fix make PYTHON override Namhyung Kim
2014-07-25  3:14   ` [PATCH 2/2] perf tools: Default to python version 2 Namhyung Kim
2014-07-25  9:28     ` Thomas Ilsche
2014-07-25 10:24       ` Namhyung Kim
2014-07-25 11:43         ` Thomas Ilsche
2014-07-28  0:06           ` Namhyung Kim
2014-07-28 11:11             ` Thomas Ilsche
2014-07-29  6:38               ` Namhyung Kim
2014-07-25  7:23   ` Thomas Ilsche [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=53D205F2.1040901@tu-dresden.de \
    --to=thomas.ilsche@tu-dresden.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.