Files
mongo/lang/python/setup.py
Michael Cahill 06e48b3b0b Move dist/RELEASE to the top level of the tree.
Bump the version to 1.2.3 to check that it is updated everywhere.

--HG--
rename : dist/RELEASE => RELEASE
2012-08-02 14:23:03 +10:00

44 lines
1.4 KiB
Python

#!/usr/bin/env python
#
# Copyright (c) 2008-2012 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 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']
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'],
)