From f2da944c290149f2331ea57e3db67d1f3c1e9768 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 1 Dec 2010 01:47:01 +0000 Subject: [PATCH] scons: test whether python is 64bit enabled --- SConstruct | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 3023b2eb2..ddf99c710 100644 --- a/SConstruct +++ b/SConstruct @@ -398,7 +398,8 @@ pickle_store = [# Scons internal variables 'HAS_CAIRO', 'HAS_PYCAIRO', 'HAS_LIBXML2', - 'LIBTOOL_SUPPORTS_ADVISE' + 'LIBTOOL_SUPPORTS_ADVISE', + 'PYTHON_IS_64BIT' ] # Add all other user configurable options to pickle pickle_store @@ -1211,6 +1212,16 @@ if not preconfigured: env['PYTHON_INSTALL_LOCATION'] = env['DESTDIR'] + '/' + env['PYTHON_PREFIX'] + '/' + py_relative_install else: env['PYTHON_INSTALL_LOCATION'] = env['DESTDIR'] + '/' + env['PYTHON_SITE_PACKAGES'] + + if py3: + is_64_bit = '''%s -c "import sys; print(sys.maxsize == 9223372036854775807)"''' % env['PYTHON'] + else: + is_64_bit = '''%s -c "import sys; print sys.maxint == 9223372036854775807"''' % env['PYTHON'] + + if is_64_bit: + env['PYTHON_IS_64BIT'] = True + else: + env['PYTHON_IS_64BIT'] = False majver, minver = env['PYTHON_VERSION'].split('.')