summaryrefslogtreecommitdiff
path: root/lang/python/setup.py
blob: 5bf81970f601507f8a0d118dd3bb14963b7ff843 (plain)
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
#!/usr/bin/env python
#
# Copyright (c) 2008-2013 WiredTiger, Inc.
#	All rights reserved.
#
# See the file LICENSE for redistribution information.

import re, os, sys
from distutils.core import setup, Extension

# OS X hack: turn off the Universal binary support that is built into the
# Python build machinery, just build for the default CPU architecture.
if not 'ARCHFLAGS' in os.environ:
    os.environ['ARCHFLAGS'] = ''

# Suppress warnings building SWIG generated code
extra_cflags = [
				'-w',
]

dir = os.path.dirname(__file__)

# Read the version information from the RELEASE file
top = os.path.dirname(os.path.dirname(dir))
for l in open(os.path.join(top, 'RELEASE')):
    if re.match(r'WIREDTIGER_VERSION_(?:MAJOR|MINOR|PATCH)=', l):
        exec(l)

wt_ver = '%d.%d' % (WIREDTIGER_VERSION_MAJOR, WIREDTIGER_VERSION_MINOR)

setup(name='wiredtiger', version=wt_ver,
    ext_modules=[Extension('_wiredtiger',
        [os.path.join(dir, 'wiredtiger_wrap.c')],
        include_dirs=['../..'],
        library_dirs=['../../.libs'],
        libraries=['wiredtiger'],
        extra_compile_args=extra_cflags,
    )],
    py_modules=['wiredtiger'],
)