-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
47 lines (41 loc) · 1.28 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
from distutils.core import setup
from distutils.extension import Extension
try:
from Cython.Distutils import build_ext
except ImportError:
use_cython = False
else:
use_cython = True
import os
fs = ['./r3/src/%s'%k for k in os.listdir('./r3/src') if k.endswith('.c') and 'gvc' not in k and 'json' not in k]
cmdclass = {}
ext_modules = []
if False and use_cython:
ext_modules += [
Extension(
"pyr3",
["cpyr3.pyx"] + fs + ['./r3/3rdparty/zmalloc.c'],
libraries=["pcre"],
include_dirs=['./r3/include', './r3', '/opt/local/include', './r3/3rdparty'],
library_dirs=['/usr/local/lib', '/opt/local/lib'],
extra_compile_args=['-std=c99'],
extra_link_args=['-std=c99']
)
]
cmdclass.update({ 'build_ext': build_ext })
else:
ext_modules += [
Extension(
"pyr3",
["cpyr3.c"] + fs + ['./r3/3rdparty/zmalloc.c'],
libraries=["pcre"],
include_dirs=['./r3/include', './r3', '/opt/local/include', './r3/3rdparty'],
library_dirs=['/usr/local/lib', '/opt/local/lib'],
extra_compile_args=['-std=c99'],
extra_link_args=['-std=c99']
)
]
setup(
cmdclass = cmdclass,
ext_modules = ext_modules
)