[Numpy-svn] r4734 - in branches/build_with_scons/numpy/core: . include/numpy
numpy-svn at scipy.org
numpy-svn at scipy.org
Mon Jan 21 00:53:03 EST 2008
Author: cdavid
Date: 2008-01-20 23:52:58 -0600 (Sun, 20 Jan 2008)
New Revision: 4734
Modified:
branches/build_with_scons/numpy/core/SConstruct
branches/build_with_scons/numpy/core/include/numpy/numpyconfig.h.in
Log:
Fixes for config and numpyconfig header generation:
- Replace #ifdef PY_LONG_LONG logic in numpyconfig.h by a declaration check in
scons, and uses the result directly in the generated header.
Modified: branches/build_with_scons/numpy/core/SConstruct
===================================================================
--- branches/build_with_scons/numpy/core/SConstruct 2008-01-21 05:35:20 UTC (rev 4733)
+++ branches/build_with_scons/numpy/core/SConstruct 2008-01-21 05:52:58 UTC (rev 4734)
@@ -50,9 +50,18 @@
for type in ('short', 'int', 'long', 'float', 'double', 'long double'):
check_type(type)
-for type in ('Py_intptr_t', 'PY_LONG_LONG'):
+for type in ('Py_intptr_t',):
check_type(type, include = "#include <Python.h>\n")
+# We check declaration AND type because that's how distutils does it.
+if config.CheckDeclaration('PY_LONG_LONG', includes = '#include <Python.h>\n'):
+ st = config.CheckTypeSize('PY_LONG_LONG', includes = '#include <Python.h>\n')
+ assert not st == 0
+ numpyconfig_sym.append(('DEFINE_NPY_SIZEOF_LONGLONG', '#define NPY_SIZEOF_LONGLONG %d' % st))
+ numpyconfig_sym.append(('DEFINE_NPY_SIZEOF_PY_LONG_LONG', '#define NPY_SIZEOF_PY_LONG_LONG %d' % st))
+else:
+ numpyconfig_sym.append(('DEFINE_NPY_SIZEOF_LONGLONG', ''))
+ numpyconfig_sym.append(('DEFINE_NPY_SIZEOF_PY_LONG_LONG', ''))
#----------------------
# Checking signal stuff
#----------------------
Modified: branches/build_with_scons/numpy/core/include/numpy/numpyconfig.h.in
===================================================================
--- branches/build_with_scons/numpy/core/include/numpy/numpyconfig.h.in 2008-01-21 05:35:20 UTC (rev 4733)
+++ branches/build_with_scons/numpy/core/include/numpy/numpyconfig.h.in 2008-01-21 05:52:58 UTC (rev 4734)
@@ -13,10 +13,8 @@
#define NPY_MATHLIB @MATHLIB@
/* XXX: this has to be done outside config files !!!! */
-#ifdef PY_LONG_LONG
- #define NPY_SIZEOF_LONGLONG @SIZEOF_PY_LONG_LONG@
- #define NPY_SIZEOF_PY_LONG_LONG @SIZEOF_PY_LONG_LONG@
-#endif
+ at DEFINE_NPY_SIZEOF_LONGLONG@
+ at DEFINE_NPY_SIZEOF_PY_LONG_LONG@
#ifndef CHAR_BIT
#error Configuration for undefined CHAR_BIT is not supported, contact the maintainter
More information about the Numpy-svn
mailing list