Python: remove unused patches.

This commit is contained in:
Adrien Destugues
2014-10-17 16:22:17 +02:00
parent e716bc41ab
commit 082da53954
13 changed files with 0 additions and 15796 deletions

View File

@@ -1,568 +0,0 @@
diff -urN Python-2.6.7/Lib/plat-haiku1/IN.py Python-2.6.7-haiku/Lib/plat-haiku1/IN.py
--- Python-2.6.7/Lib/plat-haiku1/IN.py 1970-01-01 00:00:00.000000000 +0000
+++ Python-2.6.7-haiku/Lib/plat-haiku1/IN.py 2010-08-30 04:52:27.223346688 +0000
@@ -0,0 +1,327 @@
+# Generated by h2py from /boot/develop/headers/be/net/netinet/in.h
+
+# Included from socket.h
+
+# Included from BeBuild.h
+B_BEOS_VERSION_4 = 0x0400
+B_BEOS_VERSION_4_5 = 0x0450
+B_BEOS_VERSION_5 = 0x0500
+B_BEOS_VERSION = B_BEOS_VERSION_5
+B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5
+_PR2_COMPATIBLE_ = 1
+_PR3_COMPATIBLE_ = 1
+_R4_COMPATIBLE_ = 1
+_R4_5_COMPATIBLE_ = 1
+_PR2_COMPATIBLE_ = 0
+_PR3_COMPATIBLE_ = 0
+_R4_COMPATIBLE_ = 1
+_R4_5_COMPATIBLE_ = 1
+def _UNUSED(x): return x
+
+
+# Included from sys/types.h
+
+# Included from time.h
+
+# Included from be_setup.h
+def __std(ref): return ref
+
+__be_os = 2
+__dest_os = __be_os
+__MSL__ = 0x4011
+__GLIBC__ = -2
+__GLIBC_MINOR__ = 1
+
+# Included from null.h
+NULL = (0)
+NULL = 0L
+
+# Included from size_t.h
+
+# Included from stddef.h
+
+# Included from wchar_t.h
+CLOCKS_PER_SEC = 1000
+CLK_TCK = CLOCKS_PER_SEC
+MAX_TIMESTR = 70
+
+# Included from sys/time.h
+
+# Included from ByteOrder.h
+
+# Included from endian.h
+__LITTLE_ENDIAN = 1234
+LITTLE_ENDIAN = __LITTLE_ENDIAN
+__BYTE_ORDER = __LITTLE_ENDIAN
+BYTE_ORDER = __BYTE_ORDER
+__BIG_ENDIAN = 0
+BIG_ENDIAN = 0
+__BIG_ENDIAN = 4321
+BIG_ENDIAN = __BIG_ENDIAN
+__BYTE_ORDER = __BIG_ENDIAN
+BYTE_ORDER = __BYTE_ORDER
+__LITTLE_ENDIAN = 0
+LITTLE_ENDIAN = 0
+__PDP_ENDIAN = 3412
+PDP_ENDIAN = __PDP_ENDIAN
+
+# Included from SupportDefs.h
+
+# Included from Errors.h
+
+# Included from limits.h
+
+# Included from float.h
+FLT_ROUNDS = 1
+FLT_RADIX = 2
+FLT_MANT_DIG = 24
+FLT_DIG = 6
+FLT_MIN_EXP = (-125)
+FLT_MIN_10_EXP = (-37)
+FLT_MAX_EXP = 128
+FLT_MAX_10_EXP = 38
+DBL_MANT_DIG = 53
+DBL_DIG = 15
+DBL_MIN_EXP = (-1021)
+DBL_MIN_10_EXP = (-308)
+DBL_MAX_EXP = 1024
+DBL_MAX_10_EXP = 308
+LDBL_MANT_DIG = DBL_MANT_DIG
+LDBL_DIG = DBL_DIG
+LDBL_MIN_EXP = DBL_MIN_EXP
+LDBL_MIN_10_EXP = DBL_MIN_10_EXP
+LDBL_MAX_EXP = DBL_MAX_EXP
+LDBL_MAX_10_EXP = DBL_MAX_10_EXP
+CHAR_BIT = (8)
+SCHAR_MIN = (-127-1)
+SCHAR_MAX = (127)
+CHAR_MIN = SCHAR_MIN
+CHAR_MAX = SCHAR_MAX
+MB_LEN_MAX = (1)
+SHRT_MIN = (-32767-1)
+SHRT_MAX = (32767)
+LONG_MIN = (-2147483647L-1)
+LONG_MAX = (2147483647L)
+INT_MIN = LONG_MIN
+INT_MAX = LONG_MAX
+ARG_MAX = (32768)
+ATEXIT_MAX = (32)
+CHILD_MAX = (1024)
+IOV_MAX = (256)
+FILESIZEBITS = (64)
+LINK_MAX = (1)
+LOGIN_NAME_MAX = (32)
+MAX_CANON = (255)
+MAX_INPUT = (255)
+NAME_MAX = (256)
+NGROUPS_MAX = (32)
+OPEN_MAX = (128)
+PATH_MAX = (1024)
+PIPE_MAX = (512)
+SSIZE_MAX = (2147483647L)
+TTY_NAME_MAX = (256)
+TZNAME_MAX = (32)
+SYMLINKS_MAX = (16)
+_POSIX_ARG_MAX = (32768)
+_POSIX_CHILD_MAX = (1024)
+_POSIX_LINK_MAX = (1)
+_POSIX_LOGIN_NAME_MAX = (9)
+_POSIX_MAX_CANON = (255)
+_POSIX_MAX_INPUT = (255)
+_POSIX_NAME_MAX = (255)
+_POSIX_NGROUPS_MAX = (0)
+_POSIX_OPEN_MAX = (128)
+_POSIX_PATH_MAX = (1024)
+_POSIX_PIPE_BUF = (512)
+_POSIX_SSIZE_MAX = (2147483647L)
+_POSIX_STREAM_MAX = (8)
+_POSIX_TTY_NAME_MAX = (256)
+_POSIX_TZNAME_MAX = (3)
+B_GENERAL_ERROR_BASE = LONG_MIN
+B_OS_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x1000
+B_APP_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x2000
+B_INTERFACE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x3000
+B_MEDIA_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4000
+B_TRANSLATION_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4800
+B_MIDI_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x5000
+B_STORAGE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x6000
+B_POSIX_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x7000
+B_MAIL_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x8000
+B_PRINT_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x9000
+B_DEVICE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0xa000
+B_ERRORS_END = (B_GENERAL_ERROR_BASE + 0xffff)
+E2BIG = (B_POSIX_ERROR_BASE + 1)
+ECHILD = (B_POSIX_ERROR_BASE + 2)
+EDEADLK = (B_POSIX_ERROR_BASE + 3)
+EFBIG = (B_POSIX_ERROR_BASE + 4)
+EMLINK = (B_POSIX_ERROR_BASE + 5)
+ENFILE = (B_POSIX_ERROR_BASE + 6)
+ENODEV = (B_POSIX_ERROR_BASE + 7)
+ENOLCK = (B_POSIX_ERROR_BASE + 8)
+ENOSYS = (B_POSIX_ERROR_BASE + 9)
+ENOTTY = (B_POSIX_ERROR_BASE + 10)
+ENXIO = (B_POSIX_ERROR_BASE + 11)
+ESPIPE = (B_POSIX_ERROR_BASE + 12)
+ESRCH = (B_POSIX_ERROR_BASE + 13)
+EFPOS = (B_POSIX_ERROR_BASE + 14)
+ESIGPARM = (B_POSIX_ERROR_BASE + 15)
+EDOM = (B_POSIX_ERROR_BASE + 16)
+ERANGE = (B_POSIX_ERROR_BASE + 17)
+EPROTOTYPE = (B_POSIX_ERROR_BASE + 18)
+EPROTONOSUPPORT = (B_POSIX_ERROR_BASE + 19)
+EPFNOSUPPORT = (B_POSIX_ERROR_BASE + 20)
+EAFNOSUPPORT = (B_POSIX_ERROR_BASE + 21)
+EADDRINUSE = (B_POSIX_ERROR_BASE + 22)
+EADDRNOTAVAIL = (B_POSIX_ERROR_BASE + 23)
+ENETDOWN = (B_POSIX_ERROR_BASE + 24)
+ENETUNREACH = (B_POSIX_ERROR_BASE + 25)
+ENETRESET = (B_POSIX_ERROR_BASE + 26)
+ECONNABORTED = (B_POSIX_ERROR_BASE + 27)
+ECONNRESET = (B_POSIX_ERROR_BASE + 28)
+EISCONN = (B_POSIX_ERROR_BASE + 29)
+ENOTCONN = (B_POSIX_ERROR_BASE + 30)
+ESHUTDOWN = (B_POSIX_ERROR_BASE + 31)
+ECONNREFUSED = (B_POSIX_ERROR_BASE + 32)
+EHOSTUNREACH = (B_POSIX_ERROR_BASE + 33)
+ENOPROTOOPT = (B_POSIX_ERROR_BASE + 34)
+ENOBUFS = (B_POSIX_ERROR_BASE + 35)
+EINPROGRESS = (B_POSIX_ERROR_BASE + 36)
+EALREADY = (B_POSIX_ERROR_BASE + 37)
+EILSEQ = (B_POSIX_ERROR_BASE + 38)
+ENOMSG = (B_POSIX_ERROR_BASE + 39)
+ESTALE = (B_POSIX_ERROR_BASE + 40)
+EOVERFLOW = (B_POSIX_ERROR_BASE + 41)
+EMSGSIZE = (B_POSIX_ERROR_BASE + 42)
+EOPNOTSUPP = (B_POSIX_ERROR_BASE + 43)
+ENOTSOCK = (B_POSIX_ERROR_BASE + 44)
+false = 0
+true = 1
+NULL = (0)
+FALSE = 0
+TRUE = 1
+
+# Included from TypeConstants.h
+B_HOST_IS_LENDIAN = 1
+B_HOST_IS_BENDIAN = 0
+def B_HOST_TO_LENDIAN_DOUBLE(arg): return (double)(arg)
+
+def B_HOST_TO_LENDIAN_FLOAT(arg): return (float)(arg)
+
+def B_HOST_TO_LENDIAN_INT64(arg): return (uint64)(arg)
+
+def B_HOST_TO_LENDIAN_INT32(arg): return (uint32)(arg)
+
+def B_HOST_TO_LENDIAN_INT16(arg): return (uint16)(arg)
+
+def B_HOST_TO_BENDIAN_DOUBLE(arg): return __swap_double(arg)
+
+def B_HOST_TO_BENDIAN_FLOAT(arg): return __swap_float(arg)
+
+def B_HOST_TO_BENDIAN_INT64(arg): return __swap_int64(arg)
+
+def B_HOST_TO_BENDIAN_INT32(arg): return __swap_int32(arg)
+
+def B_HOST_TO_BENDIAN_INT16(arg): return __swap_int16(arg)
+
+def B_LENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
+
+def B_LENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
+
+def B_LENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
+
+def B_LENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
+
+def B_LENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
+
+def B_BENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
+
+def B_BENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
+
+def B_BENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
+
+def B_BENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
+
+def B_BENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
+
+B_HOST_IS_LENDIAN = 0
+B_HOST_IS_BENDIAN = 1
+def B_HOST_TO_LENDIAN_DOUBLE(arg): return __swap_double(arg)
+
+def B_HOST_TO_LENDIAN_FLOAT(arg): return __swap_float(arg)
+
+def B_HOST_TO_LENDIAN_INT64(arg): return __swap_int64(arg)
+
+def B_HOST_TO_LENDIAN_INT32(arg): return __swap_int32(arg)
+
+def B_HOST_TO_LENDIAN_INT16(arg): return __swap_int16(arg)
+
+def B_HOST_TO_BENDIAN_DOUBLE(arg): return (double)(arg)
+
+def B_HOST_TO_BENDIAN_FLOAT(arg): return (float)(arg)
+
+def B_HOST_TO_BENDIAN_INT64(arg): return (uint64)(arg)
+
+def B_HOST_TO_BENDIAN_INT32(arg): return (uint32)(arg)
+
+def B_HOST_TO_BENDIAN_INT16(arg): return (uint16)(arg)
+
+def B_LENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
+
+def B_LENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
+
+def B_LENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
+
+def B_LENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
+
+def B_LENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
+
+def B_BENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
+
+def B_BENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
+
+def B_BENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
+
+def B_BENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
+
+def B_BENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
+
+def B_SWAP_DOUBLE(arg): return __swap_double(arg)
+
+def B_SWAP_FLOAT(arg): return __swap_float(arg)
+
+def B_SWAP_INT64(arg): return __swap_int64(arg)
+
+def B_SWAP_INT32(arg): return __swap_int32(arg)
+
+def B_SWAP_INT16(arg): return __swap_int16(arg)
+
+def htonl(x): return B_HOST_TO_BENDIAN_INT32(x)
+
+def ntohl(x): return B_BENDIAN_TO_HOST_INT32(x)
+
+def htons(x): return B_HOST_TO_BENDIAN_INT16(x)
+
+def ntohs(x): return B_BENDIAN_TO_HOST_INT16(x)
+
+AF_INET = 1
+INADDR_ANY = 0x00000000
+INADDR_BROADCAST = 0xffffffff
+INADDR_LOOPBACK = 0x7f000001
+SOL_SOCKET = 1
+SO_DEBUG = 1
+SO_REUSEADDR = 2
+SO_NONBLOCK = 3
+SO_REUSEPORT = 4
+MSG_OOB = 0x1
+SOCK_DGRAM = 1
+SOCK_STREAM = 2
+IPPROTO_UDP = 1
+IPPROTO_TCP = 2
+IPPROTO_ICMP = 3
+B_UDP_MAX_SIZE = (65536 - 1024)
+FD_SETSIZE = 256
+FDSETSIZE = FD_SETSIZE
+NFDBITS = 32
+def _FDMSKNO(fd): return ((fd) / NFDBITS)
+
+def _FDBITNO(fd): return ((fd) % NFDBITS)
diff -urN Python-2.6.7/Lib/plat-haiku1/regen Python-2.6.7-haiku/Lib/plat-haiku1/regen
--- Python-2.6.7/Lib/plat-haiku1/regen 1970-01-01 00:00:00.000000000 +0000
+++ Python-2.6.7-haiku/Lib/plat-haiku1/regen 2010-08-30 04:52:27.237502464 +0000
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+H2PY=../../Tools/scripts/h2py.py
+HEADERS=/boot/develop/headers
+
+set -v
+python $H2PY -i '(u_long)' $HEADERS/posix/netinet/in.h
diff -urN Python-2.6.7/Modules/resource.c Python-2.6.7-haiku/Modules/resource.c
--- Python-2.6.7/Modules/resource.c 2010-05-09 15:15:40.053739520 +0000
+++ Python-2.6.7-haiku/Modules/resource.c 2010-08-30 04:52:24.666370048 +0000
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,7 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
-
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
return NULL;
diff -urN Python-2.6.7/Modules/socketmodule.c Python-2.6.7-haiku/Modules/socketmodule.c
--- Python-2.6.7/Modules/socketmodule.c 2010-05-23 15:22:08.054525952 +0000
+++ Python-2.6.7-haiku/Modules/socketmodule.c 2010-08-30 04:53:35.429916160 +0000
@@ -4661,7 +4661,9 @@
#ifndef __BEOS__
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
- PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+#ifndef __HAIKU__
+ PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+#endif
#if defined(SOCK_RDM)
PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
#endif
diff -urN Python-2.6.7/Modules/socketmodule.h Python-2.6.7-haiku/Modules/socketmodule.h
--- Python-2.6.7/Modules/socketmodule.h 2010-05-09 15:15:40.053739520 +0000
+++ Python-2.6.7-haiku/Modules/socketmodule.h 2010-08-30 04:52:24.667942912 +0000
@@ -47,6 +47,10 @@
# undef AF_NETLINK
#endif
+#if defined(__HAIKU__)
+#undef HAVE_BLUETOOTH_BLUETOOTH_H
+#endif
+
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
diff -urN Python-2.6.7/Modules/spwdmodule.c Python-2.6.7-haiku/Modules/spwdmodule.c
--- Python-2.6.7/Modules/spwdmodule.c 2010-05-09 15:15:40.030408704 +0000
+++ Python-2.6.7-haiku/Modules/spwdmodule.c 2010-08-30 04:52:24.709623808 +0000
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN Python-2.6.7/Modules/timemodule.c Python-2.6.7-haiku/Modules/timemodule.c
--- Python-2.6.7/Modules/timemodule.c 2010-05-09 15:15:40.015204352 +0000
+++ Python-2.6.7-haiku/Modules/timemodule.c 2010-08-30 04:52:24.721944576 +0000
@@ -972,11 +972,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
diff -urN Python-2.6.7/Parser/asdl_c.py Python-2.6.7-haiku/Parser/asdl_c.py
--- Python-2.6.7/Parser/asdl_c.py 2009-12-13 00:59:01.059768832 +0000
+++ Python-2.6.7-haiku/Parser/asdl_c.py 2010-08-30 04:52:27.169607168 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
"""Generate C code from an ASDL description."""
# TO DO
diff -urN Python-2.6.7/Python/bltinmodule.c Python-2.6.7-haiku/Python/bltinmodule.c
--- Python-2.6.7/Python/bltinmodule.c 2010-05-09 15:15:40.065011712 +0000
+++ Python-2.6.7-haiku/Python/bltinmodule.c 2010-08-30 04:52:27.186646528 +0000
@@ -18,7 +18,7 @@
*/
#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
const char *Py_FileSystemDefaultEncoding = "mbcs";
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(__HAIKU__)
const char *Py_FileSystemDefaultEncoding = "utf-8";
#else
const char *Py_FileSystemDefaultEncoding = NULL; /* use default */
diff -urN Python-2.6.7/Tools/scripts/h2py.py Python-2.6.7-haiku/Tools/scripts/h2py.py
--- Python-2.6.7/Tools/scripts/h2py.py 2004-08-09 17:27:55.066584576 +0000
+++ Python-2.6.7-haiku/Tools/scripts/h2py.py 2010-08-30 04:52:27.188219392 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
# Read #define's and translate to Python code.
# Handle #include statements.
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
diff -urN Python-2.6.7/configure.in Python-2.6.7-haiku/configure.in
--- Python-2.6.7/configure.in 2010-05-25 02:27:03.064225280 +0000
+++ Python-2.6.7-haiku/configure.in 2010-08-30 04:52:27.207880192 +0000
@@ -745,7 +745,7 @@
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*)
LDLIBRARY='libpython$(VERSION).so'
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
@@ -823,7 +823,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1829,7 +1829,7 @@
fi
fi
;;
- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
+ Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';;
BSD/OS*/4*) LDSHARED="gcc -shared";;
FreeBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
@@ -1883,7 +1883,7 @@
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
- Linux*|GNU*) CCSHARED="-fPIC";;
+ Linux*|GNU*|Haiku*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
@@ -1916,7 +1916,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|Haiku*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
# -u _PyMac_Error is needed to pull in the mac toolbox glue,
@@ -2035,6 +2035,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -3265,7 +3268,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -urN Python-2.6.7/setup.py Python-2.6.7-haiku/setup.py
--- Python-2.6.7/setup.py 2010-07-17 12:31:09.057147392 +0000
+++ Python-2.6.7-haiku/setup.py 2010-08-30 04:52:27.220463104 +0000
@@ -428,6 +428,10 @@
inc_dirs += ['/system/include', '/atheos/autolnk/include']
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+ if platform == 'haiku1':
+ inc_dirs += ['/boot/develop/headers/posix', '/boot/develop/headers/3rdparty', '/boot/common/include']
+ lib_dirs += ['/boot/system/lib', '/boot/develop/lib/x86', '/boot/common/lib']
+
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if platform in ['osf1', 'unixware7', 'openunix8']:
lib_dirs += ['/usr/ccs/lib']
@@ -451,7 +455,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -1176,7 +1180,7 @@
missing.append('resource')
# Sun yellow pages. Some systems have the functions in libc.
- if (platform not in ['cygwin', 'atheos', 'qnx6'] and
+ if (platform not in ['cygwin', 'atheos', 'qnx6', 'haiku1'] and
find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
--- Python-2.6.7/Lib/test/test_fileio.py 2012-07-26 23:04:42.208666624 +0000
+++ Python-2.6.7-haiku/Lib/test/test_fileio.py 2012-07-26 23:05:09.382730240 +0000
@@ -152,6 +152,7 @@
self.assertEquals(f.writable(), True)
if sys.platform != "darwin" and \
'bsd' not in sys.platform and \
+ 'haiku' not in sys.platform and \
not sys.platform.startswith('sunos'):
# Somehow /dev/tty appears seekable on some BSDs
self.assertEquals(f.seekable(), False)

View File

@@ -1,553 +0,0 @@
diff -urN Python-2.7a1/Lib/plat-haiku1/IN.py Python-2.7a1-haiku/Lib/plat-haiku1/IN.py
--- Python-2.7a1/Lib/plat-haiku1/IN.py 1970-01-01 00:00:00.000000000 +0000
+++ Python-2.7a1-haiku/Lib/plat-haiku1/IN.py 2009-12-05 19:43:21.000000000 +0000
@@ -0,0 +1,327 @@
+# Generated by h2py from /boot/develop/headers/be/net/netinet/in.h
+
+# Included from socket.h
+
+# Included from BeBuild.h
+B_BEOS_VERSION_4 = 0x0400
+B_BEOS_VERSION_4_5 = 0x0450
+B_BEOS_VERSION_5 = 0x0500
+B_BEOS_VERSION = B_BEOS_VERSION_5
+B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5
+_PR2_COMPATIBLE_ = 1
+_PR3_COMPATIBLE_ = 1
+_R4_COMPATIBLE_ = 1
+_R4_5_COMPATIBLE_ = 1
+_PR2_COMPATIBLE_ = 0
+_PR3_COMPATIBLE_ = 0
+_R4_COMPATIBLE_ = 1
+_R4_5_COMPATIBLE_ = 1
+def _UNUSED(x): return x
+
+
+# Included from sys/types.h
+
+# Included from time.h
+
+# Included from be_setup.h
+def __std(ref): return ref
+
+__be_os = 2
+__dest_os = __be_os
+__MSL__ = 0x4011
+__GLIBC__ = -2
+__GLIBC_MINOR__ = 1
+
+# Included from null.h
+NULL = (0)
+NULL = 0L
+
+# Included from size_t.h
+
+# Included from stddef.h
+
+# Included from wchar_t.h
+CLOCKS_PER_SEC = 1000
+CLK_TCK = CLOCKS_PER_SEC
+MAX_TIMESTR = 70
+
+# Included from sys/time.h
+
+# Included from ByteOrder.h
+
+# Included from endian.h
+__LITTLE_ENDIAN = 1234
+LITTLE_ENDIAN = __LITTLE_ENDIAN
+__BYTE_ORDER = __LITTLE_ENDIAN
+BYTE_ORDER = __BYTE_ORDER
+__BIG_ENDIAN = 0
+BIG_ENDIAN = 0
+__BIG_ENDIAN = 4321
+BIG_ENDIAN = __BIG_ENDIAN
+__BYTE_ORDER = __BIG_ENDIAN
+BYTE_ORDER = __BYTE_ORDER
+__LITTLE_ENDIAN = 0
+LITTLE_ENDIAN = 0
+__PDP_ENDIAN = 3412
+PDP_ENDIAN = __PDP_ENDIAN
+
+# Included from SupportDefs.h
+
+# Included from Errors.h
+
+# Included from limits.h
+
+# Included from float.h
+FLT_ROUNDS = 1
+FLT_RADIX = 2
+FLT_MANT_DIG = 24
+FLT_DIG = 6
+FLT_MIN_EXP = (-125)
+FLT_MIN_10_EXP = (-37)
+FLT_MAX_EXP = 128
+FLT_MAX_10_EXP = 38
+DBL_MANT_DIG = 53
+DBL_DIG = 15
+DBL_MIN_EXP = (-1021)
+DBL_MIN_10_EXP = (-308)
+DBL_MAX_EXP = 1024
+DBL_MAX_10_EXP = 308
+LDBL_MANT_DIG = DBL_MANT_DIG
+LDBL_DIG = DBL_DIG
+LDBL_MIN_EXP = DBL_MIN_EXP
+LDBL_MIN_10_EXP = DBL_MIN_10_EXP
+LDBL_MAX_EXP = DBL_MAX_EXP
+LDBL_MAX_10_EXP = DBL_MAX_10_EXP
+CHAR_BIT = (8)
+SCHAR_MIN = (-127-1)
+SCHAR_MAX = (127)
+CHAR_MIN = SCHAR_MIN
+CHAR_MAX = SCHAR_MAX
+MB_LEN_MAX = (1)
+SHRT_MIN = (-32767-1)
+SHRT_MAX = (32767)
+LONG_MIN = (-2147483647L-1)
+LONG_MAX = (2147483647L)
+INT_MIN = LONG_MIN
+INT_MAX = LONG_MAX
+ARG_MAX = (32768)
+ATEXIT_MAX = (32)
+CHILD_MAX = (1024)
+IOV_MAX = (256)
+FILESIZEBITS = (64)
+LINK_MAX = (1)
+LOGIN_NAME_MAX = (32)
+MAX_CANON = (255)
+MAX_INPUT = (255)
+NAME_MAX = (256)
+NGROUPS_MAX = (32)
+OPEN_MAX = (128)
+PATH_MAX = (1024)
+PIPE_MAX = (512)
+SSIZE_MAX = (2147483647L)
+TTY_NAME_MAX = (256)
+TZNAME_MAX = (32)
+SYMLINKS_MAX = (16)
+_POSIX_ARG_MAX = (32768)
+_POSIX_CHILD_MAX = (1024)
+_POSIX_LINK_MAX = (1)
+_POSIX_LOGIN_NAME_MAX = (9)
+_POSIX_MAX_CANON = (255)
+_POSIX_MAX_INPUT = (255)
+_POSIX_NAME_MAX = (255)
+_POSIX_NGROUPS_MAX = (0)
+_POSIX_OPEN_MAX = (128)
+_POSIX_PATH_MAX = (1024)
+_POSIX_PIPE_BUF = (512)
+_POSIX_SSIZE_MAX = (2147483647L)
+_POSIX_STREAM_MAX = (8)
+_POSIX_TTY_NAME_MAX = (256)
+_POSIX_TZNAME_MAX = (3)
+B_GENERAL_ERROR_BASE = LONG_MIN
+B_OS_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x1000
+B_APP_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x2000
+B_INTERFACE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x3000
+B_MEDIA_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4000
+B_TRANSLATION_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4800
+B_MIDI_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x5000
+B_STORAGE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x6000
+B_POSIX_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x7000
+B_MAIL_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x8000
+B_PRINT_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x9000
+B_DEVICE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0xa000
+B_ERRORS_END = (B_GENERAL_ERROR_BASE + 0xffff)
+E2BIG = (B_POSIX_ERROR_BASE + 1)
+ECHILD = (B_POSIX_ERROR_BASE + 2)
+EDEADLK = (B_POSIX_ERROR_BASE + 3)
+EFBIG = (B_POSIX_ERROR_BASE + 4)
+EMLINK = (B_POSIX_ERROR_BASE + 5)
+ENFILE = (B_POSIX_ERROR_BASE + 6)
+ENODEV = (B_POSIX_ERROR_BASE + 7)
+ENOLCK = (B_POSIX_ERROR_BASE + 8)
+ENOSYS = (B_POSIX_ERROR_BASE + 9)
+ENOTTY = (B_POSIX_ERROR_BASE + 10)
+ENXIO = (B_POSIX_ERROR_BASE + 11)
+ESPIPE = (B_POSIX_ERROR_BASE + 12)
+ESRCH = (B_POSIX_ERROR_BASE + 13)
+EFPOS = (B_POSIX_ERROR_BASE + 14)
+ESIGPARM = (B_POSIX_ERROR_BASE + 15)
+EDOM = (B_POSIX_ERROR_BASE + 16)
+ERANGE = (B_POSIX_ERROR_BASE + 17)
+EPROTOTYPE = (B_POSIX_ERROR_BASE + 18)
+EPROTONOSUPPORT = (B_POSIX_ERROR_BASE + 19)
+EPFNOSUPPORT = (B_POSIX_ERROR_BASE + 20)
+EAFNOSUPPORT = (B_POSIX_ERROR_BASE + 21)
+EADDRINUSE = (B_POSIX_ERROR_BASE + 22)
+EADDRNOTAVAIL = (B_POSIX_ERROR_BASE + 23)
+ENETDOWN = (B_POSIX_ERROR_BASE + 24)
+ENETUNREACH = (B_POSIX_ERROR_BASE + 25)
+ENETRESET = (B_POSIX_ERROR_BASE + 26)
+ECONNABORTED = (B_POSIX_ERROR_BASE + 27)
+ECONNRESET = (B_POSIX_ERROR_BASE + 28)
+EISCONN = (B_POSIX_ERROR_BASE + 29)
+ENOTCONN = (B_POSIX_ERROR_BASE + 30)
+ESHUTDOWN = (B_POSIX_ERROR_BASE + 31)
+ECONNREFUSED = (B_POSIX_ERROR_BASE + 32)
+EHOSTUNREACH = (B_POSIX_ERROR_BASE + 33)
+ENOPROTOOPT = (B_POSIX_ERROR_BASE + 34)
+ENOBUFS = (B_POSIX_ERROR_BASE + 35)
+EINPROGRESS = (B_POSIX_ERROR_BASE + 36)
+EALREADY = (B_POSIX_ERROR_BASE + 37)
+EILSEQ = (B_POSIX_ERROR_BASE + 38)
+ENOMSG = (B_POSIX_ERROR_BASE + 39)
+ESTALE = (B_POSIX_ERROR_BASE + 40)
+EOVERFLOW = (B_POSIX_ERROR_BASE + 41)
+EMSGSIZE = (B_POSIX_ERROR_BASE + 42)
+EOPNOTSUPP = (B_POSIX_ERROR_BASE + 43)
+ENOTSOCK = (B_POSIX_ERROR_BASE + 44)
+false = 0
+true = 1
+NULL = (0)
+FALSE = 0
+TRUE = 1
+
+# Included from TypeConstants.h
+B_HOST_IS_LENDIAN = 1
+B_HOST_IS_BENDIAN = 0
+def B_HOST_TO_LENDIAN_DOUBLE(arg): return (double)(arg)
+
+def B_HOST_TO_LENDIAN_FLOAT(arg): return (float)(arg)
+
+def B_HOST_TO_LENDIAN_INT64(arg): return (uint64)(arg)
+
+def B_HOST_TO_LENDIAN_INT32(arg): return (uint32)(arg)
+
+def B_HOST_TO_LENDIAN_INT16(arg): return (uint16)(arg)
+
+def B_HOST_TO_BENDIAN_DOUBLE(arg): return __swap_double(arg)
+
+def B_HOST_TO_BENDIAN_FLOAT(arg): return __swap_float(arg)
+
+def B_HOST_TO_BENDIAN_INT64(arg): return __swap_int64(arg)
+
+def B_HOST_TO_BENDIAN_INT32(arg): return __swap_int32(arg)
+
+def B_HOST_TO_BENDIAN_INT16(arg): return __swap_int16(arg)
+
+def B_LENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
+
+def B_LENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
+
+def B_LENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
+
+def B_LENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
+
+def B_LENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
+
+def B_BENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
+
+def B_BENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
+
+def B_BENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
+
+def B_BENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
+
+def B_BENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
+
+B_HOST_IS_LENDIAN = 0
+B_HOST_IS_BENDIAN = 1
+def B_HOST_TO_LENDIAN_DOUBLE(arg): return __swap_double(arg)
+
+def B_HOST_TO_LENDIAN_FLOAT(arg): return __swap_float(arg)
+
+def B_HOST_TO_LENDIAN_INT64(arg): return __swap_int64(arg)
+
+def B_HOST_TO_LENDIAN_INT32(arg): return __swap_int32(arg)
+
+def B_HOST_TO_LENDIAN_INT16(arg): return __swap_int16(arg)
+
+def B_HOST_TO_BENDIAN_DOUBLE(arg): return (double)(arg)
+
+def B_HOST_TO_BENDIAN_FLOAT(arg): return (float)(arg)
+
+def B_HOST_TO_BENDIAN_INT64(arg): return (uint64)(arg)
+
+def B_HOST_TO_BENDIAN_INT32(arg): return (uint32)(arg)
+
+def B_HOST_TO_BENDIAN_INT16(arg): return (uint16)(arg)
+
+def B_LENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
+
+def B_LENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
+
+def B_LENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
+
+def B_LENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
+
+def B_LENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
+
+def B_BENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
+
+def B_BENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
+
+def B_BENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
+
+def B_BENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
+
+def B_BENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
+
+def B_SWAP_DOUBLE(arg): return __swap_double(arg)
+
+def B_SWAP_FLOAT(arg): return __swap_float(arg)
+
+def B_SWAP_INT64(arg): return __swap_int64(arg)
+
+def B_SWAP_INT32(arg): return __swap_int32(arg)
+
+def B_SWAP_INT16(arg): return __swap_int16(arg)
+
+def htonl(x): return B_HOST_TO_BENDIAN_INT32(x)
+
+def ntohl(x): return B_BENDIAN_TO_HOST_INT32(x)
+
+def htons(x): return B_HOST_TO_BENDIAN_INT16(x)
+
+def ntohs(x): return B_BENDIAN_TO_HOST_INT16(x)
+
+AF_INET = 1
+INADDR_ANY = 0x00000000
+INADDR_BROADCAST = 0xffffffff
+INADDR_LOOPBACK = 0x7f000001
+SOL_SOCKET = 1
+SO_DEBUG = 1
+SO_REUSEADDR = 2
+SO_NONBLOCK = 3
+SO_REUSEPORT = 4
+MSG_OOB = 0x1
+SOCK_DGRAM = 1
+SOCK_STREAM = 2
+IPPROTO_UDP = 1
+IPPROTO_TCP = 2
+IPPROTO_ICMP = 3
+B_UDP_MAX_SIZE = (65536 - 1024)
+FD_SETSIZE = 256
+FDSETSIZE = FD_SETSIZE
+NFDBITS = 32
+def _FDMSKNO(fd): return ((fd) / NFDBITS)
+
+def _FDBITNO(fd): return ((fd) % NFDBITS)
diff -urN Python-2.7a1/Lib/plat-haiku1/regen Python-2.7a1-haiku/Lib/plat-haiku1/regen
--- Python-2.7a1/Lib/plat-haiku1/regen 1970-01-01 00:00:00.000000000 +0000
+++ Python-2.7a1-haiku/Lib/plat-haiku1/regen 2009-12-05 19:43:22.000000000 +0000
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+H2PY=../../Tools/scripts/h2py.py
+HEADERS=/boot/develop/headers
+
+set -v
+python $H2PY -i '(u_long)' $HEADERS/posix/netinet/in.h
diff -urN Python-2.7a1/Modules/resource.c Python-2.7a1-haiku/Modules/resource.c
--- Python-2.7a1/Modules/resource.c 2009-05-08 20:58:08.000000000 +0000
+++ Python-2.7a1-haiku/Modules/resource.c 2009-12-05 19:43:22.000000000 +0000
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,6 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
diff -urN Python-2.7a1/Modules/socketmodule.c Python-2.7a1-haiku/Modules/socketmodule.c
--- Python-2.7a1/Modules/socketmodule.c 2009-09-25 15:19:51.000000000 +0000
+++ Python-2.7a1-haiku/Modules/socketmodule.c 2009-12-05 19:43:22.000000000 +0000
@@ -4699,7 +4699,9 @@
#ifndef __BEOS__
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
+#ifndef __HAIKU__
PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+#endif
#if defined(SOCK_RDM)
PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
#endif
diff -urN Python-2.7a1/Modules/socketmodule.h Python-2.7a1-haiku/Modules/socketmodule.h
--- Python-2.7a1/Modules/socketmodule.h 2008-06-14 08:36:07.000000000 +0000
+++ Python-2.7a1-haiku/Modules/socketmodule.h 2009-12-05 19:43:22.000000000 +0000
@@ -47,6 +47,10 @@
# undef AF_NETLINK
#endif
+#if defined(__HAIKU__)
+#undef HAVE_BLUETOOTH_BLUETOOTH_H
+#endif
+
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
diff -urN Python-2.7a1/Modules/spwdmodule.c Python-2.7a1-haiku/Modules/spwdmodule.c
--- Python-2.7a1/Modules/spwdmodule.c 2008-06-09 04:58:54.000000000 +0000
+++ Python-2.7a1-haiku/Modules/spwdmodule.c 2009-12-05 19:43:22.000000000 +0000
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN Python-2.7a1/Modules/timemodule.c Python-2.7a1-haiku/Modules/timemodule.c
--- Python-2.7a1/Modules/timemodule.c 2009-09-22 19:13:27.000000000 +0000
+++ Python-2.7a1-haiku/Modules/timemodule.c 2009-12-05 19:43:22.000000000 +0000
@@ -988,11 +988,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
diff -urN Python-2.7a1/Parser/asdl_c.py Python-2.7a1-haiku/Parser/asdl_c.py
--- Python-2.7a1/Parser/asdl_c.py 2009-06-07 22:54:35.000000000 +0000
+++ Python-2.7a1-haiku/Parser/asdl_c.py 2009-12-05 19:43:22.000000000 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
"""Generate C code from an ASDL description."""
# TO DO
diff -urN Python-2.7a1/Tools/scripts/h2py.py Python-2.7a1-haiku/Tools/scripts/h2py.py
--- Python-2.7a1/Tools/scripts/h2py.py 2004-08-09 17:27:55.000000000 +0000
+++ Python-2.7a1-haiku/Tools/scripts/h2py.py 2009-12-05 19:43:22.000000000 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
# Read #define's and translate to Python code.
# Handle #include statements.
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
diff -urN Python-2.7a1/configure.in Python-2.7a1-haiku/configure.in
--- Python-2.7a1/configure.in 2009-12-03 02:52:39.000000000 +0000
+++ Python-2.7a1-haiku/configure.in 2009-12-05 19:43:22.000000000 +0000
@@ -13,7 +13,7 @@
[],
[m4_fatal([Autoconf version $1 is required for Python], 63)])
])
-version_required(2.61)
+#version_required(2.61)
AC_REVISION($Revision: 76644 $)
AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
@@ -742,7 +742,7 @@
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*)
LDLIBRARY='libpython$(VERSION).so'
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
@@ -827,7 +827,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1754,7 +1754,7 @@
fi
fi
;;
- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
+ Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';;
BSD/OS*/4*) LDSHARED="gcc -shared";;
FreeBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
@@ -1807,7 +1807,7 @@
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
- Linux*|GNU*) CCSHARED="-fPIC";;
+ Linux*|GNU*|Haiku*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
@@ -1839,7 +1839,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|Haiku*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
# -u _PyMac_Error is needed to pull in the mac toolbox glue,
@@ -1958,6 +1958,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -3221,7 +3224,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -urN Python-2.7a1/setup.py Python-2.7a1-haiku/setup.py
--- Python-2.7a1/setup.py 2009-11-28 10:44:20.000000000 +0000
+++ Python-2.7a1-haiku/setup.py 2009-12-05 19:46:41.000000000 +0000
@@ -371,6 +371,10 @@
inc_dirs += ['/system/include', '/atheos/autolnk/include']
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+ if platform == 'haiku1':
+ inc_dirs += ['/boot/develop/headers/posix', '/boot/develop/headers/3rdparty', '/boot/common/include']
+ lib_dirs += ['/boot/system/lib', '/boot/develop/lib/x86', '/boot/common/lib']
+
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if platform in ['osf1', 'unixware7', 'openunix8']:
lib_dirs += ['/usr/ccs/lib']
@@ -394,7 +398,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -1087,7 +1091,7 @@
missing.append('resource')
# Sun yellow pages. Some systems have the functions in libc.
- if platform not in ['cygwin', 'atheos', 'qnx6']:
+ if platform not in ['cygwin', 'atheos', 'qnx6', 'haiku1']:
if (self.compiler_obj.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:

View File

@@ -1,265 +0,0 @@
diff -urN Python-2.5.2/Modules/_ctypes/libffi/configure.ac Python-2.5.2-haiku/Modules/_ctypes/libffi/configure.ac
--- Python-2.5.2/Modules/_ctypes/libffi/configure.ac 2007-09-04 23:47:16.000000000 +0000
+++ Python-2.5.2-haiku/Modules/_ctypes/libffi/configure.ac 2008-10-09 18:14:32.000000000 +0000
@@ -34,6 +34,7 @@
i*86-*-solaris2.1[[0-9]]*) TARGET=X86_64; TARGETDIR=x86;;
i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
+i*86-*-haiku*) TARGET=X86; TARGETDIR=x86;;
i*86-*-freebsd* | i*86-*-kfreebsd*-gnu) TARGET=X86; TARGETDIR=x86;;
i*86-*-netbsdelf* | i*86-*-knetbsd*-gnu) TARGET=X86; TARGETDIR=x86;;
i*86-*-openbsd*) TARGET=X86; TARGETDIR=x86;;
diff -urN Python-2.5.2/Modules/resource.c Python-2.5.2-haiku/Modules/resource.c
--- Python-2.5.2/Modules/resource.c 2006-05-29 21:04:52.000000000 +0000
+++ Python-2.5.2-haiku/Modules/resource.c 2008-10-09 18:14:32.000000000 +0000
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,6 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
diff -urN Python-2.5.2/Modules/selectmodule.c Python-2.5.2-haiku/Modules/selectmodule.c
--- Python-2.5.2/Modules/selectmodule.c 2006-07-10 01:18:57.000000000 +0000
+++ Python-2.5.2-haiku/Modules/selectmodule.c 2008-10-09 18:14:32.000000000 +0000
@@ -49,7 +49,7 @@
# include <winsock.h>
#else
# define SOCKET int
-# ifdef __BEOS__
+# if defined(__BEOS__) && !defined(__HAIKU__)
# include <net/socket.h>
# elif defined(__VMS)
# include <socket.h>
diff -urN Python-2.5.2/Modules/socketmodule.c Python-2.5.2-haiku/Modules/socketmodule.c
--- Python-2.5.2/Modules/socketmodule.c 2007-03-31 18:56:11.000000000 +0000
+++ Python-2.5.2-haiku/Modules/socketmodule.c 2008-10-09 18:14:33.000000000 +0000
@@ -244,7 +244,7 @@
# include <netdb.h>
/* Headers needed for inet_ntoa() and inet_addr() */
-# ifdef __BEOS__
+# if defined(__BEOS__) && !defined(__HAIKU__)
# include <net/netdb.h>
# elif defined(PYOS_OS2) && defined(PYCC_VACPP)
# include <netdb.h>
@@ -336,7 +336,7 @@
#include "getnameinfo.c"
#endif
-#if defined(MS_WINDOWS) || defined(__BEOS__)
+#if defined(MS_WINDOWS) || (defined(__BEOS__) && !defined(__HAIKU__))
/* BeOS suffers from the same socket dichotomy as Win32... - [cjh] */
/* seem to be a few differences in the API */
#define SOCKETCLOSE closesocket
@@ -667,7 +667,7 @@
#endif
Py_BEGIN_ALLOW_THREADS
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
block = !block;
setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK,
(void *)(&block), sizeof(int));
@@ -696,7 +696,7 @@
block = !block;
socketioctl(s->sock_fd, FIONBIO, (u_long*)&block);
#endif /* RISCOS */
-#endif /* __BEOS__ */
+#endif /* defined(__BEOS__) && !defined(__HAIKU__) */
Py_END_ALLOW_THREADS
/* Since these don't return anything */
@@ -1021,7 +1021,7 @@
return Py_None;
}
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* XXX: BeOS version of accept() doesn't set family correctly */
addr->sa_family = AF_INET;
#endif
@@ -1756,7 +1756,7 @@
PyObject *buf;
socklen_t buflen = 0;
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* We have incomplete socket support. */
PyErr_SetString(socket_error, "getsockopt not supported");
return NULL;
@@ -1797,7 +1797,7 @@
}
_PyString_Resize(&buf, buflen);
return buf;
-#endif /* __BEOS__ */
+#endif /* defined(__BEOS__) && !defined(__HAIKU__) */
}
PyDoc_STRVAR(getsockopt_doc,
@@ -3354,7 +3354,7 @@
{
char *name;
struct protoent *sp;
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* Not available in BeOS yet. - [cjh] */
PyErr_SetString(socket_error, "getprotobyname not supported");
return NULL;
@@ -4440,7 +4440,7 @@
/* Socket types */
PyModule_AddIntConstant(m, "SOCK_STREAM", SOCK_STREAM);
PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM);
-#ifndef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
diff -urN Python-2.5.2/Modules/socketmodule.h Python-2.5.2-haiku/Modules/socketmodule.h
--- Python-2.5.2/Modules/socketmodule.h 2006-12-03 11:24:00.000000000 +0000
+++ Python-2.5.2-haiku/Modules/socketmodule.h 2008-10-09 18:14:33.000000000 +0000
@@ -41,6 +41,10 @@
# undef AF_NETLINK
#endif
+#if defined(__HAIKU__)
+#undef HAVE_BLUETOOTH_BLUETOOTH_H
+#endif
+
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
diff -urN Python-2.5.2/Modules/spwdmodule.c Python-2.5.2-haiku/Modules/spwdmodule.c
--- Python-2.5.2/Modules/spwdmodule.c 2006-08-02 06:15:10.000000000 +0000
+++ Python-2.5.2-haiku/Modules/spwdmodule.c 2008-10-09 18:15:56.000000000 +0000
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN Python-2.5.2/Modules/timemodule.c Python-2.5.2-haiku/Modules/timemodule.c
--- Python-2.5.2/Modules/timemodule.c 2007-12-24 20:00:42.000000000 +0000
+++ Python-2.5.2-haiku/Modules/timemodule.c 2008-10-09 18:20:00.000000000 +0000
@@ -968,11 +968,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
diff -urN Python-2.5.2/Tools/scripts/h2py.py Python-2.5.2-haiku/Tools/scripts/h2py.py
--- Python-2.5.2/Tools/scripts/h2py.py 2004-08-09 17:27:55.000000000 +0000
+++ Python-2.5.2-haiku/Tools/scripts/h2py.py 2008-10-09 18:14:33.000000000 +0000
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
diff -urN Python-2.5.2/configure.in Python-2.5.2-haiku/configure.in
--- Python-2.5.2/configure.in 2008-02-13 19:17:17.000000000 +0000
+++ Python-2.5.2-haiku/configure.in 2008-10-09 18:15:55.000000000 +0000
@@ -631,6 +631,11 @@
BeOS*)
LDLIBRARY='libpython$(VERSION).so'
;;
+ Haiku*)
+ LDLIBRARY='libpython$(VERSION).so'
+ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ ;;
CYGWIN*)
LDLIBRARY='libpython$(VERSION).dll.a'
DLLLIBRARY='libpython$(VERSION).dll'
@@ -713,7 +718,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1449,6 +1454,10 @@
BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
;;
+ Haiku*)
+ LDFLAGS="-L." # help ld find libpythonX.Y.so in root directory
+ LDSHARED="gcc -shared"
+ ;;
IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/5*)
@@ -1589,6 +1598,7 @@
*) CCSHARED="";;
esac;;
atheos*) CCSHARED="-fPIC";;
+ Haiku*) CCSHARED="-fPIC";;
esac
fi
AC_MSG_RESULT($CCSHARED)
@@ -1714,6 +1724,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -2883,7 +2896,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -urN Python-2.5.2/setup.py Python-2.5.2-haiku/setup.py
--- Python-2.5.2/setup.py 2008-02-04 23:41:02.000000000 +0000
+++ Python-2.5.2-haiku/setup.py 2008-10-09 18:15:55.000000000 +0000
@@ -337,7 +337,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -911,7 +911,7 @@
exts.append( Extension('resource', ['resource.c']) )
# Sun yellow pages. Some systems have the functions in libc.
- if platform not in ['cygwin', 'atheos']:
+ if platform not in ['cygwin', 'atheos', 'haiku1']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:

View File

@@ -1,300 +0,0 @@
diff -urN Python-2.5.2/Makefile.pre.in Python-2.5.2-haiku/Makefile.pre.in
--- Python-2.5.2/Makefile.pre.in 2007-12-05 12:43:57.000000000 -0800
+++ Python-2.5.2-haiku/Makefile.pre.in 2008-08-14 19:44:04.000000000 -0700
@@ -890,6 +890,15 @@
echo; echo "See Misc/BeOS-NOTES for details."; \
;; \
esac
+ @case "$(MACHDEP)" in haiku*) \
+ echo; echo "Installing support files for building shared extension modules on Haiku:"; \
+ $(INSTALL_DATA) Misc/Haiku-NOTES $(DESTDIR)$(LIBPL)/README; \
+ echo; echo "$(LIBPL)/README"; \
+ $(INSTALL_SCRIPT) Modules/ld_so_haiku $(DESTDIR)$(LIBPL)/ld_so_haiku; \
+ echo "$(LIBPL)/ld_so_haiku"; \
+ echo; echo "See Misc/Haiku-NOTES for details."; \
+ ;; \
+ esac
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
diff -urN Python-2.5.2/Modules/_ctypes/libffi/configure.ac Python-2.5.2-haiku/Modules/_ctypes/libffi/configure.ac
--- Python-2.5.2/Modules/_ctypes/libffi/configure.ac 2007-09-04 16:47:16.000000000 -0700
+++ Python-2.5.2-haiku/Modules/_ctypes/libffi/configure.ac 2008-08-14 18:02:59.000000000 -0700
@@ -34,6 +34,7 @@
i*86-*-solaris2.1[[0-9]]*) TARGET=X86_64; TARGETDIR=x86;;
i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
+i*86-*-haiku*) TARGET=X86; TARGETDIR=x86;;
i*86-*-freebsd* | i*86-*-kfreebsd*-gnu) TARGET=X86; TARGETDIR=x86;;
i*86-*-netbsdelf* | i*86-*-knetbsd*-gnu) TARGET=X86; TARGETDIR=x86;;
i*86-*-openbsd*) TARGET=X86; TARGETDIR=x86;;
diff -urN Python-2.5.2/Modules/ld_so_haiku Python-2.5.2-haiku/Modules/ld_so_haiku
--- Python-2.5.2/Modules/ld_so_haiku 1969-12-31 16:00:00.000000000 -0800
+++ Python-2.5.2-haiku/Modules/ld_so_haiku 2008-08-14 19:45:12.000000000 -0700
@@ -0,0 +1,78 @@
+#! /bin/sh
+#
+# linkmodule for Python
+# Chris Herborth (chrish@qnx.com)
+#
+# This is covered by the same copyright/licensing terms as the rest of
+# Python.
+#
+# Shell script to build shared library versions of the modules; since
+# the change to the *ahem* "proper" import/export mechanism, this script
+# is much simpler. It handles PowerPC and x86, too.
+#
+# This is called by the Modules/Makefile as $(LDSHARED):
+#
+# $(LDSHARED) foomodule.o -o foomodule$(SO)
+#
+# Could also be called as:
+#
+# $(LDSHARED) readline.o -L/boot/home/config/lib -lreadline -ltermcap \
+# -o readline$(SO)
+#
+# so we need to preserve the arguments, sort of.
+
+# Make sure we got reasonable arguments.
+TARGET=""
+ARGS=""
+
+while [ "$#" != "0" ]; do
+ case "$1" in
+ -o) TARGET="$2"; shift; shift;;
+ *) ARGS="$ARGS $1"; shift;;
+ esac
+done
+
+if [ "$TARGET" = "" ] ; then
+ echo "Usage:"
+ echo
+ echo " $0 [args] -o foomodule.so [args] foomodule.o [args]"
+ echo
+ echo "Where:"
+ echo
+ echo " [args] normal compiler arguments"
+ exit 1
+fi
+
+# The shared libraries and glue objects we need to link against; these
+# libs are overkill for most of the standard modules, but it makes life
+# in this shell script easier.
+LIBS="-lbe -lnetwork -lroot"
+
+case $BE_HOST_CPU in
+ ppc)
+ # Boy, do we need a lot of crap...
+ GLUE_LOC=/boot/develop/lib/ppc
+ GLUE="${GLUE_LOC}/glue-noinit.a ${GLUE_LOC}/init_term_dyn.o"
+ case $(uname -r) in
+ 4.0*) CC="mwcc -xms -export pragma -nodup" ;;
+ *) CC="mwcc -shared -export pragma -nodup" ;;
+ esac
+ ;;
+
+ x86)
+ # We don't need as much crap here...
+ GLUE=""
+ CC="gcc -nostart -Wl,-soname=${TARGET}"
+ ;;
+
+ *)
+ # What the?!?
+ echo "$0 doesn't support $BE_HOST_CPU systems..."
+ echo "You're on your own... I'd be surprised if this works."
+ GLUE=""
+ CC="cc"
+ ;;
+esac
+
+# Now link that shared lib...
+$CC -o $TARGET $ARGS $GLUE $LIBS
diff -urN Python-2.5.2/Modules/resource.c Python-2.5.2-haiku/Modules/resource.c
--- Python-2.5.2/Modules/resource.c 2006-05-29 14:04:52.000000000 -0700
+++ Python-2.5.2-haiku/Modules/resource.c 2008-08-14 18:02:59.000000000 -0700
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,6 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
diff -urN Python-2.5.2/Modules/selectmodule.c Python-2.5.2-haiku/Modules/selectmodule.c
--- Python-2.5.2/Modules/selectmodule.c 2006-07-09 18:18:57.000000000 -0700
+++ Python-2.5.2-haiku/Modules/selectmodule.c 2008-08-14 18:02:59.000000000 -0700
@@ -49,7 +49,7 @@
# include <winsock.h>
#else
# define SOCKET int
-# ifdef __BEOS__
+# if defined(__BEOS__) && !defined(__HAIKU__)
# include <net/socket.h>
# elif defined(__VMS)
# include <socket.h>
diff -urN Python-2.5.2/Modules/socketmodule.c Python-2.5.2-haiku/Modules/socketmodule.c
--- Python-2.5.2/Modules/socketmodule.c 2007-03-31 11:56:11.000000000 -0700
+++ Python-2.5.2-haiku/Modules/socketmodule.c 2008-08-14 18:02:59.000000000 -0700
@@ -244,7 +244,7 @@
# include <netdb.h>
/* Headers needed for inet_ntoa() and inet_addr() */
-# ifdef __BEOS__
+# if defined(__BEOS__) && !defined(__HAIKU__)
# include <net/netdb.h>
# elif defined(PYOS_OS2) && defined(PYCC_VACPP)
# include <netdb.h>
@@ -3740,6 +3740,10 @@
\n\
Convert a packed IP address of the given family to string format.");
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
+#endif
+
static PyObject *
socket_inet_ntop(PyObject *self, PyObject *args)
{
diff -urN Python-2.5.2/Modules/socketmodule.h Python-2.5.2-haiku/Modules/socketmodule.h
--- Python-2.5.2/Modules/socketmodule.h 2006-12-03 03:24:00.000000000 -0800
+++ Python-2.5.2-haiku/Modules/socketmodule.h 2008-08-14 18:02:59.000000000 -0700
@@ -2,7 +2,7 @@
/* Includes needed for the sockaddr_* symbols below */
#ifndef MS_WINDOWS
-#ifdef __VMS
+# ifdef __VMS
# include <socket.h>
# else
# include <sys/socket.h>
@@ -41,6 +41,8 @@
# undef AF_NETLINK
#endif
+#undef HAVE_BLUETOOTH_BLUETOOTH_H
+
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
diff -urN Python-2.5.2/Modules/spwdmodule.c Python-2.5.2-haiku/Modules/spwdmodule.c
--- Python-2.5.2/Modules/spwdmodule.c 2006-08-01 23:15:10.000000000 -0700
+++ Python-2.5.2-haiku/Modules/spwdmodule.c 2008-08-14 18:02:59.000000000 -0700
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN Python-2.5.2/Modules/syslogmodule.c Python-2.5.2-haiku/Modules/syslogmodule.c
--- Python-2.5.2/Modules/syslogmodule.c 2006-05-29 14:04:52.000000000 -0700
+++ Python-2.5.2-haiku/Modules/syslogmodule.c 2008-08-14 18:02:59.000000000 -0700
@@ -136,7 +136,11 @@
long pri;
if (!PyArg_ParseTuple(args, "l:LOG_UPTO", &pri))
return NULL;
+#ifdef __HAIKU__
+ mask = 0;
+#else
mask = LOG_UPTO(pri);
+#endif
return PyInt_FromLong(mask);
}
diff -urN Python-2.5.2/Parser/asdl_c.py Python-2.5.2-haiku/Parser/asdl_c.py
--- Python-2.5.2/Parser/asdl_c.py 2007-01-18 22:42:33.000000000 -0800
+++ Python-2.5.2-haiku/Parser/asdl_c.py 2008-08-14 18:02:59.000000000 -0700
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
"""Generate C code from an ASDL description."""
# TO DO
diff -urN Python-2.5.2/Tools/scripts/h2py.py Python-2.5.2-haiku/Tools/scripts/h2py.py
--- Python-2.5.2/Tools/scripts/h2py.py 2004-08-09 10:27:55.000000000 -0700
+++ Python-2.5.2-haiku/Tools/scripts/h2py.py 2008-08-14 18:02:59.000000000 -0700
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 || sys.platform.find("haiku") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
diff -urN Python-2.5.2/configure.in Python-2.5.2-haiku/configure.in
--- Python-2.5.2/configure.in 2008-02-13 11:17:17.000000000 -0800
+++ Python-2.5.2-haiku/configure.in 2008-08-14 19:42:26.000000000 -0700
@@ -379,6 +379,11 @@
AR="\$(srcdir)/Modules/ar_beos"
RANLIB=:
;;
+ Haiku*)
+ CC=gcc
+ without_gcc=no
+ OPT="$OPT -O"
+ ;;
Monterey*)
RANLIB=:
without_gcc=;;
@@ -628,7 +633,7 @@
if test $enable_shared = "yes"; then
AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
case $ac_sys_system in
- BeOS*)
+ BeOS*|Haiku*)
LDLIBRARY='libpython$(VERSION).so'
;;
CYGWIN*)
@@ -713,7 +718,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1449,6 +1454,10 @@
BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
;;
+ Haiku*)
+ BLDSHARED="\$(srcdir)/Modules/ld_so_haiku $LDLIBRARY"
+ LDSHARED="\$(BINLIBDEST)/config/ld_so_haiku \$(LIBDIR)/$LDLIBRARY"
+ ;;
IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/5*)
@@ -1711,8 +1720,9 @@
AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
case "$ac_sys_system" in
-BeOS*)
+BeOS* | Haiku*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
;;
esac
@@ -2883,7 +2893,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)

View File

@@ -1,139 +0,0 @@
diff -urN Python-2.5.4/Modules/socketmodule.h Python-2.5.4-haiku/Modules/socketmodule.h
--- Python-2.5.4/Modules/socketmodule.h 2009-01-13 06:55:28.000000000 +0000
+++ Python-2.5.4-haiku/Modules/socketmodule.h 2009-01-13 07:00:07.000000000 +0000
@@ -41,6 +41,10 @@
# undef AF_NETLINK
#endif
+#if defined(__HAIKU__)
+#undef HAVE_BLUETOOTH_BLUETOOTH_H
+#endif
+
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
diff -urN Python-2.5.4/Modules/spwdmodule.c Python-2.5.4-haiku/Modules/spwdmodule.c
--- Python-2.5.4/Modules/spwdmodule.c 2009-01-13 06:55:28.000000000 +0000
+++ Python-2.5.4-haiku/Modules/spwdmodule.c 2009-01-13 07:00:07.000000000 +0000
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN Python-2.5.4/Modules/timemodule.c Python-2.5.4-haiku/Modules/timemodule.c
--- Python-2.5.4/Modules/timemodule.c 2009-01-13 06:55:28.000000000 +0000
+++ Python-2.5.4-haiku/Modules/timemodule.c 2009-01-13 07:00:07.000000000 +0000
@@ -968,11 +968,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
diff -urN Python-2.5.4/Tools/scripts/h2py.py Python-2.5.4-haiku/Tools/scripts/h2py.py
--- Python-2.5.4/Tools/scripts/h2py.py 2009-01-13 06:55:41.000000000 +0000
+++ Python-2.5.4-haiku/Tools/scripts/h2py.py 2009-01-13 07:00:08.000000000 +0000
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
diff -urN Python-2.5.4/configure.in Python-2.5.4-haiku/configure.in
--- Python-2.5.4/configure.in 2009-01-13 06:56:08.000000000 +0000
+++ Python-2.5.4-haiku/configure.in 2009-01-13 07:00:08.000000000 +0000
@@ -627,6 +627,11 @@
BeOS*)
LDLIBRARY='libpython$(VERSION).so'
;;
+ Haiku*)
+ LDLIBRARY='libpython$(VERSION).so'
+ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ ;;
CYGWIN*)
LDLIBRARY='libpython$(VERSION).dll.a'
DLLLIBRARY='libpython$(VERSION).dll'
@@ -709,7 +714,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1445,6 +1450,10 @@
BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
;;
+ Haiku*)
+ LDFLAGS="-L." # help ld find libpythonX.Y.so in root directory
+ LDSHARED="gcc -shared"
+ ;;
IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/5*)
@@ -1585,6 +1594,7 @@
*) CCSHARED="";;
esac;;
atheos*) CCSHARED="-fPIC";;
+ Haiku*) CCSHARED="-fPIC";;
esac
fi
AC_MSG_RESULT($CCSHARED)
@@ -1710,6 +1720,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -2879,7 +2892,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -urN Python-2.5.4/setup.py Python-2.5.4-haiku/setup.py
--- Python-2.5.4/setup.py 2009-01-13 06:56:07.000000000 +0000
+++ Python-2.5.4-haiku/setup.py 2009-01-13 07:00:08.000000000 +0000
@@ -338,7 +338,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -912,7 +912,7 @@
exts.append( Extension('resource', ['resource.c']) )
# Sun yellow pages. Some systems have the functions in libc.
- if platform not in ['cygwin', 'atheos']:
+ if platform not in ['cygwin', 'atheos', 'haiku1']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:

View File

@@ -1,315 +0,0 @@
diff -urN Python-2.5.4/Lib/test/regrtest.py Python-2.5.4-haiku/Lib/test/regrtest.py
--- Python-2.5.4/Lib/test/regrtest.py 2009-01-02 15:47:37.000000000 +0000
+++ Python-2.5.4-haiku/Lib/test/regrtest.py 2009-01-03 04:18:40.000000000 +0000
@@ -846,6 +846,42 @@
test_wait3
test_wait4
""",
+ 'haiku1':
+ """
+ test_al
+ test_applesingle
+ test_bsddb
+ test_bsddb185
+ test_bsddb3
+ test_cd
+ test_cl
+ test_codecmaps_cn
+ test_codecmaps_hk
+ test_codecmaps_jp
+ test_codecmaps_kr
+ test_codecmaps_tw
+ test_curses
+ test_dbm
+ test_dl
+ test_gl
+ test_gdbm
+ test_imgfile
+ test_linuxaudiodev
+ test__locale
+ test_gl
+ test_macfs
+ test_macostools
+ test_mailbox
+ test_nis
+ test_normalization
+ test_old_mailbox
+ test_ossaudiodev
+ test_pep277
+ test_plistlib
+ test_resource
+ test_startfile
+ test_sunaudiodev
+ """,
'linux2':
"""
test_al
diff -urN Python-2.5.4/Modules/resource.c Python-2.5.4-haiku/Modules/resource.c
--- Python-2.5.4/Modules/resource.c 2009-01-02 15:46:32.000000000 +0000
+++ Python-2.5.4-haiku/Modules/resource.c 2009-01-02 15:49:40.000000000 +0000
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,6 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
diff -urN Python-2.5.4/Modules/selectmodule.c Python-2.5.4-haiku/Modules/selectmodule.c
--- Python-2.5.4/Modules/selectmodule.c 2009-01-02 15:46:32.000000000 +0000
+++ Python-2.5.4-haiku/Modules/selectmodule.c 2009-01-02 15:49:40.000000000 +0000
@@ -49,7 +49,7 @@
# include <winsock.h>
#else
# define SOCKET int
-# ifdef __BEOS__
+# if defined(__BEOS__) && !defined(__HAIKU__)
# include <net/socket.h>
# elif defined(__VMS)
# include <socket.h>
diff -urN Python-2.5.4/Modules/socketmodule.c Python-2.5.4-haiku/Modules/socketmodule.c
--- Python-2.5.4/Modules/socketmodule.c 2009-01-02 15:46:31.000000000 +0000
+++ Python-2.5.4-haiku/Modules/socketmodule.c 2009-01-02 15:49:40.000000000 +0000
@@ -244,7 +244,7 @@
# include <netdb.h>
/* Headers needed for inet_ntoa() and inet_addr() */
-# ifdef __BEOS__
+# if defined(__BEOS__) && !defined(__HAIKU__)
# include <net/netdb.h>
# elif defined(PYOS_OS2) && defined(PYCC_VACPP)
# include <netdb.h>
@@ -336,7 +336,7 @@
#include "getnameinfo.c"
#endif
-#if defined(MS_WINDOWS) || defined(__BEOS__)
+#if defined(MS_WINDOWS) || (defined(__BEOS__) && !defined(__HAIKU__))
/* BeOS suffers from the same socket dichotomy as Win32... - [cjh] */
/* seem to be a few differences in the API */
#define SOCKETCLOSE closesocket
@@ -667,7 +667,7 @@
#endif
Py_BEGIN_ALLOW_THREADS
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
block = !block;
setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK,
(void *)(&block), sizeof(int));
@@ -696,7 +696,7 @@
block = !block;
socketioctl(s->sock_fd, FIONBIO, (u_long*)&block);
#endif /* RISCOS */
-#endif /* __BEOS__ */
+#endif /* defined(__BEOS__) && !defined(__HAIKU__) */
Py_END_ALLOW_THREADS
/* Since these don't return anything */
@@ -1021,7 +1021,7 @@
return Py_None;
}
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* XXX: BeOS version of accept() doesn't set family correctly */
addr->sa_family = AF_INET;
#endif
@@ -1756,7 +1756,7 @@
PyObject *buf;
socklen_t buflen = 0;
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* We have incomplete socket support. */
PyErr_SetString(socket_error, "getsockopt not supported");
return NULL;
@@ -1797,7 +1797,7 @@
}
_PyString_Resize(&buf, buflen);
return buf;
-#endif /* __BEOS__ */
+#endif /* defined(__BEOS__) && !defined(__HAIKU__) */
}
PyDoc_STRVAR(getsockopt_doc,
@@ -3354,7 +3354,7 @@
{
char *name;
struct protoent *sp;
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* Not available in BeOS yet. - [cjh] */
PyErr_SetString(socket_error, "getprotobyname not supported");
return NULL;
@@ -4440,7 +4440,7 @@
/* Socket types */
PyModule_AddIntConstant(m, "SOCK_STREAM", SOCK_STREAM);
PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM);
-#ifndef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
diff -urN Python-2.5.4/Modules/socketmodule.h Python-2.5.4-haiku/Modules/socketmodule.h
--- Python-2.5.4/Modules/socketmodule.h 2009-01-02 15:46:31.000000000 +0000
+++ Python-2.5.4-haiku/Modules/socketmodule.h 2009-01-02 15:49:40.000000000 +0000
@@ -41,6 +41,10 @@
# undef AF_NETLINK
#endif
+#if defined(__HAIKU__)
+#undef HAVE_BLUETOOTH_BLUETOOTH_H
+#endif
+
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
diff -urN Python-2.5.4/Modules/spwdmodule.c Python-2.5.4-haiku/Modules/spwdmodule.c
--- Python-2.5.4/Modules/spwdmodule.c 2009-01-02 15:46:31.000000000 +0000
+++ Python-2.5.4-haiku/Modules/spwdmodule.c 2009-01-02 15:49:40.000000000 +0000
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN Python-2.5.4/Modules/timemodule.c Python-2.5.4-haiku/Modules/timemodule.c
--- Python-2.5.4/Modules/timemodule.c 2009-01-02 15:46:32.000000000 +0000
+++ Python-2.5.4-haiku/Modules/timemodule.c 2009-01-02 15:49:40.000000000 +0000
@@ -968,11 +968,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
diff -urN Python-2.5.4/Parser/asdl_c.py Python-2.5.4-haiku/Parser/asdl_c.py
--- Python-2.5.4/Parser/asdl_c.py 2009-01-02 15:47:18.000000000 +0000
+++ Python-2.5.4-haiku/Parser/asdl_c.py 2009-01-02 16:12:00.000000000 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
"""Generate C code from an ASDL description."""
# TO DO
diff -urN Python-2.5.4/Tools/scripts/h2py.py Python-2.5.4-haiku/Tools/scripts/h2py.py
--- Python-2.5.4/Tools/scripts/h2py.py 2009-01-02 15:46:48.000000000 +0000
+++ Python-2.5.4-haiku/Tools/scripts/h2py.py 2009-01-02 16:24:00.000000000 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
# Read #define's and translate to Python code.
# Handle #include statements.
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
diff -urN Python-2.5.4/configure.in Python-2.5.4-haiku/configure.in
--- Python-2.5.4/configure.in 2009-01-02 15:47:18.000000000 +0000
+++ Python-2.5.4-haiku/configure.in 2009-01-02 15:49:40.000000000 +0000
@@ -627,6 +627,11 @@
BeOS*)
LDLIBRARY='libpython$(VERSION).so'
;;
+ Haiku*)
+ LDLIBRARY='libpython$(VERSION).so'
+ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ ;;
CYGWIN*)
LDLIBRARY='libpython$(VERSION).dll.a'
DLLLIBRARY='libpython$(VERSION).dll'
@@ -709,7 +714,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1445,6 +1450,10 @@
BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
;;
+ Haiku*)
+ LDFLAGS="-L." # help ld find libpythonX.Y.so in root directory
+ LDSHARED="gcc -shared"
+ ;;
IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/5*)
@@ -1585,6 +1594,7 @@
*) CCSHARED="";;
esac;;
atheos*) CCSHARED="-fPIC";;
+ Haiku*) CCSHARED="-fPIC";;
esac
fi
AC_MSG_RESULT($CCSHARED)
@@ -1710,6 +1720,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -2879,7 +2892,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -urN Python-2.5.4/setup.py Python-2.5.4-haiku/setup.py
--- Python-2.5.4/setup.py 2009-01-02 15:47:18.000000000 +0000
+++ Python-2.5.4-haiku/setup.py 2009-01-02 15:49:40.000000000 +0000
@@ -338,7 +338,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -912,7 +912,7 @@
exts.append( Extension('resource', ['resource.c']) )
# Sun yellow pages. Some systems have the functions in libc.
- if platform not in ['cygwin', 'atheos']:
+ if platform not in ['cygwin', 'atheos', 'haiku1']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:

File diff suppressed because it is too large Load Diff

View File

@@ -1,254 +0,0 @@
diff -urN Python-2.6/Modules/resource.c Python-2.6-haiku/Modules/resource.c
--- Python-2.6/Modules/resource.c 2006-09-16 17:36:37.000000000 +0000
+++ Python-2.6-haiku/Modules/resource.c 2008-10-20 01:21:37.000000000 +0000
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,6 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
diff -urN Python-2.6/Modules/selectmodule.c Python-2.6-haiku/Modules/selectmodule.c
--- Python-2.6/Modules/selectmodule.c 2008-09-21 07:14:44.000000000 +0000
+++ Python-2.6-haiku/Modules/selectmodule.c 2008-10-20 01:21:37.000000000 +0000
@@ -50,7 +50,7 @@
# include <winsock.h>
#else
# define SOCKET int
-# ifdef __BEOS__
+# if defined(__BEOS__) && !defined(__HAIKU__)
# include <net/socket.h>
# elif defined(__VMS)
# include <socket.h>
diff -urN Python-2.6/Modules/socketmodule.c Python-2.6-haiku/Modules/socketmodule.c
--- Python-2.6/Modules/socketmodule.c 2008-08-12 14:49:50.000000000 +0000
+++ Python-2.6-haiku/Modules/socketmodule.c 2008-10-20 01:21:37.000000000 +0000
@@ -264,7 +264,7 @@
# include <netdb.h>
/* Headers needed for inet_ntoa() and inet_addr() */
-# ifdef __BEOS__
+# if defined(__BEOS__) && !defined(__HAIKU__)
# include <net/netdb.h>
# elif defined(PYOS_OS2) && defined(PYCC_VACPP)
# include <netdb.h>
@@ -358,7 +358,7 @@
#include "getnameinfo.c"
#endif
-#if defined(MS_WINDOWS) || defined(__BEOS__)
+#if defined(MS_WINDOWS) || (defined(__BEOS__) && !defined(__HAIKU__))
/* BeOS suffers from the same socket dichotomy as Win32... - [cjh] */
/* seem to be a few differences in the API */
#define SOCKETCLOSE closesocket
@@ -621,7 +621,7 @@
#endif
Py_BEGIN_ALLOW_THREADS
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
block = !block;
setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK,
(void *)(&block), sizeof(int));
@@ -650,7 +650,7 @@
block = !block;
socketioctl(s->sock_fd, FIONBIO, (u_long*)&block);
#endif /* RISCOS */
-#endif /* __BEOS__ */
+#endif /* defined(__BEOS__) && !defined(__HAIKU__) */
Py_END_ALLOW_THREADS
/* Since these don't return anything */
@@ -975,7 +975,7 @@
return Py_None;
}
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* XXX: BeOS version of accept() doesn't set family correctly */
addr->sa_family = AF_INET;
#endif
@@ -1824,7 +1824,7 @@
PyObject *buf;
socklen_t buflen = 0;
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* We have incomplete socket support. */
PyErr_SetString(socket_error, "getsockopt not supported");
return NULL;
@@ -1865,7 +1865,7 @@
}
_PyString_Resize(&buf, buflen);
return buf;
-#endif /* __BEOS__ */
+#endif /* defined(__BEOS__) && !defined(__HAIKU__) */
}
PyDoc_STRVAR(getsockopt_doc,
@@ -3474,7 +3474,7 @@
{
char *name;
struct protoent *sp;
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* Not available in BeOS yet. - [cjh] */
PyErr_SetString(socket_error, "getprotobyname not supported");
return NULL;
@@ -4630,7 +4630,7 @@
/* Socket types */
PyModule_AddIntConstant(m, "SOCK_STREAM", SOCK_STREAM);
PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM);
-#ifndef __BEOS__
+#if defined(__BEOS__) && !defined(__HAIKU__)
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
diff -urN Python-2.6/Modules/socketmodule.h Python-2.6-haiku/Modules/socketmodule.h
--- Python-2.6/Modules/socketmodule.h 2008-06-14 08:36:07.000000000 +0000
+++ Python-2.6-haiku/Modules/socketmodule.h 2008-10-20 01:21:37.000000000 +0000
@@ -47,6 +47,10 @@
# undef AF_NETLINK
#endif
+#if defined(__HAIKU__)
+#undef HAVE_BLUETOOTH_BLUETOOTH_H
+#endif
+
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
diff -urN Python-2.6/Modules/spwdmodule.c Python-2.6-haiku/Modules/spwdmodule.c
--- Python-2.6/Modules/spwdmodule.c 2008-06-09 04:58:54.000000000 +0000
+++ Python-2.6-haiku/Modules/spwdmodule.c 2008-10-20 01:21:37.000000000 +0000
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN Python-2.6/Modules/timemodule.c Python-2.6-haiku/Modules/timemodule.c
--- Python-2.6/Modules/timemodule.c 2008-07-05 19:19:50.000000000 +0000
+++ Python-2.6-haiku/Modules/timemodule.c 2008-10-20 01:21:37.000000000 +0000
@@ -968,11 +968,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
diff -urN Python-2.6/Tools/scripts/h2py.py Python-2.6-haiku/Tools/scripts/h2py.py
--- Python-2.6/Tools/scripts/h2py.py 2004-08-09 17:27:55.000000000 +0000
+++ Python-2.6-haiku/Tools/scripts/h2py.py 2008-10-20 02:34:15.000000000 +0000
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
diff -urN Python-2.6/configure.in Python-2.6-haiku/configure.in
--- Python-2.6/configure.in 2008-09-07 19:18:16.000000000 +0000
+++ Python-2.6-haiku/configure.in 2008-10-20 01:21:38.000000000 +0000
@@ -694,6 +694,11 @@
BeOS*)
LDLIBRARY='libpython$(VERSION).so'
;;
+ Haiku*)
+ LDLIBRARY='libpython$(VERSION).so'
+ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ ;;
CYGWIN*)
LDLIBRARY='libpython$(VERSION).dll.a'
DLLLIBRARY='libpython$(VERSION).dll'
@@ -776,7 +781,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1614,6 +1619,10 @@
BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
;;
+ Haiku*)
+ LDFLAGS="-L." # help ld find libpythonX.Y.so in root directory
+ LDSHARED="gcc -shared"
+ ;;
IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/5*)
@@ -1745,6 +1754,7 @@
*) CCSHARED="";;
esac;;
atheos*) CCSHARED="-fPIC";;
+ Haiku*) CCSHARED="-fPIC";;
esac
fi
AC_MSG_RESULT($CCSHARED)
@@ -1878,6 +1888,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -3096,7 +3109,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -urN Python-2.6/setup.py Python-2.6-haiku/setup.py
--- Python-2.6/setup.py 2008-09-30 00:15:45.000000000 +0000
+++ Python-2.6-haiku/setup.py 2008-10-20 01:28:27.000000000 +0000
@@ -404,7 +404,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -1051,7 +1051,7 @@
missing.append('resource')
# Sun yellow pages. Some systems have the functions in libc.
- if platform not in ['cygwin', 'atheos', 'qnx6']:
+ if platform not in ['cygwin', 'atheos', 'qnx6', haiku1']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:

View File

@@ -1,172 +0,0 @@
diff -urN Python-2.6.1.orig/configure.in Python-2.6.1/configure.in
--- Python-2.6.1.orig/configure.in 2008-12-14 19:09:28.489629527 +0100
+++ Python-2.6.1/configure.in 2008-12-14 19:29:07.185629448 +0100
@@ -704,7 +704,7 @@
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*)
LDLIBRARY='libpython$(VERSION).so'
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
@@ -776,7 +776,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1672,7 +1672,7 @@
fi
fi
;;
- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
+ Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';;
BSD/OS*/4*) LDSHARED="gcc -shared";;
FreeBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
@@ -1726,7 +1726,7 @@
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
- Linux*|GNU*) CCSHARED="-fPIC";;
+ Linux*|GNU*|Haiku*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
@@ -1759,7 +1759,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|Haiku*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
# -u _PyMac_Error is needed to pull in the mac toolbox glue,
@@ -1878,6 +1878,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -3096,7 +3099,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku*) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -urN Python-2.6.1.orig/Modules/resource.c Python-2.6.1/Modules/resource.c
--- Python-2.6.1.orig/Modules/resource.c 2008-12-14 19:10:06.821692465 +0100
+++ Python-2.6.1/Modules/resource.c 2008-12-14 19:25:04.289630126 +0100
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,6 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
diff -urN Python-2.6.1.orig/Modules/socketmodule.c Python-2.6.1/Modules/socketmodule.c
--- Python-2.6.1.orig/Modules/socketmodule.c 2008-12-14 19:10:12.709628161 +0100
+++ Python-2.6.1/Modules/socketmodule.c 2008-12-14 22:00:59.341627065 +0100
@@ -4633,7 +4633,9 @@
#ifndef __BEOS__
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
+#ifndef __HAIKU__
PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+#endif
#if defined(SOCK_RDM)
PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
#endif
diff -urN Python-2.6.1.orig/Modules/spwdmodule.c Python-2.6.1/Modules/spwdmodule.c
--- Python-2.6.1.orig/Modules/spwdmodule.c 2008-12-14 19:10:14.053629744 +0100
+++ Python-2.6.1/Modules/spwdmodule.c 2008-12-14 19:25:04.289630126 +0100
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN Python-2.6.1.orig/Modules/timemodule.c Python-2.6.1/Modules/timemodule.c
--- Python-2.6.1.orig/Modules/timemodule.c 2008-12-14 19:10:04.873637365 +0100
+++ Python-2.6.1/Modules/timemodule.c 2008-12-14 19:25:04.293630616 +0100
@@ -968,11 +968,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
diff -urN Python-2.6.1.orig/setup.py Python-2.6.1/setup.py
--- Python-2.6.1.orig/setup.py 2008-12-14 19:09:28.489629527 +0100
+++ Python-2.6.1/setup.py 2008-12-15 20:54:31.957990468 +0100
@@ -382,6 +382,9 @@
inc_dirs += ['/system/include', '/atheos/autolnk/include']
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+ if platform == 'haiku1':
+ inc_dirs += ['/boot/develop/headers/posix']
+
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if platform in ['osf1', 'unixware7', 'openunix8']:
lib_dirs += ['/usr/ccs/lib']
@@ -405,7 +408,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -1053,7 +1056,7 @@
missing.append('resource')
# Sun yellow pages. Some systems have the functions in libc.
- if platform not in ['cygwin', 'atheos', 'qnx6']:
+ if platform not in ['cygwin', 'atheos', 'qnx6', 'haiku1']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:
diff -urN Python-2.6.1.orig/Tools/scripts/h2py.py Python-2.6.1/Tools/scripts/h2py.py
--- Python-2.6.1.orig/Tools/scripts/h2py.py 2008-12-14 19:09:29.665626727 +0100
+++ Python-2.6.1/Tools/scripts/h2py.py 2008-12-14 19:25:04.313630203 +0100
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')

View File

@@ -1,543 +0,0 @@
diff -urN Python-2.6.2/Lib/plat-haiku1/IN.py Python-2.6.2-haiku/Lib/plat-haiku1/IN.py
--- Python-2.6.2/Lib/plat-haiku1/IN.py 1970-01-01 00:00:00.000000000 +0000
+++ Python-2.6.2-haiku/Lib/plat-haiku1/IN.py 2009-05-14 08:56:04.000000000 +0000
@@ -0,0 +1,327 @@
+# Generated by h2py from /boot/develop/headers/be/net/netinet/in.h
+
+# Included from socket.h
+
+# Included from BeBuild.h
+B_BEOS_VERSION_4 = 0x0400
+B_BEOS_VERSION_4_5 = 0x0450
+B_BEOS_VERSION_5 = 0x0500
+B_BEOS_VERSION = B_BEOS_VERSION_5
+B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5
+_PR2_COMPATIBLE_ = 1
+_PR3_COMPATIBLE_ = 1
+_R4_COMPATIBLE_ = 1
+_R4_5_COMPATIBLE_ = 1
+_PR2_COMPATIBLE_ = 0
+_PR3_COMPATIBLE_ = 0
+_R4_COMPATIBLE_ = 1
+_R4_5_COMPATIBLE_ = 1
+def _UNUSED(x): return x
+
+
+# Included from sys/types.h
+
+# Included from time.h
+
+# Included from be_setup.h
+def __std(ref): return ref
+
+__be_os = 2
+__dest_os = __be_os
+__MSL__ = 0x4011
+__GLIBC__ = -2
+__GLIBC_MINOR__ = 1
+
+# Included from null.h
+NULL = (0)
+NULL = 0L
+
+# Included from size_t.h
+
+# Included from stddef.h
+
+# Included from wchar_t.h
+CLOCKS_PER_SEC = 1000
+CLK_TCK = CLOCKS_PER_SEC
+MAX_TIMESTR = 70
+
+# Included from sys/time.h
+
+# Included from ByteOrder.h
+
+# Included from endian.h
+__LITTLE_ENDIAN = 1234
+LITTLE_ENDIAN = __LITTLE_ENDIAN
+__BYTE_ORDER = __LITTLE_ENDIAN
+BYTE_ORDER = __BYTE_ORDER
+__BIG_ENDIAN = 0
+BIG_ENDIAN = 0
+__BIG_ENDIAN = 4321
+BIG_ENDIAN = __BIG_ENDIAN
+__BYTE_ORDER = __BIG_ENDIAN
+BYTE_ORDER = __BYTE_ORDER
+__LITTLE_ENDIAN = 0
+LITTLE_ENDIAN = 0
+__PDP_ENDIAN = 3412
+PDP_ENDIAN = __PDP_ENDIAN
+
+# Included from SupportDefs.h
+
+# Included from Errors.h
+
+# Included from limits.h
+
+# Included from float.h
+FLT_ROUNDS = 1
+FLT_RADIX = 2
+FLT_MANT_DIG = 24
+FLT_DIG = 6
+FLT_MIN_EXP = (-125)
+FLT_MIN_10_EXP = (-37)
+FLT_MAX_EXP = 128
+FLT_MAX_10_EXP = 38
+DBL_MANT_DIG = 53
+DBL_DIG = 15
+DBL_MIN_EXP = (-1021)
+DBL_MIN_10_EXP = (-308)
+DBL_MAX_EXP = 1024
+DBL_MAX_10_EXP = 308
+LDBL_MANT_DIG = DBL_MANT_DIG
+LDBL_DIG = DBL_DIG
+LDBL_MIN_EXP = DBL_MIN_EXP
+LDBL_MIN_10_EXP = DBL_MIN_10_EXP
+LDBL_MAX_EXP = DBL_MAX_EXP
+LDBL_MAX_10_EXP = DBL_MAX_10_EXP
+CHAR_BIT = (8)
+SCHAR_MIN = (-127-1)
+SCHAR_MAX = (127)
+CHAR_MIN = SCHAR_MIN
+CHAR_MAX = SCHAR_MAX
+MB_LEN_MAX = (1)
+SHRT_MIN = (-32767-1)
+SHRT_MAX = (32767)
+LONG_MIN = (-2147483647L-1)
+LONG_MAX = (2147483647L)
+INT_MIN = LONG_MIN
+INT_MAX = LONG_MAX
+ARG_MAX = (32768)
+ATEXIT_MAX = (32)
+CHILD_MAX = (1024)
+IOV_MAX = (256)
+FILESIZEBITS = (64)
+LINK_MAX = (1)
+LOGIN_NAME_MAX = (32)
+MAX_CANON = (255)
+MAX_INPUT = (255)
+NAME_MAX = (256)
+NGROUPS_MAX = (32)
+OPEN_MAX = (128)
+PATH_MAX = (1024)
+PIPE_MAX = (512)
+SSIZE_MAX = (2147483647L)
+TTY_NAME_MAX = (256)
+TZNAME_MAX = (32)
+SYMLINKS_MAX = (16)
+_POSIX_ARG_MAX = (32768)
+_POSIX_CHILD_MAX = (1024)
+_POSIX_LINK_MAX = (1)
+_POSIX_LOGIN_NAME_MAX = (9)
+_POSIX_MAX_CANON = (255)
+_POSIX_MAX_INPUT = (255)
+_POSIX_NAME_MAX = (255)
+_POSIX_NGROUPS_MAX = (0)
+_POSIX_OPEN_MAX = (128)
+_POSIX_PATH_MAX = (1024)
+_POSIX_PIPE_BUF = (512)
+_POSIX_SSIZE_MAX = (2147483647L)
+_POSIX_STREAM_MAX = (8)
+_POSIX_TTY_NAME_MAX = (256)
+_POSIX_TZNAME_MAX = (3)
+B_GENERAL_ERROR_BASE = LONG_MIN
+B_OS_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x1000
+B_APP_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x2000
+B_INTERFACE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x3000
+B_MEDIA_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4000
+B_TRANSLATION_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4800
+B_MIDI_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x5000
+B_STORAGE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x6000
+B_POSIX_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x7000
+B_MAIL_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x8000
+B_PRINT_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x9000
+B_DEVICE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0xa000
+B_ERRORS_END = (B_GENERAL_ERROR_BASE + 0xffff)
+E2BIG = (B_POSIX_ERROR_BASE + 1)
+ECHILD = (B_POSIX_ERROR_BASE + 2)
+EDEADLK = (B_POSIX_ERROR_BASE + 3)
+EFBIG = (B_POSIX_ERROR_BASE + 4)
+EMLINK = (B_POSIX_ERROR_BASE + 5)
+ENFILE = (B_POSIX_ERROR_BASE + 6)
+ENODEV = (B_POSIX_ERROR_BASE + 7)
+ENOLCK = (B_POSIX_ERROR_BASE + 8)
+ENOSYS = (B_POSIX_ERROR_BASE + 9)
+ENOTTY = (B_POSIX_ERROR_BASE + 10)
+ENXIO = (B_POSIX_ERROR_BASE + 11)
+ESPIPE = (B_POSIX_ERROR_BASE + 12)
+ESRCH = (B_POSIX_ERROR_BASE + 13)
+EFPOS = (B_POSIX_ERROR_BASE + 14)
+ESIGPARM = (B_POSIX_ERROR_BASE + 15)
+EDOM = (B_POSIX_ERROR_BASE + 16)
+ERANGE = (B_POSIX_ERROR_BASE + 17)
+EPROTOTYPE = (B_POSIX_ERROR_BASE + 18)
+EPROTONOSUPPORT = (B_POSIX_ERROR_BASE + 19)
+EPFNOSUPPORT = (B_POSIX_ERROR_BASE + 20)
+EAFNOSUPPORT = (B_POSIX_ERROR_BASE + 21)
+EADDRINUSE = (B_POSIX_ERROR_BASE + 22)
+EADDRNOTAVAIL = (B_POSIX_ERROR_BASE + 23)
+ENETDOWN = (B_POSIX_ERROR_BASE + 24)
+ENETUNREACH = (B_POSIX_ERROR_BASE + 25)
+ENETRESET = (B_POSIX_ERROR_BASE + 26)
+ECONNABORTED = (B_POSIX_ERROR_BASE + 27)
+ECONNRESET = (B_POSIX_ERROR_BASE + 28)
+EISCONN = (B_POSIX_ERROR_BASE + 29)
+ENOTCONN = (B_POSIX_ERROR_BASE + 30)
+ESHUTDOWN = (B_POSIX_ERROR_BASE + 31)
+ECONNREFUSED = (B_POSIX_ERROR_BASE + 32)
+EHOSTUNREACH = (B_POSIX_ERROR_BASE + 33)
+ENOPROTOOPT = (B_POSIX_ERROR_BASE + 34)
+ENOBUFS = (B_POSIX_ERROR_BASE + 35)
+EINPROGRESS = (B_POSIX_ERROR_BASE + 36)
+EALREADY = (B_POSIX_ERROR_BASE + 37)
+EILSEQ = (B_POSIX_ERROR_BASE + 38)
+ENOMSG = (B_POSIX_ERROR_BASE + 39)
+ESTALE = (B_POSIX_ERROR_BASE + 40)
+EOVERFLOW = (B_POSIX_ERROR_BASE + 41)
+EMSGSIZE = (B_POSIX_ERROR_BASE + 42)
+EOPNOTSUPP = (B_POSIX_ERROR_BASE + 43)
+ENOTSOCK = (B_POSIX_ERROR_BASE + 44)
+false = 0
+true = 1
+NULL = (0)
+FALSE = 0
+TRUE = 1
+
+# Included from TypeConstants.h
+B_HOST_IS_LENDIAN = 1
+B_HOST_IS_BENDIAN = 0
+def B_HOST_TO_LENDIAN_DOUBLE(arg): return (double)(arg)
+
+def B_HOST_TO_LENDIAN_FLOAT(arg): return (float)(arg)
+
+def B_HOST_TO_LENDIAN_INT64(arg): return (uint64)(arg)
+
+def B_HOST_TO_LENDIAN_INT32(arg): return (uint32)(arg)
+
+def B_HOST_TO_LENDIAN_INT16(arg): return (uint16)(arg)
+
+def B_HOST_TO_BENDIAN_DOUBLE(arg): return __swap_double(arg)
+
+def B_HOST_TO_BENDIAN_FLOAT(arg): return __swap_float(arg)
+
+def B_HOST_TO_BENDIAN_INT64(arg): return __swap_int64(arg)
+
+def B_HOST_TO_BENDIAN_INT32(arg): return __swap_int32(arg)
+
+def B_HOST_TO_BENDIAN_INT16(arg): return __swap_int16(arg)
+
+def B_LENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
+
+def B_LENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
+
+def B_LENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
+
+def B_LENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
+
+def B_LENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
+
+def B_BENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
+
+def B_BENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
+
+def B_BENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
+
+def B_BENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
+
+def B_BENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
+
+B_HOST_IS_LENDIAN = 0
+B_HOST_IS_BENDIAN = 1
+def B_HOST_TO_LENDIAN_DOUBLE(arg): return __swap_double(arg)
+
+def B_HOST_TO_LENDIAN_FLOAT(arg): return __swap_float(arg)
+
+def B_HOST_TO_LENDIAN_INT64(arg): return __swap_int64(arg)
+
+def B_HOST_TO_LENDIAN_INT32(arg): return __swap_int32(arg)
+
+def B_HOST_TO_LENDIAN_INT16(arg): return __swap_int16(arg)
+
+def B_HOST_TO_BENDIAN_DOUBLE(arg): return (double)(arg)
+
+def B_HOST_TO_BENDIAN_FLOAT(arg): return (float)(arg)
+
+def B_HOST_TO_BENDIAN_INT64(arg): return (uint64)(arg)
+
+def B_HOST_TO_BENDIAN_INT32(arg): return (uint32)(arg)
+
+def B_HOST_TO_BENDIAN_INT16(arg): return (uint16)(arg)
+
+def B_LENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
+
+def B_LENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
+
+def B_LENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
+
+def B_LENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
+
+def B_LENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
+
+def B_BENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
+
+def B_BENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
+
+def B_BENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
+
+def B_BENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
+
+def B_BENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
+
+def B_SWAP_DOUBLE(arg): return __swap_double(arg)
+
+def B_SWAP_FLOAT(arg): return __swap_float(arg)
+
+def B_SWAP_INT64(arg): return __swap_int64(arg)
+
+def B_SWAP_INT32(arg): return __swap_int32(arg)
+
+def B_SWAP_INT16(arg): return __swap_int16(arg)
+
+def htonl(x): return B_HOST_TO_BENDIAN_INT32(x)
+
+def ntohl(x): return B_BENDIAN_TO_HOST_INT32(x)
+
+def htons(x): return B_HOST_TO_BENDIAN_INT16(x)
+
+def ntohs(x): return B_BENDIAN_TO_HOST_INT16(x)
+
+AF_INET = 1
+INADDR_ANY = 0x00000000
+INADDR_BROADCAST = 0xffffffff
+INADDR_LOOPBACK = 0x7f000001
+SOL_SOCKET = 1
+SO_DEBUG = 1
+SO_REUSEADDR = 2
+SO_NONBLOCK = 3
+SO_REUSEPORT = 4
+MSG_OOB = 0x1
+SOCK_DGRAM = 1
+SOCK_STREAM = 2
+IPPROTO_UDP = 1
+IPPROTO_TCP = 2
+IPPROTO_ICMP = 3
+B_UDP_MAX_SIZE = (65536 - 1024)
+FD_SETSIZE = 256
+FDSETSIZE = FD_SETSIZE
+NFDBITS = 32
+def _FDMSKNO(fd): return ((fd) / NFDBITS)
+
+def _FDBITNO(fd): return ((fd) % NFDBITS)
diff -urN Python-2.6.2/Lib/plat-haiku1/regen Python-2.6.2-haiku/Lib/plat-haiku1/regen
--- Python-2.6.2/Lib/plat-haiku1/regen 1970-01-01 00:00:00.000000000 +0000
+++ Python-2.6.2-haiku/Lib/plat-haiku1/regen 2009-05-14 08:56:04.000000000 +0000
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+H2PY=../../Tools/scripts/h2py.py
+HEADERS=/boot/develop/headers
+
+set -v
+python $H2PY -i '(u_long)' $HEADERS/posix/netinet/in.h
diff -urN Python-2.6.2/Modules/resource.c Python-2.6.2-haiku/Modules/resource.c
--- Python-2.6.2/Modules/resource.c 2009-05-14 08:59:56.000000000 +0000
+++ Python-2.6.2-haiku/Modules/resource.c 2009-05-14 08:56:28.000000000 +0000
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,6 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
diff -urN Python-2.6.2/Modules/socketmodule.c Python-2.6.2-haiku/Modules/socketmodule.c
--- Python-2.6.2/Modules/socketmodule.c 2009-05-14 08:59:52.000000000 +0000
+++ Python-2.6.2-haiku/Modules/socketmodule.c 2009-05-14 08:56:28.000000000 +0000
@@ -4637,7 +4637,9 @@
#ifndef __BEOS__
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
+#ifndef __HAIKU__
PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+#endif
#if defined(SOCK_RDM)
PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
#endif
diff -urN Python-2.6.2/Modules/socketmodule.h Python-2.6.2-haiku/Modules/socketmodule.h
--- Python-2.6.2/Modules/socketmodule.h 2009-05-14 08:59:48.000000000 +0000
+++ Python-2.6.2-haiku/Modules/socketmodule.h 2009-05-14 08:56:28.000000000 +0000
@@ -47,6 +47,10 @@
# undef AF_NETLINK
#endif
+#if defined(__HAIKU__)
+#undef HAVE_BLUETOOTH_BLUETOOTH_H
+#endif
+
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
diff -urN Python-2.6.2/Modules/spwdmodule.c Python-2.6.2-haiku/Modules/spwdmodule.c
--- Python-2.6.2/Modules/spwdmodule.c 2009-05-14 08:59:57.000000000 +0000
+++ Python-2.6.2-haiku/Modules/spwdmodule.c 2009-05-14 08:56:28.000000000 +0000
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN Python-2.6.2/Modules/timemodule.c Python-2.6.2-haiku/Modules/timemodule.c
--- Python-2.6.2/Modules/timemodule.c 2009-05-14 08:59:52.000000000 +0000
+++ Python-2.6.2-haiku/Modules/timemodule.c 2009-05-14 08:56:28.000000000 +0000
@@ -968,11 +968,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
diff -urN Python-2.6.2/Parser/asdl_c.py Python-2.6.2-haiku/Parser/asdl_c.py
--- Python-2.6.2/Parser/asdl_c.py 2009-05-14 08:59:39.000000000 +0000
+++ Python-2.6.2-haiku/Parser/asdl_c.py 2009-05-14 08:56:28.000000000 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
"""Generate C code from an ASDL description."""
# TO DO
diff -urN Python-2.6.2/Tools/scripts/h2py.py Python-2.6.2-haiku/Tools/scripts/h2py.py
--- Python-2.6.2/Tools/scripts/h2py.py 2009-05-14 08:59:42.000000000 +0000
+++ Python-2.6.2-haiku/Tools/scripts/h2py.py 2009-05-14 09:36:12.000000000 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
# Read #define's and translate to Python code.
# Handle #include statements.
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
diff -urN Python-2.6.2/configure.in Python-2.6.2-haiku/configure.in
--- Python-2.6.2/configure.in 2009-05-14 08:59:39.000000000 +0000
+++ Python-2.6.2-haiku/configure.in 2009-05-14 08:56:28.000000000 +0000
@@ -706,7 +706,7 @@
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*)
LDLIBRARY='libpython$(VERSION).so'
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
@@ -784,7 +784,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1681,7 +1681,7 @@
fi
fi
;;
- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
+ Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';;
BSD/OS*/4*) LDSHARED="gcc -shared";;
FreeBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
@@ -1735,7 +1735,7 @@
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
- Linux*|GNU*) CCSHARED="-fPIC";;
+ Linux*|GNU*|Haiku*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
@@ -1768,7 +1768,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|Haiku*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
# -u _PyMac_Error is needed to pull in the mac toolbox glue,
@@ -1887,6 +1887,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -3105,7 +3108,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -urN Python-2.6.2/setup.py Python-2.6.2-haiku/setup.py
--- Python-2.6.2/setup.py 2009-05-14 08:59:40.000000000 +0000
+++ Python-2.6.2-haiku/setup.py 2009-05-14 08:56:29.000000000 +0000
@@ -382,6 +382,9 @@
inc_dirs += ['/system/include', '/atheos/autolnk/include']
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+ if platform == 'haiku1':
+ inc_dirs += ['/boot/develop/headers/posix']
+
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if platform in ['osf1', 'unixware7', 'openunix8']:
lib_dirs += ['/usr/ccs/lib']
@@ -405,7 +408,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -1065,7 +1068,7 @@
missing.append('resource')
# Sun yellow pages. Some systems have the functions in libc.
- if platform not in ['cygwin', 'atheos', 'qnx6']:
+ if platform not in ['cygwin', 'atheos', 'qnx6', 'haiku1']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:

View File

@@ -1,422 +0,0 @@
Index: configure.in
===================================================================
--- configure.in (revision 68649)
+++ configure.in (working copy)
@@ -691,7 +691,7 @@
if test $enable_shared = "yes"; then
AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
case $ac_sys_system in
- BeOS*)
+ BeOS*|Haiku*)
LDLIBRARY='libpython$(VERSION).so'
;;
CYGWIN*)
@@ -704,7 +704,7 @@
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*)
LDLIBRARY='libpython$(VERSION).so'
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
@@ -782,7 +782,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1679,7 +1679,7 @@
fi
fi
;;
- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
+ Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';;
BSD/OS*/4*) LDSHARED="gcc -shared";;
FreeBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
@@ -1733,7 +1733,7 @@
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
- Linux*|GNU*) CCSHARED="-fPIC";;
+ Linux*|GNU*|Haiku*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
@@ -1766,7 +1766,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|Haiku*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
# -u _PyMac_Error is needed to pull in the mac toolbox glue,
@@ -1885,6 +1885,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -3103,8 +3106,8 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
-*) LIBM=-lm
+BeOS|Haiku*) ;;
+*) LIBM=
esac
AC_MSG_CHECKING(for --with-libm=STRING)
AC_ARG_WITH(libm,
Index: setup.py
===================================================================
--- setup.py (revision 68649)
+++ setup.py (working copy)
@@ -383,6 +383,9 @@
inc_dirs += ['/system/include', '/atheos/autolnk/include']
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+ if platform == 'haiku1':
+ inc_dirs += ['/boot/develop/headers/posix']
+
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if platform in ['osf1', 'unixware7', 'openunix8']:
lib_dirs += ['/usr/ccs/lib']
@@ -406,7 +409,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -1065,7 +1068,7 @@
missing.append('resource')
# Sun yellow pages. Some systems have the functions in libc.
- if platform not in ['cygwin', 'atheos', 'qnx6']:
+ if platform not in ['cygwin', 'atheos', 'qnx6', 'haiku1']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:
Index: Parser/asdl_c.py
===================================================================
--- Parser/asdl_c.py (revision 68649)
+++ Parser/asdl_c.py (working copy)
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
"""Generate C code from an ASDL description."""
# TO DO
Index: Tools/scripts/h2py.py
===================================================================
--- Tools/scripts/h2py.py (revision 68649)
+++ Tools/scripts/h2py.py (working copy)
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
# Read #define's and translate to Python code.
# Handle #include statements.
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
Index: Modules/_ctypes/libffi/config.guess
===================================================================
--- Modules/_ctypes/libffi/config.guess (revision 68649)
+++ Modules/_ctypes/libffi/config.guess (working copy)
@@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
-timestamp='2007-05-17'
+timestamp='2008-01-08'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -56,8 +56,8 @@
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -330,7 +330,7 @@
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
- i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*)
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
@@ -532,7 +532,7 @@
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[45])
+ *:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -793,12 +793,15 @@
exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
- x86)
+ x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
@@ -833,7 +836,14 @@
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -954,8 +964,8 @@
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
- xtensa:Linux:*:*)
- echo xtensa-unknown-linux-gnu
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
@@ -1206,6 +1216,12 @@
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
+ BeMac:Haiku:*:*)
+ echo powerpc-apple-haiku
+ exit ;;
+ BePC:Haiku:*:*)
+ echo i586-pc-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
Index: Modules/_ctypes/libffi/config.sub
===================================================================
--- Modules/_ctypes/libffi/config.sub (revision 68649)
+++ Modules/_ctypes/libffi/config.sub (working copy)
@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
-timestamp='2007-04-29'
+timestamp='2008-01-16'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -72,8 +72,8 @@
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -369,10 +369,14 @@
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa-* \
+ | xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-*)
;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
@@ -443,6 +447,14 @@
basic_machine=ns32k-sequent
os=-dynix
;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
@@ -475,8 +487,8 @@
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16c)
- basic_machine=cr16c-unknown
+ cr16)
+ basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
@@ -668,6 +680,14 @@
basic_machine=m68k-isi
os=-sysv
;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
m88k-omron*)
basic_machine=m88k-omron
;;
@@ -813,6 +833,14 @@
basic_machine=i860-intel
os=-osf
;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
pbd)
basic_machine=sparc-tti
;;
@@ -1021,6 +1049,10 @@
basic_machine=tic6x-unknown
os=-coff
;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
Index: Modules/timemodule.c
===================================================================
--- Modules/timemodule.c (revision 68649)
+++ Modules/timemodule.c (working copy)
@@ -968,11 +968,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
Index: Modules/resource.c
===================================================================
--- Modules/resource.c (revision 68649)
+++ Modules/resource.c (working copy)
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,6 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
Index: Modules/socketmodule.c
===================================================================
--- Modules/socketmodule.c (revision 68649)
+++ Modules/socketmodule.c (working copy)
@@ -4637,7 +4637,9 @@
#ifndef __BEOS__
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
+#ifndef __HAIKU__
PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+#endif
#if defined(SOCK_RDM)
PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
#endif
Index: Modules/spwdmodule.c
===================================================================
--- Modules/spwdmodule.c (revision 68649)
+++ Modules/spwdmodule.c (working copy)
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);

View File

@@ -1,537 +0,0 @@
diff -urN python/Lib/plat-haiku1/IN.py python-haiku/Lib/plat-haiku1/IN.py
--- python/Lib/plat-haiku1/IN.py 1970-01-01 00:00:00.000000000 +0000
+++ python-haiku/Lib/plat-haiku1/IN.py 2009-01-19 14:03:47.000000000 +0000
@@ -0,0 +1,327 @@
+# Generated by h2py from /boot/develop/headers/be/net/netinet/in.h
+
+# Included from socket.h
+
+# Included from BeBuild.h
+B_BEOS_VERSION_4 = 0x0400
+B_BEOS_VERSION_4_5 = 0x0450
+B_BEOS_VERSION_5 = 0x0500
+B_BEOS_VERSION = B_BEOS_VERSION_5
+B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5
+_PR2_COMPATIBLE_ = 1
+_PR3_COMPATIBLE_ = 1
+_R4_COMPATIBLE_ = 1
+_R4_5_COMPATIBLE_ = 1
+_PR2_COMPATIBLE_ = 0
+_PR3_COMPATIBLE_ = 0
+_R4_COMPATIBLE_ = 1
+_R4_5_COMPATIBLE_ = 1
+def _UNUSED(x): return x
+
+
+# Included from sys/types.h
+
+# Included from time.h
+
+# Included from be_setup.h
+def __std(ref): return ref
+
+__be_os = 2
+__dest_os = __be_os
+__MSL__ = 0x4011
+__GLIBC__ = -2
+__GLIBC_MINOR__ = 1
+
+# Included from null.h
+NULL = (0)
+NULL = 0L
+
+# Included from size_t.h
+
+# Included from stddef.h
+
+# Included from wchar_t.h
+CLOCKS_PER_SEC = 1000
+CLK_TCK = CLOCKS_PER_SEC
+MAX_TIMESTR = 70
+
+# Included from sys/time.h
+
+# Included from ByteOrder.h
+
+# Included from endian.h
+__LITTLE_ENDIAN = 1234
+LITTLE_ENDIAN = __LITTLE_ENDIAN
+__BYTE_ORDER = __LITTLE_ENDIAN
+BYTE_ORDER = __BYTE_ORDER
+__BIG_ENDIAN = 0
+BIG_ENDIAN = 0
+__BIG_ENDIAN = 4321
+BIG_ENDIAN = __BIG_ENDIAN
+__BYTE_ORDER = __BIG_ENDIAN
+BYTE_ORDER = __BYTE_ORDER
+__LITTLE_ENDIAN = 0
+LITTLE_ENDIAN = 0
+__PDP_ENDIAN = 3412
+PDP_ENDIAN = __PDP_ENDIAN
+
+# Included from SupportDefs.h
+
+# Included from Errors.h
+
+# Included from limits.h
+
+# Included from float.h
+FLT_ROUNDS = 1
+FLT_RADIX = 2
+FLT_MANT_DIG = 24
+FLT_DIG = 6
+FLT_MIN_EXP = (-125)
+FLT_MIN_10_EXP = (-37)
+FLT_MAX_EXP = 128
+FLT_MAX_10_EXP = 38
+DBL_MANT_DIG = 53
+DBL_DIG = 15
+DBL_MIN_EXP = (-1021)
+DBL_MIN_10_EXP = (-308)
+DBL_MAX_EXP = 1024
+DBL_MAX_10_EXP = 308
+LDBL_MANT_DIG = DBL_MANT_DIG
+LDBL_DIG = DBL_DIG
+LDBL_MIN_EXP = DBL_MIN_EXP
+LDBL_MIN_10_EXP = DBL_MIN_10_EXP
+LDBL_MAX_EXP = DBL_MAX_EXP
+LDBL_MAX_10_EXP = DBL_MAX_10_EXP
+CHAR_BIT = (8)
+SCHAR_MIN = (-127-1)
+SCHAR_MAX = (127)
+CHAR_MIN = SCHAR_MIN
+CHAR_MAX = SCHAR_MAX
+MB_LEN_MAX = (1)
+SHRT_MIN = (-32767-1)
+SHRT_MAX = (32767)
+LONG_MIN = (-2147483647L-1)
+LONG_MAX = (2147483647L)
+INT_MIN = LONG_MIN
+INT_MAX = LONG_MAX
+ARG_MAX = (32768)
+ATEXIT_MAX = (32)
+CHILD_MAX = (1024)
+IOV_MAX = (256)
+FILESIZEBITS = (64)
+LINK_MAX = (1)
+LOGIN_NAME_MAX = (32)
+MAX_CANON = (255)
+MAX_INPUT = (255)
+NAME_MAX = (256)
+NGROUPS_MAX = (32)
+OPEN_MAX = (128)
+PATH_MAX = (1024)
+PIPE_MAX = (512)
+SSIZE_MAX = (2147483647L)
+TTY_NAME_MAX = (256)
+TZNAME_MAX = (32)
+SYMLINKS_MAX = (16)
+_POSIX_ARG_MAX = (32768)
+_POSIX_CHILD_MAX = (1024)
+_POSIX_LINK_MAX = (1)
+_POSIX_LOGIN_NAME_MAX = (9)
+_POSIX_MAX_CANON = (255)
+_POSIX_MAX_INPUT = (255)
+_POSIX_NAME_MAX = (255)
+_POSIX_NGROUPS_MAX = (0)
+_POSIX_OPEN_MAX = (128)
+_POSIX_PATH_MAX = (1024)
+_POSIX_PIPE_BUF = (512)
+_POSIX_SSIZE_MAX = (2147483647L)
+_POSIX_STREAM_MAX = (8)
+_POSIX_TTY_NAME_MAX = (256)
+_POSIX_TZNAME_MAX = (3)
+B_GENERAL_ERROR_BASE = LONG_MIN
+B_OS_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x1000
+B_APP_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x2000
+B_INTERFACE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x3000
+B_MEDIA_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4000
+B_TRANSLATION_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4800
+B_MIDI_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x5000
+B_STORAGE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x6000
+B_POSIX_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x7000
+B_MAIL_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x8000
+B_PRINT_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x9000
+B_DEVICE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0xa000
+B_ERRORS_END = (B_GENERAL_ERROR_BASE + 0xffff)
+E2BIG = (B_POSIX_ERROR_BASE + 1)
+ECHILD = (B_POSIX_ERROR_BASE + 2)
+EDEADLK = (B_POSIX_ERROR_BASE + 3)
+EFBIG = (B_POSIX_ERROR_BASE + 4)
+EMLINK = (B_POSIX_ERROR_BASE + 5)
+ENFILE = (B_POSIX_ERROR_BASE + 6)
+ENODEV = (B_POSIX_ERROR_BASE + 7)
+ENOLCK = (B_POSIX_ERROR_BASE + 8)
+ENOSYS = (B_POSIX_ERROR_BASE + 9)
+ENOTTY = (B_POSIX_ERROR_BASE + 10)
+ENXIO = (B_POSIX_ERROR_BASE + 11)
+ESPIPE = (B_POSIX_ERROR_BASE + 12)
+ESRCH = (B_POSIX_ERROR_BASE + 13)
+EFPOS = (B_POSIX_ERROR_BASE + 14)
+ESIGPARM = (B_POSIX_ERROR_BASE + 15)
+EDOM = (B_POSIX_ERROR_BASE + 16)
+ERANGE = (B_POSIX_ERROR_BASE + 17)
+EPROTOTYPE = (B_POSIX_ERROR_BASE + 18)
+EPROTONOSUPPORT = (B_POSIX_ERROR_BASE + 19)
+EPFNOSUPPORT = (B_POSIX_ERROR_BASE + 20)
+EAFNOSUPPORT = (B_POSIX_ERROR_BASE + 21)
+EADDRINUSE = (B_POSIX_ERROR_BASE + 22)
+EADDRNOTAVAIL = (B_POSIX_ERROR_BASE + 23)
+ENETDOWN = (B_POSIX_ERROR_BASE + 24)
+ENETUNREACH = (B_POSIX_ERROR_BASE + 25)
+ENETRESET = (B_POSIX_ERROR_BASE + 26)
+ECONNABORTED = (B_POSIX_ERROR_BASE + 27)
+ECONNRESET = (B_POSIX_ERROR_BASE + 28)
+EISCONN = (B_POSIX_ERROR_BASE + 29)
+ENOTCONN = (B_POSIX_ERROR_BASE + 30)
+ESHUTDOWN = (B_POSIX_ERROR_BASE + 31)
+ECONNREFUSED = (B_POSIX_ERROR_BASE + 32)
+EHOSTUNREACH = (B_POSIX_ERROR_BASE + 33)
+ENOPROTOOPT = (B_POSIX_ERROR_BASE + 34)
+ENOBUFS = (B_POSIX_ERROR_BASE + 35)
+EINPROGRESS = (B_POSIX_ERROR_BASE + 36)
+EALREADY = (B_POSIX_ERROR_BASE + 37)
+EILSEQ = (B_POSIX_ERROR_BASE + 38)
+ENOMSG = (B_POSIX_ERROR_BASE + 39)
+ESTALE = (B_POSIX_ERROR_BASE + 40)
+EOVERFLOW = (B_POSIX_ERROR_BASE + 41)
+EMSGSIZE = (B_POSIX_ERROR_BASE + 42)
+EOPNOTSUPP = (B_POSIX_ERROR_BASE + 43)
+ENOTSOCK = (B_POSIX_ERROR_BASE + 44)
+false = 0
+true = 1
+NULL = (0)
+FALSE = 0
+TRUE = 1
+
+# Included from TypeConstants.h
+B_HOST_IS_LENDIAN = 1
+B_HOST_IS_BENDIAN = 0
+def B_HOST_TO_LENDIAN_DOUBLE(arg): return (double)(arg)
+
+def B_HOST_TO_LENDIAN_FLOAT(arg): return (float)(arg)
+
+def B_HOST_TO_LENDIAN_INT64(arg): return (uint64)(arg)
+
+def B_HOST_TO_LENDIAN_INT32(arg): return (uint32)(arg)
+
+def B_HOST_TO_LENDIAN_INT16(arg): return (uint16)(arg)
+
+def B_HOST_TO_BENDIAN_DOUBLE(arg): return __swap_double(arg)
+
+def B_HOST_TO_BENDIAN_FLOAT(arg): return __swap_float(arg)
+
+def B_HOST_TO_BENDIAN_INT64(arg): return __swap_int64(arg)
+
+def B_HOST_TO_BENDIAN_INT32(arg): return __swap_int32(arg)
+
+def B_HOST_TO_BENDIAN_INT16(arg): return __swap_int16(arg)
+
+def B_LENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
+
+def B_LENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
+
+def B_LENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
+
+def B_LENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
+
+def B_LENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
+
+def B_BENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
+
+def B_BENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
+
+def B_BENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
+
+def B_BENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
+
+def B_BENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
+
+B_HOST_IS_LENDIAN = 0
+B_HOST_IS_BENDIAN = 1
+def B_HOST_TO_LENDIAN_DOUBLE(arg): return __swap_double(arg)
+
+def B_HOST_TO_LENDIAN_FLOAT(arg): return __swap_float(arg)
+
+def B_HOST_TO_LENDIAN_INT64(arg): return __swap_int64(arg)
+
+def B_HOST_TO_LENDIAN_INT32(arg): return __swap_int32(arg)
+
+def B_HOST_TO_LENDIAN_INT16(arg): return __swap_int16(arg)
+
+def B_HOST_TO_BENDIAN_DOUBLE(arg): return (double)(arg)
+
+def B_HOST_TO_BENDIAN_FLOAT(arg): return (float)(arg)
+
+def B_HOST_TO_BENDIAN_INT64(arg): return (uint64)(arg)
+
+def B_HOST_TO_BENDIAN_INT32(arg): return (uint32)(arg)
+
+def B_HOST_TO_BENDIAN_INT16(arg): return (uint16)(arg)
+
+def B_LENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
+
+def B_LENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
+
+def B_LENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
+
+def B_LENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
+
+def B_LENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
+
+def B_BENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
+
+def B_BENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
+
+def B_BENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
+
+def B_BENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
+
+def B_BENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
+
+def B_SWAP_DOUBLE(arg): return __swap_double(arg)
+
+def B_SWAP_FLOAT(arg): return __swap_float(arg)
+
+def B_SWAP_INT64(arg): return __swap_int64(arg)
+
+def B_SWAP_INT32(arg): return __swap_int32(arg)
+
+def B_SWAP_INT16(arg): return __swap_int16(arg)
+
+def htonl(x): return B_HOST_TO_BENDIAN_INT32(x)
+
+def ntohl(x): return B_BENDIAN_TO_HOST_INT32(x)
+
+def htons(x): return B_HOST_TO_BENDIAN_INT16(x)
+
+def ntohs(x): return B_BENDIAN_TO_HOST_INT16(x)
+
+AF_INET = 1
+INADDR_ANY = 0x00000000
+INADDR_BROADCAST = 0xffffffff
+INADDR_LOOPBACK = 0x7f000001
+SOL_SOCKET = 1
+SO_DEBUG = 1
+SO_REUSEADDR = 2
+SO_NONBLOCK = 3
+SO_REUSEPORT = 4
+MSG_OOB = 0x1
+SOCK_DGRAM = 1
+SOCK_STREAM = 2
+IPPROTO_UDP = 1
+IPPROTO_TCP = 2
+IPPROTO_ICMP = 3
+B_UDP_MAX_SIZE = (65536 - 1024)
+FD_SETSIZE = 256
+FDSETSIZE = FD_SETSIZE
+NFDBITS = 32
+def _FDMSKNO(fd): return ((fd) / NFDBITS)
+
+def _FDBITNO(fd): return ((fd) % NFDBITS)
diff -urN python/Lib/plat-haiku1/regen python-haiku/Lib/plat-haiku1/regen
--- python/Lib/plat-haiku1/regen 1970-01-01 00:00:00.000000000 +0000
+++ python-haiku/Lib/plat-haiku1/regen 2009-01-19 14:03:47.000000000 +0000
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+H2PY=../../Tools/scripts/h2py.py
+HEADERS=/boot/develop/headers
+
+set -v
+python $H2PY -i '(u_long)' $HEADERS/posix/netinet/in.h
diff -urN python/Modules/resource.c python-haiku/Modules/resource.c
--- python/Modules/resource.c 2009-01-17 05:42:58.000000000 +0000
+++ python-haiku/Modules/resource.c 2009-01-19 14:03:47.000000000 +0000
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,6 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
diff -urN python/Modules/socketmodule.c python-haiku/Modules/socketmodule.c
--- python/Modules/socketmodule.c 2009-01-17 05:42:58.000000000 +0000
+++ python-haiku/Modules/socketmodule.c 2009-01-19 14:03:47.000000000 +0000
@@ -4637,7 +4637,9 @@
#ifndef __BEOS__
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
+#ifndef __HAIKU__
PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+#endif
#if defined(SOCK_RDM)
PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
#endif
diff -urN python/Modules/socketmodule.h python-haiku/Modules/socketmodule.h
--- python/Modules/socketmodule.h 2009-01-17 05:42:58.000000000 +0000
+++ python-haiku/Modules/socketmodule.h 2009-01-19 14:03:47.000000000 +0000
@@ -47,6 +47,10 @@
# undef AF_NETLINK
#endif
+#if defined(__HAIKU__)
+#undef HAVE_BLUETOOTH_BLUETOOTH_H
+#endif
+
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
diff -urN python/Modules/spwdmodule.c python-haiku/Modules/spwdmodule.c
--- python/Modules/spwdmodule.c 2009-01-17 05:42:58.000000000 +0000
+++ python-haiku/Modules/spwdmodule.c 2009-01-19 14:03:47.000000000 +0000
@@ -79,7 +79,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN python/Modules/timemodule.c python-haiku/Modules/timemodule.c
--- python/Modules/timemodule.c 2009-01-17 05:42:58.000000000 +0000
+++ python-haiku/Modules/timemodule.c 2009-01-19 14:03:47.000000000 +0000
@@ -968,11 +968,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
diff -urN python/Parser/asdl_c.py python-haiku/Parser/asdl_c.py
--- python/Parser/asdl_c.py 2009-01-17 05:36:36.000000000 +0000
+++ python-haiku/Parser/asdl_c.py 2009-01-18 02:28:40.000000000 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
"""Generate C code from an ASDL description."""
# TO DO
diff -urN python/Tools/scripts/h2py.py python-haiku/Tools/scripts/h2py.py
--- python/Tools/scripts/h2py.py 2009-01-17 05:37:37.000000000 +0000
+++ python-haiku/Tools/scripts/h2py.py 2009-01-19 14:03:47.000000000 +0000
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
diff -urN python/configure.in python-haiku/configure.in
--- python/configure.in 2009-01-17 05:42:58.000000000 +0000
+++ python-haiku/configure.in 2009-01-19 14:03:47.000000000 +0000
@@ -704,7 +704,7 @@
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*)
LDLIBRARY='libpython$(VERSION).so'
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
@@ -782,7 +782,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1679,7 +1679,7 @@
fi
fi
;;
- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
+ Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';;
BSD/OS*/4*) LDSHARED="gcc -shared";;
FreeBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
@@ -1733,7 +1733,7 @@
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
- Linux*|GNU*) CCSHARED="-fPIC";;
+ Linux*|GNU*|Haiku*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
@@ -1766,7 +1766,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|Haiku*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
# -u _PyMac_Error is needed to pull in the mac toolbox glue,
@@ -1885,6 +1885,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -3103,7 +3106,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -urN python/setup.py python-haiku/setup.py
--- python/setup.py 2009-01-17 05:42:58.000000000 +0000
+++ python-haiku/setup.py 2009-01-19 14:03:47.000000000 +0000
@@ -383,6 +383,9 @@
inc_dirs += ['/system/include', '/atheos/autolnk/include']
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+ if platform == 'haiku1':
+ inc_dirs += ['/boot/develop/headers/posix']
+
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if platform in ['osf1', 'unixware7', 'openunix8']:
lib_dirs += ['/usr/ccs/lib']
@@ -406,7 +409,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -1065,7 +1068,7 @@
missing.append('resource')
# Sun yellow pages. Some systems have the functions in libc.
- if platform not in ['cygwin', 'atheos', 'qnx6']:
+ if platform not in ['cygwin', 'atheos', 'qnx6', 'haiku1']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:

View File

@@ -1,20 +0,0 @@
diff -urN Python-3.0rc1/configure.in Python-3.0rc1-haiku/configure.in
--- Python-3.0rc1/configure.in 2008-09-07 19:23:19.000000000 +0000
+++ Python-3.0rc1-haiku/configure.in 2008-10-10 12:23:15.000000000 +0000
@@ -230,6 +230,7 @@
case $MACHDEP in
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
+ haiku*) MACHDEP="haiku";;
atheos*) MACHDEP="atheos";;
irix646) MACHDEP="irix6";;
'') MACHDEP="unknown";;
@@ -3009,7 +3010,7 @@
# check for --with-libm=...
AC_SUBST(LIBM)
case $ac_sys_system in
-Darwin) ;;
+Darwin|Haiku*) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)