public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Raghavendra D Prabhu <rprabhu@wnohang.net>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Use the environment variable PYTHON if defined
Date: Sun, 27 Mar 2011 04:14:08 +0530	[thread overview]
Message-ID: <20110326224408.GA1336@Xye> (raw)

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

On systems with python{2,3} installed, perf build can break which can be fixed by
exporting PYTHON to the right value. Added support for PYTHON in the Makefile.
---
  tools/perf/Makefile |    8 ++++++--
  1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7141c42..d998221 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -149,6 +149,9 @@ endif
  #
  # Define NO_PERL if you do not want Perl scripts or libraries at all.
  #
+# Define PYTHON to point to python binary if it is not
+# /usr/bin/python, it will be used/called as $PYTHON-config.
+#
  # Define INTERNAL_QSORT to use Git's implementation of qsort(), which
  # is a simplified version of the merge sort used in glibc. This is
  # recommended if Git triggers O(n^2) behavior in your platform's qsort().
@@ -629,10 +632,11 @@ endif
  ifdef NO_LIBPYTHON
  	BASIC_CFLAGS += -DNO_LIBPYTHON
  else
-       PYTHON_EMBED_LDOPTS = $(shell python-config --ldflags 2>/dev/null)
+       PYTHON ?= /usr/bin/python
+       PYTHON_EMBED_LDOPTS = $(shell $(PYTHON)-config --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 = `python-config --cflags 2>/dev/null`
+	PYTHON_EMBED_CCOPTS = ` $(PYTHON)-config --cflags 2>/dev/null`
  	FLAGS_PYTHON_EMBED=$(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
  	ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
  		BASIC_CFLAGS += -DNO_LIBPYTHON
-- 
1.7.4.1

--------------------------
Raghavendra Prabhu
GPG ID:D72BE977


[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

             reply	other threads:[~2011-03-26 22:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26 22:44 Raghavendra D Prabhu [this message]
2011-03-28 14:47 ` [PATCH] Use the environment variable PYTHON if defined Arnaldo Carvalho de Melo
2011-03-28 22:36   ` Michael Witten
2011-03-29 18:15     ` Raghavendra D Prabhu
2011-03-29 19:15       ` Michael Witten
2011-03-29 20:40         ` Arnaldo Carvalho de Melo
2011-03-29 21:02           ` Michael Witten
2011-03-29 21:14             ` Arnaldo Carvalho de Melo
2011-03-31 19:15               ` Raghavendra D Prabhu
2011-03-31 20:29                 ` Michael Witten
2011-04-02 20:46                   ` Raghavendra D Prabhu
2011-04-02 22:40                     ` Michael Witten
2011-03-31 15:37           ` Michael Witten
2011-04-08 21:17             ` Raghavendra D Prabhu
2011-04-09  1:24               ` Michael Witten
2011-04-02 21:46                 ` [PATCH 2/2] perf tools: Makefile: PYTHON{,_CONFIG} to bandage Python 3 incompatibility Michael Witten
2011-04-09  1:12                 ` [PATCH 1/2] perf tools: Makefile: Clean up `python/perf.so' rule Michael Witten
2011-04-09 18:42                 ` [PATCH] Use the environment variable PYTHON if defined Raghavendra D Prabhu
2011-04-09 20:34                   ` Michael Witten
2011-04-12 20:52                     ` [PULL] Improve Python 3 handling Michael Witten
2011-04-21  9:22     ` [tip:perf/core] perf tools: Makefile: PYTHON{,_CONFIG} to bandage Python 3 incompatibility tip-bot for Michael Witten

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=20110326224408.GA1336@Xye \
    --to=rprabhu@wnohang.net \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.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