Adapt some changes from the upstream repository for cpu detection.

I have only waited a short while for djm (maintainer)'s ok, commiting
anyway as it takes out a lot of the tree on !{i386,amd64}.

Fix the regression tests while there.

ok jasper@.
This commit is contained in:
sthen 2009-10-14 18:44:04 +00:00
parent 1adbca4d86
commit 6595e9e1c1
3 changed files with 86 additions and 3 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.17 2009/09/30 11:51:30 landry Exp $
# $OpenBSD: Makefile,v 1.18 2009/10/14 18:44:04 sthen Exp $
COMMENT= fast array and numeric programming library for Python
MODPY_EGG_VERSION= 1.3.0
DISTNAME= numpy-${MODPY_EGG_VERSION}
PKGNAME= py-${DISTNAME}p0
PKGNAME= py-${DISTNAME}p1
CATEGORIES= math devel
HOMEPAGE= http://numpy.scipy.org/
@ -35,6 +35,6 @@ pre-build:
do-regress: fake
${MAKE_ENV} PYTHONPATH=${WRKINST}${MODPY_SITEPKG} ${MODPY_BIN} -c \
'import numpy ; numpy.testing.NumpyTest(numpy).test(10)'
'import numpy ; numpy.test()'
.include <bsd.port.mk>

View File

@ -0,0 +1,43 @@
$OpenBSD: patch-numpy_core_include_numpy_npy_cpu_h,v 1.1 2009/10/14 18:44:04 sthen Exp $
--- numpy/core/include/numpy/npy_cpu.h.orig Mon Oct 12 04:23:00 2009
+++ numpy/core/include/numpy/npy_cpu.h Mon Oct 12 04:22:50 2009
@@ -8,7 +8,12 @@
* NPY_CPU_SPARC
* NPY_CPU_S390
* NPY_CPU_IA64
- * NPY_CPU_PARISC
+ * NPY_CPU_HPPA
+ * NPY_CPU_ALPHA
+ * NPY_CPU_ARMEL
+ * NPY_CPU_ARMEB
+ * NPY_CPU_SH_LE
+ * NPY_CPU_SH_BE
*/
#ifndef _NPY_CPUARCH_H_
#define _NPY_CPUARCH_H_
@@ -42,9 +47,22 @@
#define NPY_CPU_S390
#elif defined(__ia64)
#define NPY_CPU_IA64
-#elif defined(__parisc__)
- /* XXX: Not sure about this one... */
- #define NPY_CPU_PARISC
+#elif defined(__hppa__)
+ #define NPY_CPU_HPPA
+#elif defined(__alpha__)
+ #define NPY_CPU_ALPHA
+#elif defined(__arm__) && defined(__ARMEL__)
+ #define NPY_CPU_ARMEL
+#elif defined(__arm__) && defined(__ARMEB__)
+ #define NPY_CPU_ARMEB
+#elif defined(__sh__) && defined(__LITTLE_ENDIAN__)
+ #define NPY_CPU_SH_LE
+#elif defined(__sh__) && defined(__BIG_ENDIAN__)
+ #define NPY_CPU_SH_BE
+#elif defined(__MIPSEL__)
+ #define NPY_CPU_MIPSEL
+#elif defined(__MIPSEB__)
+ #define NPY_CPU_MIPSEB
#else
#error Unknown CPU, please report this to numpy maintainers with \
information about your platform (OS, CPU and compiler)

View File

@ -0,0 +1,40 @@
$OpenBSD: patch-numpy_core_include_numpy_npy_endian_h,v 1.1 2009/10/14 18:44:04 sthen Exp $
--- numpy/core/include/numpy/npy_endian.h.orig Sun Apr 5 09:09:20 2009
+++ numpy/core/include/numpy/npy_endian.h Mon Oct 12 11:54:16 2009
@@ -9,6 +9,7 @@
#ifdef NPY_HAVE_ENDIAN_H
/* Use endian.h if available */
#include <endian.h>
+
#define NPY_BYTE_ORDER __BYTE_ORDER
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
#define NPY_LITTLE_ENDIAN
@@ -21,13 +22,22 @@
/* Set endianness info using target CPU */
#include "npy_cpu.h"
- #if defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64)\
- || defined(NPY_CPU_IA64)
- #define NPY_LITTLE_ENDIAN
+ #if defined(NPY_CPU_X86) \
+ || defined(NPY_CPU_AMD64) \
+ || defined(NPY_CPU_IA64) \
+ || defined(NPY_CPU_ALPHA) \
+ || defined(NPY_CPU_ARMEL) \
+ || defined(NPY_CPU_SH_LE) \
+ || defined(NPY_CPU_MIPSEL)
#define NPY_BYTE_ORDER 1234
- #elif defined(NPY_CPU_PPC) || defined(NPY_CPU_SPARC)\
- || defined(NPY_CPU_S390) || defined(NPY_CPU_PARISC)
- #define NPY_BIG_ENDIAN
+ #elif defined(NPY_CPU_PPC) \
+ || defined(NPY_CPU_SPARC) \
+ || defined(NPY_CPU_S390) \
+ || defined(NPY_CPU_HPPA) \
+ || defined(NPY_CPU_PPC64) \
+ || defined(NPY_CPU_ARMEB) \
+ || defined(NPY_CPU_SH_BE) \
+ || defined(NPY_CPU_MIPSEB)
#define NPY_BYTE_ORDER 4321
#else
#error Unknown CPU: can not set endianness