diff options
author | Elliott Hughes <enh@google.com> | 2015-02-18 18:53:26 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-02-18 18:53:26 -0800 |
commit | c8ec03e66ee9fe1aefea9555b98aa5f5f7935d5c (patch) | |
tree | c74cd86bf0d537c9408f7d60ce6567239ca7ad8d /src/tools/perf/util/setup.py | |
parent | 9905f7e1a0a1530dfeaa239ffd2eb9e6cfff6ff5 (diff) | |
download | linux-tools-perf-c8ec03e66ee9fe1aefea9555b98aa5f5f7935d5c.tar.gz |
Lose the version number from the directory name.
This way, next time we sync with upstream we'll have an actual diff to look at.
Change-Id: I6474968f55ba42696c2ee894586d34f84f9f6630
Diffstat (limited to 'src/tools/perf/util/setup.py')
-rw-r--r-- | src/tools/perf/util/setup.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/tools/perf/util/setup.py b/src/tools/perf/util/setup.py new file mode 100644 index 0000000..58ea5ca --- /dev/null +++ b/src/tools/perf/util/setup.py @@ -0,0 +1,48 @@ +#!/usr/bin/python2 + +from distutils.core import setup, Extension +from os import getenv + +from distutils.command.build_ext import build_ext as _build_ext +from distutils.command.install_lib import install_lib as _install_lib + +class build_ext(_build_ext): + def finalize_options(self): + _build_ext.finalize_options(self) + self.build_lib = build_lib + self.build_temp = build_tmp + +class install_lib(_install_lib): + def finalize_options(self): + _install_lib.finalize_options(self) + self.build_dir = build_lib + + +cflags = getenv('CFLAGS', '').split() +# switch off several checks (need to be at the end of cflags list) +cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter' ] + +build_lib = getenv('PYTHON_EXTBUILD_LIB') +build_tmp = getenv('PYTHON_EXTBUILD_TMP') +libtraceevent = getenv('LIBTRACEEVENT') +liblk = getenv('LIBLK') + +ext_sources = [f.strip() for f in file('util/python-ext-sources') + if len(f.strip()) > 0 and f[0] != '#'] + +perf = Extension('perf', + sources = ext_sources, + include_dirs = ['util/include'], + extra_compile_args = cflags, + extra_objects = [libtraceevent, liblk], + ) + +setup(name='perf', + version='0.1', + description='Interface with the Linux profiling infrastructure', + author='Arnaldo Carvalho de Melo', + author_email='acme@redhat.com', + license='GPLv2', + url='http://perf.wiki.kernel.org', + ext_modules=[perf], + cmdclass={'build_ext': build_ext, 'install_lib': install_lib}) |