mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Sam Ravnborg <sam@ravnborg.org>,
	Stephane Eranian <eranian@google.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 44/66] perf tools: Move libpython check config into config/Makefile
Date: Thu, 30 May 2013 19:01:17 +0300	[thread overview]
Message-ID: <1369929699-8724-45-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1369929699-8724-1-git-send-email-acme@infradead.org>

From: Jiri Olsa <jolsa@redhat.com>

Moving libpython check config into config/Makefile.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1369398928-9809-13-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile        | 68 ++--------------------------------------------
 tools/perf/config/Makefile | 63 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 65 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index f856bb5..061de65 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -196,8 +196,6 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
 #
 PROGRAMS += $(OUTPUT)perf
 
-LANG_BINDINGS =
-
 # what 'all' will build and 'install' will install, in perfexecdir
 ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
 
@@ -535,69 +533,9 @@ ifndef NO_LIBPERL
 	LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
 endif
 
-disable-python = $(eval $(disable-python_code))
-define disable-python_code
-  BASIC_CFLAGS += -DNO_LIBPYTHON
-  $(if $(1),$(warning No $(1) was found))
-  $(warning Python support will not be built)
-endef
-
-override PYTHON := \
-  $(call get-executable-or-default,PYTHON,python)
-
-ifndef PYTHON
-  $(call disable-python,python interpreter)
-else
-
-  PYTHON_WORD := $(call shell-wordify,$(PYTHON))
-
-  ifdef NO_LIBPYTHON
-    $(call disable-python)
-  else
-
-    override PYTHON_CONFIG := \
-      $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
-
-    ifndef PYTHON_CONFIG
-      $(call disable-python,python-config tool)
-    else
-
-      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)
-
-      ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED),python),y)
-        $(call disable-python,Python.h (for Python 2.x))
-      else
-
-        ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED),python version),y)
-          $(warning Python 3 is not yet supported; please set)
-          $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
-          $(warning If you also have Python 2 installed, then)
-          $(warning try something like:)
-          $(warning $(and ,))
-          $(warning $(and ,)  make PYTHON=python2)
-          $(warning $(and ,))
-          $(warning Otherwise, disable Python support entirely:)
-          $(warning $(and ,))
-          $(warning $(and ,)  make NO_LIBPYTHON=1)
-          $(warning $(and ,))
-          $(error   $(and ,))
-        else
-          ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
-          EXTLIBS += $(PYTHON_EMBED_LIBADD)
-          LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
-          LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
-          LANG_BINDINGS += $(OUTPUT)python/perf.so
-        endif
-
-      endif
-    endif
-  endif
+ifndef NO_LIBPYTHON
+	LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
+	LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
 endif
 
 ifdef NO_DEMANGLE
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index a42c7b8..b9b1465 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -261,3 +261,66 @@ else
 		EXTLIBS += $(PERL_EMBED_LIBADD)
 	endif
 endif
+
+disable-python = $(eval $(disable-python_code))
+define disable-python_code
+  BASIC_CFLAGS += -DNO_LIBPYTHON
+  $(if $(1),$(warning No $(1) was found))
+  $(warning Python support will not be built)
+  NO_LIBPYTHON := 1
+endef
+
+override PYTHON := \
+  $(call get-executable-or-default,PYTHON,python)
+
+ifndef PYTHON
+  $(call disable-python,python interpreter)
+else
+
+  PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+
+  ifdef NO_LIBPYTHON
+    $(call disable-python)
+  else
+
+    override PYTHON_CONFIG := \
+      $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
+
+    ifndef PYTHON_CONFIG
+      $(call disable-python,python-config tool)
+    else
+
+      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)
+
+      ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED),python),y)
+        $(call disable-python,Python.h (for Python 2.x))
+      else
+
+        ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED),python version),y)
+          $(warning Python 3 is not yet supported; please set)
+          $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
+          $(warning If you also have Python 2 installed, then)
+          $(warning try something like:)
+          $(warning $(and ,))
+          $(warning $(and ,)  make PYTHON=python2)
+          $(warning $(and ,))
+          $(warning Otherwise, disable Python support entirely:)
+          $(warning $(and ,))
+          $(warning $(and ,)  make NO_LIBPYTHON=1)
+          $(warning $(and ,))
+          $(error   $(and ,))
+        else
+          ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
+          EXTLIBS += $(PYTHON_EMBED_LIBADD)
+          LANG_BINDINGS += $(OUTPUT)python/perf.so
+        endif
+      endif
+    endif
+  endif
+endif
-- 
1.8.1.4


  parent reply	other threads:[~2013-05-30 16:05 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 16:00 [GIT PULL 00/66] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 01/66] perf tools: Fix bug in isupper() and islower() Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 02/66] perf hists: Fix an invalid memory free on he->branch_info Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 03/66] perf hists: Free unused mem info of a matched hist entry Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 04/66] perf report: Fix alignment of symbol column when -v is given Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 05/66] perf sort: Introduce sort__mode variable Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 06/66] perf sort: Factor out common code in sort_dimension__add() Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 07/66] perf sort: Separate out memory-specific sort keys Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 08/66] perf sort: Consolidate sort_entry__setup_elide() Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 09/66] perf archive: Fix typo on Documentation Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 10/66] perf sort: Reorder HISTC_SRCLINE index Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 11/66] perf sort: Cleanup sort__has_sym setting Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 12/66] perf top: Use sort__has_sym Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 13/66] perf hists browser: " Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 14/66] perf tools: Fix tab vs spaces issue in Makefile ifdef/endif Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 15/66] perf tests: Fix compile errors in bp_signal files Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 16/66] perf tools: Handle JITed code in shared memory Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 17/66] perf record: handle death by SIGTERM Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 18/66] perf top: Fix -E option behavior Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 19/66] perf top: Fix percent output when no samples collected Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 20/66] perf top: Get rid of *_threaded() functions Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 21/66] perf hists: Move locking to its call-sites Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 22/66] perf report: Don't bother locking when adding hist entries Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 23/66] perf report: Add --percent-limit option Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 24/66] perf top: " Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 25/66] perf report: Add report.percent-limit config variable Arnaldo Carvalho de Melo
2013-05-30 16:00 ` [PATCH 26/66] perf diff: Use internal rb tree for hists__precompute Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 27/66] perf hists: Rename hist_entry__add_pair arguments Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 28/66] perf test: Fix typo Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 29/66] perf evsel: Fix printing of perf_event_paranoid message Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 30/66] perf kvm: Handle realloc failures Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 31/66] perf stats: Fix divide by 0 in variance Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 32/66] perf tools: Save parent pid in thread struct Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 33/66] perf tools: Add automated make test suite Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 34/66] perf tools: Move arch check into config/Makefile Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 35/66] perf tools: Move programs " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 36/66] perf tools: Move compiler and linker flags " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 37/66] perf tools: Move libelf check config " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 38/66] perf tools: Move libdw " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 39/66] perf tools: Move libunwind " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 40/66] perf tools: Move libaudit " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 41/66] perf tools: Move slang " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 42/66] perf tools: Move gtk2 " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 43/66] perf tools: Move libperl " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` Arnaldo Carvalho de Melo [this message]
2013-05-30 16:01 ` [PATCH 45/66] perf tools: Move libbfd " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 46/66] perf tools: Move stdlib " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 47/66] perf tools: Move libnuma " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 48/66] perf tools: Move paths " Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 49/66] perf tools: Final touches for CHK config move Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 50/66] perf tests: Fix attr test for record -d option Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 51/66] perf tests: Fix exclude_guest|exclude_host checking for attr tests Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 52/66] perf tools: Remove frozen from perf_header struct Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 53/66] perf tools: Remove cwdlen from struct perf_session Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 54/66] tools lib lk: Respect CROSS_COMPILE Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 55/66] perf: Power7: Make CPI stack events available in sysfs Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 56/66] perf: Power7 Update testing ABI to list CPI-stack events Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 57/66] perf: Expand definition of sysfs format attribute Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 58/66] perf evlist: Reset SIGTERM handler in workload child process Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 59/66] perf tools: Merge all *CFLAGS* make variable into CFLAGS Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 60/66] perf tools: Merge all *LDFLAGS* make variable into LDFLAGS Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 61/66] perf tools: Switch to full path C include directories Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 62/66] perf tools: Add NO_BIONIC variable to confiure bionic setup Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 63/66] perf tools: Replace tabs with spaces for all non-commands statements Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 64/66] perf tools: Replace multiple line assignment with multiple statements Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 65/66] perf tools: Remove '?=' Makefile STRIP assignment Arnaldo Carvalho de Melo
2013-05-30 16:01 ` [PATCH 66/66] perf tools: Add missing liblk.a dependency for python/perf.so Arnaldo Carvalho de Melo
2013-05-31 11:04 ` [GIT PULL 00/66] perf/core improvements and fixes Ingo Molnar

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=1369929699-8724-45-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=bp@alien8.de \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --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®