-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
54 lines (45 loc) · 1.41 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python
import sys
import os
import subprocess
from setuptools import setup
from distutils.command.build import build
if sys.platform == 'darwin':
sofile = 'rdtsc.dylib'
elif sys.platform == 'win32':
sofile = 'rdtsc.dll'
else:
sofile = 'rdtsc.so.1'
class RTDSCBuild(build):
def initialize_options(self):
build.initialize_options(self)
self.build_base = os.path.join(self.build_base, 'python')
def run(self):
subprocess.call(['cc', '-shared', '-o',
os.path.join('src', 'rdtsc', sofile), '-fPIC',
'src/rdtsc.c'])
build.run(self)
setup(
name="rdtsc",
version="0.2.1",
author="James Brown",
author_email="[email protected]",
url="https://github.com/Roguelazer/rdtsc",
license="ISC",
packages=['rdtsc'],
package_dir={'rdtsc': 'src/rdtsc'},
cmdclass={'build': RTDSCBuild},
package_data={'rdtsc': [sofile]},
keywords=["performance"],
description="Cycle timer wrapping the Intel x86 RTDSC instruction",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: C",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Intended Audience :: Developers",
"License :: OSI Approved :: ISC License (ISCL)",
],
zip_safe=False,
)