-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
49 lines (44 loc) · 1.71 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
# -*- coding: utf-8 -*-
#
# LICENCE MIT
#
# DESCRIPTION Setup for teng package.
#
# AUTHOR Michal Bukovsky <[email protected]>
#
import os, sys
from distutils.core import setup
from distutils.core import Extension
# detect python version
version = []
if hasattr(sys.version_info, 'major'):
version.append(sys.version_info.major)
version.append(sys.version_info.minor)
else:
version = sys.version_info[0:2]
# detect boost_python library name
pattern = 'ld -o /dev/null --allow-shlib-undefined -lXXX > /dev/null 2>&1'
boost_python = 'boost_python-py%d%d' % (version[0], version[1])
if os.system(pattern.replace('XXX', boost_python)) != 0:
boost_python = 'boost_python-%d.%d' % (version[0], version[1])
if os.system(pattern.replace('XXX', boost_python)) != 0:
boost_python = 'boost_python%d%d' % (version[0], version[1])
if os.system(pattern.replace('XXX', boost_python)) != 0:
print('can\'t find boost_python library')
sys.exit(1)
print('checking boost_python library name: ' + boost_python)
setup(name="teng",
version="1.0.13",
description="Teng python module written on boost python.",
author="Michal Bukovsky",
author_email="[email protected]",
packages=["teng"],
license="MIT",
ext_modules=[Extension("rawteng",
["teng/rawteng.cc"],
extra_compile_args=["-W",
"-Wall",
"-Wextra",
"-Wconversion",
"-std=c++11"],
libraries=[boost_python, "teng"])])