diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-07-30 16:32:42 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-07-30 16:32:42 +1000 |
commit | b7c593b39b938836b46925bf8373542f63dcd5ac (patch) | |
tree | f0c702fa5de41e479ad7d01733dcd37308ce2f98 | |
parent | b608c27425a384cecb2d94970134f5535697c66b (diff) | |
download | mongo-b7c593b39b938836b46925bf8373542f63dcd5ac.tar.gz |
Fix warnings in SWIG code on OS X 10.8.
-rw-r--r-- | lang/python/setup.py | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/lang/python/setup.py b/lang/python/setup.py index 366f71532eb..61e936218e5 100644 --- a/lang/python/setup.py +++ b/lang/python/setup.py @@ -1,34 +1,43 @@ -# +#!/usr/bin/env python # # Copyright (c) 2008-2012 WiredTiger, Inc. -# All rights reserved. +# All rights reserved. # # See the file LICENSE for redistribution information. -import re, os +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'] = '' + 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 dist/RELEASE dist = os.path.join(os.path.dirname(os.path.dirname(dir)), 'dist') for l in open(os.path.join(dist, 'RELEASE')): - if re.match(r'WIREDTIGER_VERSION_(?:MAJOR|MINOR|PATCH)=', l): - exec(l) + 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'], - )], - py_modules=['wiredtiger'], + [os.path.join(dir, 'wiredtiger_wrap.c')], + include_dirs=['../..'], + library_dirs=['../../.libs'], + libraries=['wiredtiger'], + extra_compile_args=extra_cflags, + )], + py_modules=['wiredtiger'], ) |