Add option to disable scanning for 32-bit bindings on 64-bit platforms

This commit is contained in:
Gustavo Carneiro
2014-03-02 12:24:39 +00:00
parent 851b2f961c
commit cb559e2947

View File

@@ -47,6 +47,10 @@ def options(opt):
opt.add_option('--with-python',
help=('Path to the Python interpreter to use.'),
default=None, dest='with_python', type="string")
opt.add_option('--no32bit-scan',
help=("Don't scan for the 32-bit variant of the bindings on 64-bit platforms."),
action="store_true", default=False,
dest='no32bit_scan')
def configure(conf):
@@ -436,7 +440,9 @@ def build(bld):
else:
import struct
if struct.calcsize('I') == 4 and struct.calcsize('L') == 8 and struct.calcsize('P') == 8:
scan_targets.extend([('gcc_ILP32', '-m32'), ('gcc_LP64', '-m64')])
if not Options.options.no32bit_scan:
scan_targets.append(('gcc_ILP32', '-m32'))
scan_targets.append(('gcc_LP64', '-m64'))
elif struct.calcsize('I') == 4 and struct.calcsize('L') == 4 and struct.calcsize('P') == 4:
scan_targets.append(('gcc_ILP32', ''))
else: