From 45bff41a9a6f22af28e4ba22f83c87f619e573a8 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 18 Oct 2012 11:38:35 -0300 Subject: perf python: Properly link with libtraceevent Namhyung Kim reported that the build fails with: GEN python/perf.so gcc: error: python_ext_build/tmp//../../libtraceevent.a: No such file or directory error: command 'gcc' failed with exit status 1 cp: cannot stat `python_ext_build/lib/perf.so': No such file or directory make: *** [python/perf.so] Error 1 We need to propagate the TE_PATH variable to the setup.py file. Reported-by: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo Link: http://lkml.kernel.org/n/tip-8umiPbm4sxpknKivbjgykhut@git.kernel.org [ Fixed superfluous variable build error. ] Signed-off-by: Ingo Molnar --- tools/perf/util/python.c | 2 -- tools/perf/util/setup.py | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'tools/perf/util') diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index a2657fd9683..9181bf212fb 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -1015,8 +1015,6 @@ PyMODINIT_FUNC initperf(void) pyrf_cpu_map__setup_types() < 0) return; - page_size = sysconf(_SC_PAGE_SIZE); - Py_INCREF(&pyrf_evlist__type); PyModule_AddObject(module, "evlist", (PyObject*)&pyrf_evlist__type); diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index 09c3cea95d3..73d51026978 100644 --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py @@ -23,6 +23,7 @@ cflags += getenv('CFLAGS', '').split() build_lib = getenv('PYTHON_EXTBUILD_LIB') build_tmp = getenv('PYTHON_EXTBUILD_TMP') +libtraceevent = getenv('LIBTRACEEVENT') ext_sources = [f.strip() for f in file('util/python-ext-sources') if len(f.strip()) > 0 and f[0] != '#'] @@ -31,7 +32,7 @@ perf = Extension('perf', sources = ext_sources, include_dirs = ['util/include'], extra_compile_args = cflags, - extra_objects = [build_tmp + '/../../libtraceevent.a'], + extra_objects = [libtraceevent], ) setup(name='perf', -- cgit v1.2.3-70-g09d2