2012-07-30 16:32:42 +10:00
|
|
|
#!/usr/bin/env python
|
2012-02-02 11:25:36 +00:00
|
|
|
#
|
2012-02-02 20:18:52 +00:00
|
|
|
# Copyright (c) 2008-2012 WiredTiger, Inc.
|
2012-07-30 16:32:42 +10:00
|
|
|
# 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'] = ''
|
|
|
|
|
|
|
|
|
|
# Suppress warnings building SWIG code on OS X 10.8
|
|
|
|
|
extra_cflags = []
|
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
|
kernel_version = os.uname()[2] # e.g. 12.0.0 is Mountain Lion
|
|
|
|
|
major_version = int(kernel_version.split('.')[0])
|
|
|
|
|
if major_version >= 12:
|
|
|
|
|
extra_cflags += ['-Wno-self-assign', '-Qunused-arguments']
|
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
|
|
|
|
|
top = os.path.dirname(os.path.dirname(dir))
|
|
|
|
|
for l in open(os.path.join(top, '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',
|
2012-07-30 16:32:42 +10:00
|
|
|
[os.path.join(dir, 'wiredtiger_wrap.c')],
|
|
|
|
|
include_dirs=['../..'],
|
|
|
|
|
library_dirs=['../../.libs'],
|
|
|
|
|
libraries=['wiredtiger'],
|
|
|
|
|
extra_compile_args=extra_cflags,
|
|
|
|
|
)],
|
|
|
|
|
py_modules=['wiredtiger'],
|
2011-03-10 22:17:48 +11:00
|
|
|
)
|