summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-04-30 08:51:21 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-04-30 08:51:21 +0000
commit719164150c82915955cddd0309577bd156da099e (patch)
treef31c5d46ec61caf18f33edea841335cb4ab2dbc0 /numpy/core
parent19d51015ea71709bf94422cbecd409a8cd079998 (diff)
downloadnumpy-719164150c82915955cddd0309577bd156da099e.tar.gz
Define separate compilation define in config.h as well, and use config.h early when needed.
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/SConscript4
-rw-r--r--numpy/core/include/numpy/numpyconfig.h.in1
-rw-r--r--numpy/core/setup.py3
-rw-r--r--numpy/core/src/umath/loops.c.src6
-rw-r--r--numpy/core/src/umath/ufunc_object.c6
-rw-r--r--numpy/core/src/umath/umathmodule.c.src5
6 files changed, 14 insertions, 11 deletions
diff --git a/numpy/core/SConscript b/numpy/core/SConscript
index 461e9435f..662a06f54 100644
--- a/numpy/core/SConscript
+++ b/numpy/core/SConscript
@@ -185,6 +185,10 @@ inline = config.CheckInline()
config.Define('inline', inline)
numpyconfig_sym.append(('NPY_INLINE', inline))
+
+if ENABLE_SEPARATE_COMPILATION:
+ config.Define("ENABLE_SEPARATE_COMPILATION", 1)
+ numpyconfig_sym.append(('NPY_ENABLE_SEPARATE_COMPILATION', 1))
#-------------------------------------------------------
# Define the function PyOS_ascii_strod if not available
#-------------------------------------------------------
diff --git a/numpy/core/include/numpy/numpyconfig.h.in b/numpy/core/include/numpy/numpyconfig.h.in
index 20fcc9f9a..721266ba1 100644
--- a/numpy/core/include/numpy/numpyconfig.h.in
+++ b/numpy/core/include/numpy/numpyconfig.h.in
@@ -21,6 +21,7 @@
@DEFINE_NPY_SIZEOF_PY_LONG_LONG@
#define NPY_INLINE @NPY_INLINE@
+#define NPY_ENABLE_SEPARATE_COMPILATION @NPY_ENABLE_SEPARATE_COMPILATION@
#define NPY_USE_C99_FORMATS @USE_C99_FORMATS@
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 99c9c6b5e..9d4f2c1a7 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -323,6 +323,9 @@ def configuration(parent_package='',top_path=None):
else:
PYTHON_HAS_UNICODE_WIDE = False
+ if ENABLE_SEPARATE_COMPILATION:
+ moredefs.append(('ENABLE_SEPARATE_COMPILATION', 1))
+
# Generate the config.h file from moredefs
target_f = open(target,'a')
for d in moredefs:
diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src
index 88767a1ff..86064d9cd 100644
--- a/numpy/core/src/umath/loops.c.src
+++ b/numpy/core/src/umath/loops.c.src
@@ -4,8 +4,8 @@
#include "Python.h"
-#include "numpyconfig.h"
-#ifdef NPY_ENABLE_SEPARATE_COMPILATION
+#include "config.h"
+#ifdef ENABLE_SEPARATE_COMPILATION
#define PY_ARRAY_UNIQUE_SYMBOL _npy_umathmodule_ARRAY_API
#define NO_IMPORT_ARRAY
#endif
@@ -14,8 +14,6 @@
#include "numpy/ufuncobject.h"
#include "numpy/npy_math.h"
-#include "config.h"
-
#include "ufunc_object.h"
/*
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 8e4b99184..07c0bb386 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -27,8 +27,8 @@
#include "Python.h"
-#include "numpyconfig.h"
-#ifdef NPY_ENABLE_SEPARATE_COMPILATION
+#include "config.h"
+#ifdef ENABLE_SEPARATE_COMPILATION
#define PY_ARRAY_UNIQUE_SYMBOL _npy_umathmodule_ARRAY_API
#define NO_IMPORT_ARRAY
#endif
@@ -36,8 +36,6 @@
#include "numpy/noprefix.h"
#include "numpy/ufuncobject.h"
-#include "config.h"
-
#include "ufunc_object.h"
#define USE_USE_DEFAULTS 1
diff --git a/numpy/core/src/umath/umathmodule.c.src b/numpy/core/src/umath/umathmodule.c.src
index 1072a8009..9909cacda 100644
--- a/numpy/core/src/umath/umathmodule.c.src
+++ b/numpy/core/src/umath/umathmodule.c.src
@@ -19,15 +19,14 @@
#include "Python.h"
-#include "numpyconfig.h"
-#ifdef NPY_ENABLE_SEPARATE_COMPILATION
+#include "config.h"
+#ifdef ENABLE_SEPARATE_COMPILATION
#define PY_ARRAY_UNIQUE_SYMBOL _npy_umathmodule_ARRAY_API
#endif
#include "numpy/noprefix.h"
#include "numpy/ufuncobject.h"
#include "abstract.h"
-#include "config.h"
#include "numpy/npy_math.h"