2012-07-30 16:32:42 +10:00
|
|
|
#!/usr/bin/env python
|
2012-02-02 11:25:36 +00:00
|
|
|
#
|
2013-01-01 09:45:50 +00:00
|
|
|
# Copyright (c) 2008-2013 WiredTiger, Inc.
|
|
|
|
|
# All rights reserved.
|
2012-02-02 11:25:36 +00:00
|
|
|
#
|
2012-02-02 20:18:52 +00:00
|
|
|
# See the file LICENSE for redistribution information.
|
2012-02-02 11:25:36 +00:00
|
|
|
|
2012-07-30 16:32:42 +10:00
|
|
|
import re, os, sys
|
2011-03-10 22:17:48 +11:00
|
|
|
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:
|
2012-07-30 16:32:42 +10:00
|
|
|
os.environ['ARCHFLAGS'] = ''
|
|
|
|
|
|
2012-12-10 23:08:06 +11:00
|
|
|
# Suppress warnings building SWIG generated code
|
|
|
|
|
extra_cflags = [
|
2013-05-08 16:28:35 +10:00
|
|
|
'-w',
|
2012-12-10 23:08:06 +11:00
|
|
|
]
|
2011-04-26 17:24:21 +10:00
|
|
|
|
|
|
|
|
dir = os.path.dirname(__file__)
|
2011-03-10 22:17:48 +11:00
|
|
|
|
2012-08-02 14:23:03 +10:00
|
|
|
# Read the version information from the RELEASE file
|
2013-07-17 10:13:11 +10:00
|
|
|
for l in open(os.path.join(dir, '..', '..', 'RELEASE')):
|
2012-07-30 16:32:42 +10:00
|
|
|
if re.match(r'WIREDTIGER_VERSION_(?:MAJOR|MINOR|PATCH)=', l):
|
|
|
|
|
exec(l)
|
2011-08-26 15:28:43 +10:00
|
|
|
|
|
|
|
|
wt_ver = '%d.%d' % (WIREDTIGER_VERSION_MAJOR, WIREDTIGER_VERSION_MINOR)
|
|
|
|
|
|
|
|
|
|
setup(name='wiredtiger', version=wt_ver,
|
2011-04-26 17:34:23 +10:00
|
|
|
ext_modules=[Extension('_wiredtiger',
|
2013-07-17 10:13:11 +10:00
|
|
|
[os.path.join(dir, 'wiredtiger_wrap.c')],
|
2012-07-30 16:32:42 +10:00
|
|
|
include_dirs=['../..'],
|
|
|
|
|
library_dirs=['../../.libs'],
|
|
|
|
|
libraries=['wiredtiger'],
|
|
|
|
|
extra_compile_args=extra_cflags,
|
|
|
|
|
)],
|
2013-07-17 10:13:11 +10:00
|
|
|
package_dir={'' : dir},
|
|
|
|
|
packages=['wiredtiger'],
|
2011-03-10 22:17:48 +11:00
|
|
|
)
|