forked from cmu-sei/pharos-demangle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
58 lines (46 loc) · 1.98 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
55
56
57
58
from setuptools import setup
#from distutils.core import setup
from distutils.extension import Extension
from distutils.command.build_ext import build_ext
import os
import sys
###
# build an rpm with the command:
###
#
# python3 setup.py bdist_rpm
__version__ = '1.2'
libraries = ['boost_python'] if sys.version_info[0] < 3 else ['boost_python3']
libraries += ['boost_system','boost_filesystem','boost_program_options']
class BuildExt(build_ext):
def build_extensions(self):
ct = self.compiler.compiler_type
opts = []
if ct == 'unix':
# only add flags which pass the flag_filter
opts += ["-Wextra", "-Wshadow", "-Wstrict-aliasing"]
for ext in self.extensions:
ext.extra_compile_args = opts
build_ext.build_extensions(self)
pydemanglemodule = Extension("pydemangle",
define_macros = [('MAJOR_VERSION', '1'),
('MINOR_VERSION', '2')],
include_dirs = [os.path.join(os.getcwd(), 'libdemangle'), os.getcwd(),],
libraries = libraries,
library_dirs = [os.getcwd(),],
sources = ['libdemangle/codes.cpp', 'libdemangle/json.cpp', 'libdemangle/demangle_json.cpp', 'libdemangle/demangle.cpp', 'libdemangle/demangle_text.cpp', 'src/pydemanglemodule.cpp'],
extra_compile_args=["-std=c++11", "-Wall"],
language='c++11')
setup(name='pydemangle',
cmdclass=dict(build_ext=BuildExt),
version=__version__,
include_package_data=True,
description='Python interface for Pharos Demangler',
url='https://code.cc.cert.org/Malicious-Code-Team/demangle',
author='Garret Wassermann',
author_email='[email protected]',
license='MIT',
classifiers=['Programming Language :: Python :: 2',
'Programming Language :: Python :: 3'],
ext_modules=[pydemanglemodule],
zip_safe=False)