summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2010-07-29 01:38:14 +0000
committerDavid Cournapeau <cournape@gmail.com>2010-07-29 01:38:14 +0000
commitfa445b9f5b04c11bc3efacca28cc4c42d1ff091a (patch)
treec0fd748bf07f5daacee75a7c8c653b032247c205
parent1c02b2038a902dedc3d26ebc278dac8d4cb7f12f (diff)
downloadnumpy-fa445b9f5b04c11bc3efacca28cc4c42d1ff091a.tar.gz
BUG: look for endian.h.
We should use this header in npy_endian.h if available.
-rw-r--r--numpy/core/SConscript4
-rw-r--r--numpy/core/include/numpy/_numpyconfig.h.in2
-rw-r--r--numpy/core/setup.py4
3 files changed, 10 insertions, 0 deletions
diff --git a/numpy/core/SConscript b/numpy/core/SConscript
index b030c0044..732374f8f 100644
--- a/numpy/core/SConscript
+++ b/numpy/core/SConscript
@@ -78,6 +78,10 @@ check that you have he platform SDK. You may also use unsupported cflags.
Configuration error log says: \n\n%s""" % ''.join(errmsg)
Exit(-1)
+st = config.CheckHeader("endian.h")
+if st:
+ numpyconfig_sym.append(('DEFINE_NPY_HAVE_ENDIAN_H', '#define NPY_HAVE_ENDIAN_H 1'))
+
def check_type(type, include = None):
st = config.CheckTypeSize(type, includes = include)
type = type.replace(' ', '_')
diff --git a/numpy/core/include/numpy/_numpyconfig.h.in b/numpy/core/include/numpy/_numpyconfig.h.in
index fd6146b7a..2cd389d44 100644
--- a/numpy/core/include/numpy/_numpyconfig.h.in
+++ b/numpy/core/include/numpy/_numpyconfig.h.in
@@ -40,6 +40,8 @@
#define NPY_ABI_VERSION @NPY_ABI_VERSION@
#define NPY_API_VERSION @NPY_API_VERSION@
+@DEFINE_NPY_HAVE_ENDIAN_H@
+
/* Ugly, but we can't test this in a proper manner without requiring a C++
* compiler at the configuration stage of numpy ? */
#ifndef __STDC_FORMAT_MACROS
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 589e42f2a..95a1118e1 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -259,6 +259,10 @@ def check_types(config_cmd, ext, build_dir):
raise SystemError(
"Cannot compile 'Python.h'. Perhaps you need to "\
"install python-dev|python-devel.")
+ res = config_cmd.check_header("endian.h")
+ if res:
+ private_defines.append(('HAVE_ENDIAN_H', 1))
+ public_defines.append(('NPY_HAVE_ENDIAN_H', 1))
# Check basic types sizes
for type in ('short', 'int', 'long'):