aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/python26
diff options
context:
space:
mode:
authorCory Fields <theuni-nospam-@xbmc.org>2013-03-08 23:16:23 -0500
committerCory Fields <theuni-nospam-@xbmc.org>2013-03-11 00:16:02 -0400
commit592d4c0b147ab05f2822c7ba5f4e9112784b6ce1 (patch)
tree690a46b49e80cc55c4329d5aebdfea917b0fc800 /tools/depends/target/python26
parentcdf099d0f824a787904d828c5573c70bf8489738 (diff)
depends: add mess of depends
Diffstat (limited to 'tools/depends/target/python26')
-rw-r--r--tools/depends/target/python26/Makefile71
-rw-r--r--tools/depends/target/python26/Python-2.6-ctypes.patch45
-rw-r--r--tools/depends/target/python26/Python-2.6.2-android.patch61
-rw-r--r--tools/depends/target/python26/Python-2.6.5-ffi-static.patch28
-rw-r--r--tools/depends/target/python26/Python-2.6.5-scproxy.patch51
-rw-r--r--tools/depends/target/python26/Python-2.6.5-xcompile.patch301
-rw-r--r--tools/depends/target/python26/Python-no-export-path.patch12
-rw-r--r--tools/depends/target/python26/Python-no-modules.patch12
-rw-r--r--tools/depends/target/python26/modules.setup519
-rw-r--r--tools/depends/target/python26/python-osx-environ-fix.patch25
10 files changed, 1125 insertions, 0 deletions
diff --git a/tools/depends/target/python26/Makefile b/tools/depends/target/python26/Makefile
new file mode 100644
index 0000000000..611ddf2a51
--- /dev/null
+++ b/tools/depends/target/python26/Makefile
@@ -0,0 +1,71 @@
+include ../../Makefile.include
+DEPS= ../../Makefile.include Makefile Python-2.6.2-android.patch \
+ Python-2.6.5-xcompile.patch Python-2.6-ctypes.patch \
+ Python-no-modules.patch Python-no-export-path.patch modules.setup
+
+# lib name, version
+LIBNAME=Python
+VERSION=2.6.5
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+# configuration settings
+CONFIGURE=OPT="$(CFLAGS)" \
+ LIBS=-lm \
+ ./configure --prefix=$(PREFIX) \
+ --disable-toolbox-glue --disable-framework --with-system-ffi \
+
+ifeq ($(OS),ios)
+CONFIGURE+=LDFLAGS="$(LDFLAGS) -miphoneos-version-min=3.0"
+endif
+
+LIBDYLIB=$(PLATFORM)/libpython2.6.a
+
+all: .installed-$(PLATFORM)
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
+ echo $(NATIVEPREFIX)
+ rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
+ cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ cd $(PLATFORM); patch -Np1 -i ../Python-2.6.5-xcompile.patch
+ cd $(PLATFORM); patch -Np1 -i ../Python-2.6.2-android.patch
+ cd $(PLATFORM); patch -p0 < ../Python-no-modules.patch
+ cd $(PLATFORM); patch -p0 < ../Python-no-export-path.patch
+ cd $(PLATFORM); patch -p1 < ../python-osx-environ-fix.patch
+ cd $(PLATFORM); patch -p0 < ../Python-2.6.5-ffi-static.patch
+ifeq ($(OS),ios)
+ cd $(PLATFORM); patch -p0 < ../Python-2.6.5-scproxy.patch
+endif
+ cp modules.setup $(PLATFORM)/Modules/Setup.dist
+
+#Add -liconv as needed, and add the _scproxy module for darwin
+ cd $(PLATFORM); sed -ie 's|_locale _localemodule.c -lintl|_locale _localemodule.c -lintl $(LINK_ICONV) |' Modules/Setup.dist
+ifeq (darwin, $(findstring darwin, $(HOST)))
+ echo "_scproxy \$$(srcdir)/Mac/Modules/_scproxy.c -framework SystemConfiguration -framework CoreFoundation" >> $(PLATFORM)/Modules/Setup.dist
+else
+ cd $(PLATFORM); sed -ie 's|-framework CoreFoundation||' configure.in
+endif
+
+ cd $(PLATFORM); $(AUTORECONF)
+ cd $(PLATFORM); $(CONFIGURE)
+
+$(LIBDYLIB): $(PLATFORM)
+ $(MAKE) -C $(PLATFORM) HOSTPYTHON=$(NATIVEPREFIX)/bin/python HOSTPGEN=$(NATIVEPREFIX)/bin/pgen CROSS_COMPILE_TARGET=yes libpython2.6.a
+ touch $@
+
+.installed-$(PLATFORM): $(LIBDYLIB)
+ make -j1 -C $(PLATFORM) HOSTPYTHON=$(NATIVEPREFIX)/bin/python HOSTPGEN=$(NATIVEPREFIX)/bin/pgen CROSS_COMPILE_TARGET=yes install
+ find $(PREFIX)/lib/python2.6 -type f -name "*.py" -delete
+ find $(PREFIX)/lib/python2.6 -type f -name "*.pyc" -delete
+ #
+ touch $(LIBDYLIB)
+ touch $@
+
+clean:
+ rm -rf $(PLATFORM) .installed-$(PLATFORM)
+
+distclean::
+ rm -rf $(PLATFORM) .installed-$(PLATFORM)
diff --git a/tools/depends/target/python26/Python-2.6-ctypes.patch b/tools/depends/target/python26/Python-2.6-ctypes.patch
new file mode 100644
index 0000000000..647dca800b
--- /dev/null
+++ b/tools/depends/target/python26/Python-2.6-ctypes.patch
@@ -0,0 +1,45 @@
+--- a/Modules/_ctypes/_ctypes.c (revision 74955)
++++ b/Modules/_ctypes/_ctypes.c (working copy)
+@@ -5521,36 +5521,42 @@
+ Struct_Type.tp_base = &CData_Type;
+ if (PyType_Ready(&Struct_Type) < 0)
+ return;
++ Py_INCREF(&Struct_Type);
+ PyModule_AddObject(m, "Structure", (PyObject *)&Struct_Type);
+
+ Py_TYPE(&Union_Type) = &UnionType_Type;
+ Union_Type.tp_base = &CData_Type;
+ if (PyType_Ready(&Union_Type) < 0)
+ return;
++ Py_INCREF(&Union_Type);
+ PyModule_AddObject(m, "Union", (PyObject *)&Union_Type);
+
+ Py_TYPE(&Pointer_Type) = &PointerType_Type;
+ Pointer_Type.tp_base = &CData_Type;
+ if (PyType_Ready(&Pointer_Type) < 0)
+ return;
++ Py_INCREF(&Pointer_Type);
+ PyModule_AddObject(m, "_Pointer", (PyObject *)&Pointer_Type);
+
+ Py_TYPE(&Array_Type) = &ArrayType_Type;
+ Array_Type.tp_base = &CData_Type;
+ if (PyType_Ready(&Array_Type) < 0)
+ return;
++ Py_INCREF(&Array_Type);
+ PyModule_AddObject(m, "Array", (PyObject *)&Array_Type);
+
+ Py_TYPE(&Simple_Type) = &SimpleType_Type;
+ Simple_Type.tp_base = &CData_Type;
+ if (PyType_Ready(&Simple_Type) < 0)
+ return;
++ Py_INCREF(&Simple_Type);
+ PyModule_AddObject(m, "_SimpleCData", (PyObject *)&Simple_Type);
+
+ Py_TYPE(&CFuncPtr_Type) = &CFuncPtrType_Type;
+ CFuncPtr_Type.tp_base = &CData_Type;
+ if (PyType_Ready(&CFuncPtr_Type) < 0)
+ return;
++ Py_INCREF(&CFuncPtr_Type);
+ PyModule_AddObject(m, "CFuncPtr", (PyObject *)&CFuncPtr_Type);
+
+ /*************************************************
diff --git a/tools/depends/target/python26/Python-2.6.2-android.patch b/tools/depends/target/python26/Python-2.6.2-android.patch
new file mode 100644
index 0000000000..fc7117127c
--- /dev/null
+++ b/tools/depends/target/python26/Python-2.6.2-android.patch
@@ -0,0 +1,61 @@
+diff --ignore-file-name-case -wuprN Python-2.6.2/Modules/pwdmodule.c python-src//Modules/pwdmodule.c
+--- Python-2.6.2/Modules/pwdmodule.c 2008-06-09 01:58:54.000000000 -0300
++++ python-src//Modules/pwdmodule.c 2011-01-05 17:09:37.000000000 -0300
+@@ -68,14 +68,14 @@ mkpwent(struct passwd *p)
+ #define SETS(i,val) sets(v, i, val)
+
+ SETS(setIndex++, p->pw_name);
+-#ifdef __VMS
++#if defined(__VMS) || defined(ANDROID)
+ SETS(setIndex++, "");
+ #else
+ SETS(setIndex++, p->pw_passwd);
+ #endif
+ SETI(setIndex++, p->pw_uid);
+ SETI(setIndex++, p->pw_gid);
+-#ifdef __VMS
++#if defined(__VMS) || defined(ANDROID)
+ SETS(setIndex++, "");
+ #else
+ SETS(setIndex++, p->pw_gecos);
+diff --ignore-file-name-case -wuprN Python-2.6.2/Modules/termios.c python-src//Modules/termios.c
+--- Python-2.6.2/Modules/termios.c 2008-06-09 01:58:54.000000000 -0300
++++ python-src//Modules/termios.c 2011-01-05 17:09:37.000000000 -0300
+@@ -227,6 +227,7 @@ termios_tcsendbreak(PyObject *self, PyOb
+ return Py_None;
+ }
+
++#if !defined(ANDROID) // No tcdrain defined for Android.
+ PyDoc_STRVAR(termios_tcdrain__doc__,
+ "tcdrain(fd) -> None\n\
+ \n\
+@@ -246,6 +247,7 @@ termios_tcdrain(PyObject *self, PyObject
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
++#endif
+
+ PyDoc_STRVAR(termios_tcflush__doc__,
+ "tcflush(fd, queue) -> None\n\
+@@ -301,8 +303,10 @@ static PyMethodDef termios_methods[] =
+ METH_VARARGS, termios_tcsetattr__doc__},
+ {"tcsendbreak", termios_tcsendbreak,
+ METH_VARARGS, termios_tcsendbreak__doc__},
++#if !defined(ANDROID)
+ {"tcdrain", termios_tcdrain,
+ METH_VARARGS, termios_tcdrain__doc__},
++#endif
+ {"tcflush", termios_tcflush,
+ METH_VARARGS, termios_tcflush__doc__},
+ {"tcflow", termios_tcflow,
+--- Python-2.6.2/Modules/posixmodule.c 2012-06-20 14:20:07.833441645 -0400
++++ Python-2.6.2/Modules/posixmodule.c 2012-06-20 14:23:03.023441535 -0400
+@@ -3761,7 +3761,7 @@
+ slave_fd = open(slave_name, O_RDWR | O_NOCTTY); /* open slave */
+ if (slave_fd < 0)
+ return posix_error();
+-#if !defined(__CYGWIN__) && !defined(HAVE_DEV_PTC)
++#if !defined(__CYGWIN__) && !defined(HAVE_DEV_PTC) && !defined(ANDROID)
+ ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */
+ ioctl(slave_fd, I_PUSH, "ldterm"); /* push ldterm */
+ #ifndef __hpux
diff --git a/tools/depends/target/python26/Python-2.6.5-ffi-static.patch b/tools/depends/target/python26/Python-2.6.5-ffi-static.patch
new file mode 100644
index 0000000000..188b1f4e5b
--- /dev/null
+++ b/tools/depends/target/python26/Python-2.6.5-ffi-static.patch
@@ -0,0 +1,28 @@
+--- Modules/_ctypes/cfield.c 2013-01-20 19:19:53.000000000 -0500
++++ Modules/_ctypes/cfield.c 2013-01-20 19:34:07.000000000 -0500
+@@ -1743,6 +1743,7 @@
+ */
+
+ /* align and size are bogus for void, but they must not be zero */
++/*
+ ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID };
+
+ ffi_type ffi_type_uint8 = { 1, 1, FFI_TYPE_UINT8 };
+@@ -1759,14 +1760,16 @@
+
+ ffi_type ffi_type_float = { sizeof(float), FLOAT_ALIGN, FFI_TYPE_FLOAT };
+ ffi_type ffi_type_double = { sizeof(double), DOUBLE_ALIGN, FFI_TYPE_DOUBLE };
++*/
+
+ #ifdef ffi_type_longdouble
+ #undef ffi_type_longdouble
+ #endif
+ /* This is already defined on OSX */
++/*
+ ffi_type ffi_type_longdouble = { sizeof(long double), LONGDOUBLE_ALIGN,
+ FFI_TYPE_LONGDOUBLE };
+
+ ffi_type ffi_type_pointer = { sizeof(void *), VOID_P_ALIGN, FFI_TYPE_POINTER };
+-
++*/
+ /*---------------- EOF ----------------*/
diff --git a/tools/depends/target/python26/Python-2.6.5-scproxy.patch b/tools/depends/target/python26/Python-2.6.5-scproxy.patch
new file mode 100644
index 0000000000..8f2974790a
--- /dev/null
+++ b/tools/depends/target/python26/Python-2.6.5-scproxy.patch
@@ -0,0 +1,51 @@
+--- Mac/Modules/_scproxy.c 2009-09-20 15:21:24.000000000 -0400
++++ Mac/Modules/_scproxy.c 2013-01-22 19:40:41.000000000 -0500
+@@ -4,7 +4,6 @@
+ */
+ #include <Python.h>
+ #include <SystemConfiguration/SystemConfiguration.h>
+-
+ static int32_t
+ cfnum_to_int32(CFNumberRef num)
+ {
+@@ -48,6 +47,7 @@
+ static PyObject*
+ get_proxy_settings(PyObject* mod __attribute__((__unused__)))
+ {
++/*
+ CFDictionaryRef proxyDict = NULL;
+ CFNumberRef aNum = NULL;
+ CFArrayRef anArray = NULL;
+@@ -55,7 +55,7 @@
+ PyObject* v;
+ int r;
+
+- proxyDict = SCDynamicStoreCopyProxies(NULL);
++ proxyDict = CFNetworkCopyProxiesForURL(NULL);
+ if (!proxyDict) {
+ Py_INCREF(Py_None);
+ return Py_None;
+@@ -114,6 +114,7 @@
+ error:
+ if (proxyDict) CFRelease(proxyDict);
+ Py_XDECREF(result);
++*/
+ return NULL;
+ }
+
+@@ -163,6 +164,7 @@
+ static PyObject*
+ get_proxies(PyObject* mod __attribute__((__unused__)))
+ {
++/*
+ PyObject* result = NULL;
+ int r;
+ CFDictionaryRef proxyDict = NULL;
+@@ -201,6 +203,7 @@
+ error:
+ if (proxyDict) CFRelease(proxyDict);
+ Py_XDECREF(result);
++*/
+ return NULL;
+ }
+
diff --git a/tools/depends/target/python26/Python-2.6.5-xcompile.patch b/tools/depends/target/python26/Python-2.6.5-xcompile.patch
new file mode 100644
index 0000000000..51df2d347d
--- /dev/null
+++ b/tools/depends/target/python26/Python-2.6.5-xcompile.patch
@@ -0,0 +1,301 @@
+diff -uN Python-2.6.2/configure Python-2.6.2POld/configure
+--- Python-2.6.2/configure 2009-03-31 03:56:14.000000000 +1000
+
+@@ -24326,14 +24326,14 @@
+
+ { echo "$as_me:$LINENO: checking for %zd printf() format support" >&5
+ echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; }
+-if test "$cross_compiling" = yes; then
+- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
++#if test "$cross_compiling" = yes; then
++# { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
++#See \`config.log' for more details." >&5
++#echo "$as_me: error: cannot run test program while cross compiling
++#See \`config.log' for more details." >&2;}
++# { (exit 1); exit 1; }; }
++#else
++cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -24411,7 +24411,7 @@
+ echo "${ECHO_T}no" >&6; }
+ fi
+ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
++#fi
+
+
+
+diff -uN Python-2.6.2/configure.in Python-2.6.2POld/configure.in
+--- Python-2.6.2/configure.in 2009-03-31 03:56:14.000000000 +1000
++++ Python-2.6.2POld/configure.in 2009-08-17 12:19:15.000000000 +1000
+@@ -3656,48 +3656,48 @@
+ AC_MSG_RESULT(no)
+ fi
+
+-AC_MSG_CHECKING(for %zd printf() format support)
+-AC_TRY_RUN([#include <stdio.h>
+-#include <stddef.h>
+-#include <string.h>
+-
+-#ifdef HAVE_SYS_TYPES_H
+-#include <sys/types.h>
+-#endif
+-
+-#ifdef HAVE_SSIZE_T
+-typedef ssize_t Py_ssize_t;
+-#elif SIZEOF_VOID_P == SIZEOF_LONG
+-typedef long Py_ssize_t;
+-#else
+-typedef int Py_ssize_t;
+-#endif
+-
+-int main()
+-{
+- char buffer[256];
+-
+- if(sprintf(buffer, "%zd", (size_t)123) < 0)
+- return 1;
+-
+- if (strcmp(buffer, "123"))
+- return 1;
+-
+- if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
+- return 1;
+-
+- if (strcmp(buffer, "-123"))
+- return 1;
+-
+- return 0;
+-}],
+-[AC_MSG_RESULT(yes)
+- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
+- AC_MSG_RESULT(no))
++#AC_MSG_CHECKING(for %zd printf() format support)
++#AC_TRY_RUN([#include <stdio.h>
++##include <stddef.h>
++##include <string.h>
++
++##ifdef HAVE_SYS_TYPES_H
++##include <sys/types.h>
++##endif
++
++##ifdef HAVE_SSIZE_T
++#typedef ssize_t Py_ssize_t;
++##elif SIZEOF_VOID_P == SIZEOF_LONG
++#typedef long Py_ssize_t;
++##else
++#typedef int Py_ssize_t;
++##endif
++#
++#int main()
++#{
++# char buffer[256];
++#
++# if(sprintf(buffer, "%zd", (size_t)123) < 0)
++# return 1;#
++#
++# if (strcmp(buffer, "123"))
++# return 1;
++#
++# if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
++# return 1;
++#
++# if (strcmp(buffer, "-123"))
++# return 1;
++#
++# return 0;
++#}],
++#[AC_MSG_RESULT(yes)
++# AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
++# AC_MSG_RESULT(no))
+
+ AC_CHECK_TYPE(socklen_t,,
+ AC_DEFINE(socklen_t,int,
+- Define to `int' if <sys/socket.h> does not define.),[
++ Define to 'int' if <sys/socket.h> does not define.),[
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+diff -uN Python-2.6.2/Makefile.pre.in Python-2.6.2POld/Makefile.pre.in
+--- Python-2.6.2/Makefile.pre.in 2009-02-24 21:07:44.000000000 +1000
++++ Python-2.6.2POld/Makefile.pre.in 2009-08-17 12:19:15.000000000 +1000
+@@ -175,6 +175,7 @@
+
+ PYTHON= python$(EXE)
+ BUILDPYTHON= python$(BUILDEXE)
++HOSTPYTHON= ./$(BUILDPYTHON)
+
+ # The task to run while instrument when building the profile-opt target
+ PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
+@@ -206,6 +207,8 @@
+ # Parser
+ PGEN= Parser/pgen$(EXE)
+
++HOSTPGEN= $(PGEN)
++
+ POBJS= \
+ Parser/acceler.o \
+ Parser/grammar1.o \
+@@ -394,8 +397,8 @@
+ # Build the shared modules
+ sharedmods: $(BUILDPYTHON)
+ @case $$MAKEFLAGS in \
+- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
+- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
++ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
++ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
+ esac
+
+ # Build static library
+@@ -517,7 +520,7 @@
+
+ $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
+ -@$(INSTALL) -d Include
+- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+
+ $(PGEN): $(PGENOBJS)
+ $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
+@@ -886,24 +889,24 @@
+ done; \
+ done
+ $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
++ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
+@@ -1001,7 +1004,8 @@
+ # Install the dynamically loadable modules
+ # This goes into $(exec_prefix)
+ sharedinstall:
+- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
++ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \
++ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --install-platlib=$(DESTSHARED) \
+diff -uN Python-2.6.2/setup.py Python-2.6.2POld/setup.py
+--- Python-2.6.2/setup.py 2009-04-01 04:20:48.000000000 +1000
++++ Python-2.6.2POld/setup.py 2009-08-17 12:19:15.000000000 +1000
+@@ -17,7 +17,7 @@
+ from distutils.command.install_lib import install_lib
+
+ # This global variable is used to hold the list of modules to be disabled.
+-disabled_module_list = []
++disabled_module_list = ['_ctypes', '_curses', '_curses_panel', '_cursesmodule', '_tkinter', 'syslogmodule', 'nismodule']
+
+ def add_dir_to_list(dirlist, dir):
+ """Add the directory 'dir' to the list 'dirlist' (at the front) if
+@@ -267,33 +267,40 @@
+ self.announce('WARNING: skipping import check for Cygwin-based "%s"'
+ % ext.name)
+ return
++ if os.environ.get('CROSS_COMPILE_TARGET') == 'yes':
++ return
++
+ ext_filename = os.path.join(
+ self.build_lib,
+ self.get_ext_filename(self.get_ext_fullname(ext.name)))
+ try:
+ imp.load_dynamic(ext.name, ext_filename)
+ except ImportError, why:
+- self.failed.append(ext.name)
+- self.announce('*** WARNING: renaming "%s" since importing it'
+- ' failed: %s' % (ext.name, why), level=3)
+- assert not self.inplace
+- basename, tail = os.path.splitext(ext_filename)
+- newname = basename + "_failed" + tail
+- if os.path.exists(newname):
+- os.remove(newname)
+- os.rename(ext_filename, newname)
+-
+- # XXX -- This relies on a Vile HACK in
+- # distutils.command.build_ext.build_extension(). The
+- # _built_objects attribute is stored there strictly for
+- # use here.
+- # If there is a failure, _built_objects may not be there,
+- # so catch the AttributeError and move on.
+- try:
+- for filename in self._built_objects:
+- os.remove(filename)
+- except AttributeError:
+- self.announce('unable to remove files (ignored)')
++ if os.environ.get('CROSS_COMPILE_TARGET') != "yes":
++ self.announce('*** WARNING: renaming "%s" since importing it'
++ ' failed: %s' % (ext.name, why), level=3)
++ assert not self.inplace
++ basename, tail = os.path.splitext(ext_filename)
++ newname = basename + "_failed" + tail
++ if os.path.exists(newname):
++ os.remove(newname)
++ os.rename(ext_filename, newname)
++
++ # XXX -- This relies on a Vile HACK in
++ # distutils.command.build_ext.build_extension(). The
++ # _built_objects attribute is stored there strictly for
++ # use here.
++ # If there is a failure, _built_objects may not be there,
++ # so catch the AttributeError and move on.
++ try:
++ for filename in self._built_objects:
++ os.remove(filename)
++ except AttributeError:
++ self.announce('unable to remove files (ignored)')
++ else:
++ self.announce('WARNING: "%s" failed importing, but we leave it '
++ 'because we are cross-compiling' %
++ ext.name)
+ except:
+ exc_type, why, tb = sys.exc_info()
+ self.announce('*** WARNING: importing extension "%s" '
+@@ -665,7 +672,7 @@
+
+ if (ssl_incs is not None and
+ ssl_libs is not None and
+- openssl_ver >= 0x00907000):
++ openssl_ver >= 0x00907000 and False):
+ # The _hashlib module wraps optimized implementations
+ # of hash functions from the OpenSSL library.
+ exts.append( Extension('_hashlib', ['_hashopenssl.c'],
+@@ -685,7 +692,7 @@
+ depends = ['md5.h']) )
+ missing.append('_hashlib')
+
+- if (openssl_ver < 0x00908000):
++ if (True or openssl_ver < 0x00908000):
+ # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
+ exts.append( Extension('_sha256', ['sha256module.c']) )
+ exts.append( Extension('_sha512', ['sha512module.c']) )
+
diff --git a/tools/depends/target/python26/Python-no-export-path.patch b/tools/depends/target/python26/Python-no-export-path.patch
new file mode 100644
index 0000000000..6753baa9c8
--- /dev/null
+++ b/tools/depends/target/python26/Python-no-export-path.patch
@@ -0,0 +1,12 @@
+diff -ruN Makefile.pre.in Makefile.pre.in
+--- Makefile.pre.in 2012-07-12 17:52:37.072234980 -0400
++++ Makefile.pre.in 2012-07-13 15:45:36.522185303 -0400
+@@ -912,8 +912,6 @@
+ $(srcdir)/Lib/$(PLATDIR):
+ mkdir $(srcdir)/Lib/$(PLATDIR)
+ cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
+- export PATH; PATH="`pwd`:$$PATH"; \
+- export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
+ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
+ export EXE; EXE="$(BUILDEXE)"; \
+ cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen \ No newline at end of file
diff --git a/tools/depends/target/python26/Python-no-modules.patch b/tools/depends/target/python26/Python-no-modules.patch
new file mode 100644
index 0000000000..f65683799f
--- /dev/null
+++ b/tools/depends/target/python26/Python-no-modules.patch
@@ -0,0 +1,12 @@
+diff -ruN setup.py /setup.py
+--- setup.py 2012-06-22 19:56:02.633319969 -0400
++++ setup.py 2012-06-22 19:56:49.403319941 -0400
+@@ -98,7 +98,7 @@
+ self.failed = []
+
+ def build_extensions(self):
+-
++ return
+ # Detect which modules should be compiled
+ missing = self.detect_modules()
+
diff --git a/tools/depends/target/python26/modules.setup b/tools/depends/target/python26/modules.setup
new file mode 100644
index 0000000000..c4c81ba80f
--- /dev/null
+++ b/tools/depends/target/python26/modules.setup
@@ -0,0 +1,519 @@
+# -*- makefile -*-
+# The file Setup is used by the makesetup script to construct the files
+# Makefile and config.c, from Makefile.pre and config.c.in,
+# respectively. The file Setup itself is initially copied from
+# Setup.dist; once it exists it will not be overwritten, so you can edit
+# Setup to your heart's content. Note that Makefile.pre is created
+# from Makefile.pre.in by the toplevel configure script.
+
+# (VPATH notes: Setup and Makefile.pre are in the build directory, as
+# are Makefile and config.c; the *.in and *.dist files are in the source
+# directory.)
+
+# Each line in this file describes one or more optional modules.
+# Modules enabled here will not be compiled by the setup.py script,
+# so the file can be used to override setup.py's behavior.
+
+# Lines have the following structure:
+#
+# <module> ... [<sourcefile> ...] [<cpparg> ...] [<library> ...]
+#
+# <sourcefile> is anything ending in .c (.C, .cc, .c++ are C++ files)
+# <cpparg> is anything starting with -I, -D, -U or -C
+# <library> is anything ending in .a or beginning with -l or -L
+# <module> is anything else but should be a valid Python
+# identifier (letters, digits, underscores, beginning with non-digit)
+#
+# (As the makesetup script changes, it may recognize some other
+# arguments as well, e.g. *.so and *.sl as libraries. See the big
+# case statement in the makesetup script.)
+#
+# Lines can also have the form
+#
+# <name> = <value>
+#
+# which defines a Make variable definition inserted into Makefile.in
+#
+# Finally, if a line contains just the word "*shared*" (without the
+# quotes but with the stars), then the following modules will not be
+# built statically. The build process works like this:
+#
+# 1. Build all modules that are declared as static in Modules/Setup,
+# combine them into libpythonxy.a, combine that into python.
+# 2. Build all modules that are listed as shared in Modules/Setup.
+# 3. Invoke setup.py. That builds all modules that
+# a) are not builtin, and
+# b) are not listed in Modules/Setup, and
+# c) can be build on the target
+#
+# Therefore, modules declared to be shared will not be
+# included in the config.c file, nor in the list of objects to be
+# added to the library archive, and their linker options won't be
+# added to the linker options. Rules to create their .o files and
+# their shared libraries will still be added to the Makefile, and
+# their names will be collected in the Make variable SHAREDMODS. This
+# is used to build modules as shared libraries. (They can be
+# installed using "make sharedinstall", which is implied by the
+# toplevel "make install" target.) (For compatibility,
+# *noconfig* has the same effect as *shared*.)
+#
+# In addition, *static* explicitly declares the following modules to
+# be static. Lines containing "*static*" and "*shared*" may thus
+# alternate throughout this file.
+
+# NOTE: As a standard policy, as many modules as can be supported by a
+# platform should be present. The distribution comes with all modules
+# enabled that are supported by most platforms and don't require you
+# to ftp sources from elsewhere.
+*static*
+
+# Some special rules to define PYTHONPATH.
+# Edit the definitions below to indicate which options you are using.
+# Don't add any whitespace or comments!
+
+# Directories where library files get installed.
+# DESTLIB is for Python modules; MACHDESTLIB for shared libraries.
+DESTLIB=$(LIBDEST)
+MACHDESTLIB=$(BINLIBDEST)
+
+# NOTE: all the paths are now relative to the prefix that is computed
+# at run time!
+
+# Standard path -- don't edit.
+# No leading colon since this is the first entry.
+# Empty since this is now just the runtime prefix.
+DESTPATH=
+
+# Site specific path components -- should begin with : if non-empty
+SITEPATH=
+
+# Standard path components for test modules
+TESTPATH=
+
+# Path components for machine- or system-dependent modules and shared libraries
+MACHDEPPATH=:plat-$(MACHDEP)
+EXTRAMACHDEPPATH=
+
+# Path component for the Tkinter-related modules
+# The TKPATH variable is always enabled, to save you the effort.
+TKPATH=:lib-tk
+
+# Path component for old modules.
+OLDPATH=:lib-old
+
+COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(EXTRAMACHDEPPATH)$(TKPATH)$(OLDPATH)
+PYTHONPATH=$(COREPYTHONPATH)
+
+
+# The modules listed here can't be built as shared libraries for
+# various reasons; therefore they are listed here instead of in the
+# normal order.
+
+# This only contains the minimal set of modules required to run the
+# setup.py script in the root of the Python source tree.
+
+posix posixmodule.c # posix (UNIX) system calls
+errno errnomodule.c # posix (UNIX) errno values
+pwd pwdmodule.c # this is needed to find out the user's home dir
+ # if $HOME is not set
+_sre _sre.c # Fredrik Lundh's new regular expressions
+_codecs _codecsmodule.c # access to the builtin codecs and codec registry
+
+# The zipimport module is always imported at startup. Having it as a
+# builtin module avoids some bootstrapping problems and reduces overhead.
+zipimport zipimport.c
+
+# The rest of the modules listed in this file are all commented out by
+# default. Usually they can be detected and built as dynamically
+# loaded modules by the new setup.py script added in Python 2.1. If
+# you're on a platform that doesn't support dynamic loading, want to
+# compile modules statically into the Python binary, or need to
+# specify some odd set of compiler switches, you can uncomment the
+# appropriate lines below.
+
+# ======================================================================
+
+# The Python symtable module depends on .h files that setup.py doesn't track
+_symtable symtablemodule.c
+
+# The SGI specific GL module:
+
+GLHACK=-Dclear=__GLclear
+#gl glmodule.c cgensupport.c -I$(srcdir) $(GLHACK) -lgl -lX11
+
+# Pure module. Cannot be linked dynamically.
+# -DWITH_QUANTIFY, -DWITH_PURIFY, or -DWITH_ALL_PURE
+#WHICH_PURE_PRODUCTS=-DWITH_ALL_PURE
+#PURE_INCLS=-I/usr/local/include
+#PURE_STUBLIBS=-L/usr/local/lib -lpurify_stubs -lquantify_stubs
+#pure puremodule.c $(WHICH_PURE_PRODUCTS) $(PURE_INCLS) $(PURE_STUBLIBS)
+
+# Uncommenting the following line tells makesetup that all following
+# modules are to be built as shared libraries (see above for more
+# detail; also note that *static* reverses this effect):
+
+#*shared*
+
+# GNU readline. Unlike previous Python incarnations, GNU readline is
+# now incorporated in an optional module, configured in the Setup file
+# instead of by a configure script switch. You may have to insert a
+# -L option pointing to the directory where libreadline.* lives,
+# and you may have to change -ltermcap to -ltermlib or perhaps remove
+# it, depending on your system -- see the GNU readline instructions.
+# It's okay for this to be a shared library, too.
+
+#readline readline.c -lreadline -lncurses
+
+
+# Modules that should always be present (non UNIX dependent):
+
+array arraymodule.c # array objects
+cmath cmathmodule.c # -lm # complex math library functions
+math mathmodule.c # -lm # math library functions, e.g. sin()
+_struct _struct.c # binary structure packing/unpacking
+time timemodule.c # -lm # time operations and variables
+operator operator.c # operator.add() and similar goodies
+_weakref _weakref.c # basic weak reference support
+_testcapi _testcapimodule.c # Python C API test module
+_random _randommodule.c # Random number generator
+_collections _collectionsmodule.c # Container types
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+strop stropmodule.c # String manipulations
+_functools _functoolsmodule.c # Tools for working with functions and callable objects
+
+EXPATDEFINES='-DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI'
+_elementtree -I$(srcdir)/Modules/expat $(EXPATDEFINES) _elementtree.c # elementtree accelerator
+#_pickle _pickle.c # pickle accelerator
+datetime datetimemodule.c # date/time type
+_bisect _bisectmodule.c # Bisection algorithms
+
+unicodedata unicodedata.c # static Unicode character database
+
+# access to ISO C locale support
+_locale _localemodule.c -lintl
+
+
+# Modules with some UNIX dependencies -- on by default:
+# (If you have a really backward UNIX, select and socket may not be
+# supported...)
+#
+fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
+#spwd spwdmodule.c # spwd(3)
+#grp grpmodule.c # grp(3)
+select selectmodule.c # select(2); not on ancient System V
+
+# Memory-mapped files (also works on Win32).
+mmap mmapmodule.c
+
+# CSV file helper
+_csv _csv.c
+
+# Socket module helper for socket(2)
+_socket socketmodule.c
+
+# Socket module helper for SSL support; you must comment out the other
+# socket line above, and possibly edit the SSL variable:
+SSLDEFINES='-DUSE_SSL'
+_ssl _ssl.c \
+ $(SSLDEFINES) -I$(prefix)/include -I$(prefix)/include/openssl \
+ -L$(prefix)/lib -lssl -lcrypto
+
+_hashlib _hashopenssl.c \
+ $(SSLDEFINES) -I$(prefix)/include -I$(prefix)/include/openssl \
+ -L$(prefix)/lib -lssl -lcrypto
+
+# The crypt module is now disabled by default because it breaks builds
+# on many systems (where -lcrypt is needed), e.g. Linux (I believe).
+#
+# First, look at Setup.config; configure may have set this for you.
+
+#crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
+
+# Some more UNIX dependent modules -- off by default, since these
+# are not supported by all UNIX systems:
+
+#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
+termios termios.c # Steen Lumholt's termios module
+resource resource.c # Jeremy Hylton's rlimit interface
+
+
+# Multimedia modules -- off by default.
+# These don't work for 64-bit platforms!!!
+# #993173 says audioop works on 64-bit platforms, though.
+# These represent audio samples or images as strings:
+
+#audioop audioop.c # Operations on audio samples
+#imageop imageop.c # Operations on images
+
+
+# Note that the _md5 and _sha modules are normally only built if the
+# system does not have the OpenSSL libs containing an optimized version.
+
+# The _md5 module implements the RSA Data Security, Inc. MD5
+# Message-Digest Algorithm, described in RFC 1321. The necessary files
+# md5.c and md5.h are included here.
+
+_md5 md5module.c md5.c
+
+
+# The _sha module implements the SHA checksum algorithms.
+# (NIST's Secure Hash Algorithms.)
+_sha shamodule.c
+_sha256 sha256module.c
+_sha512 sha512module.c
+
+
+# SGI IRIX specific modules -- off by default.
+
+# These module work on any SGI machine:
+
+# *** gl must be enabled higher up in this file ***
+#fm fmmodule.c $(GLHACK) -lfm -lgl # Font Manager
+#sgi sgimodule.c # sgi.nap() and a few more
+
+# This module requires the header file
+# /usr/people/4Dgifts/iristools/include/izoom.h:
+#imgfile imgfile.c -limage -lgutil -lgl -lm # Image Processing Utilities
+
+
+# These modules require the Multimedia Development Option (I think):
+
+#al almodule.c -laudio # Audio Library
+#cd cdmodule.c -lcdaudio -lds -lmediad # CD Audio Library
+#cl clmodule.c -lcl -lawareaudio # Compression Library
+#sv svmodule.c yuvconvert.c -lsvideo -lXext -lX11 # Starter Video
+
+
+# The FORMS library, by Mark Overmars, implements user interface
+# components such as dialogs and buttons using SGI's GL and FM
+# libraries. You must ftp the FORMS library separately from
+# ftp://ftp.cs.ruu.nl/pub/SGI/FORMS. It was tested with FORMS 2.2a.
+# NOTE: if you want to be able to use FORMS and curses simultaneously
+# (or both link them statically into the same binary), you must
+# compile all of FORMS with the cc option "-Dclear=__GLclear".
+
+# The FORMS variable must point to the FORMS subdirectory of the forms
+# toplevel directory:
+
+#FORMS=/ufs/guido/src/forms/FORMS
+#fl flmodule.c -I$(FORMS) $(GLHACK) $(FORMS)/libforms.a -lfm -lgl
+
+
+# SunOS specific modules -- off by default:
+
+#sunaudiodev sunaudiodev.c
+
+
+# A Linux specific module -- off by default; this may also work on
+# some *BSDs.
+
+#linuxaudiodev linuxaudiodev.c
+
+
+# George Neville-Neil's timing module:
+
+timing timingmodule.c
+
+
+# The _tkinter module.
+#
+# The command for _tkinter is long and site specific. Please
+# uncomment and/or edit those parts as indicated. If you don't have a
+# specific extension (e.g. Tix or BLT), leave the corresponding line
+# commented out. (Leave the trailing backslashes in! If you
+# experience strange errors, you may want to join all uncommented
+# lines and remove the backslashes -- the backslash interpretation is
+# done by the shell's "read" command and it may not be implemented on
+# every system.
+
+# *** Always uncomment this (leave the leading underscore in!):
+# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
+# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
+# -L/usr/local/lib \
+# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
+# -I/usr/local/include \
+# *** Uncomment and edit to reflect where your X11 header files are:
+# -I/usr/X11R6/include \
+# *** Or uncomment this for Solaris:
+# -I/usr/openwin/include \
+# *** Uncomment and edit for Tix extension only:
+# -DWITH_TIX -ltix8.1.8.2 \
+# *** Uncomment and edit for BLT extension only:
+# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
+# *** Uncomment and edit for PIL (TkImaging) extension only:
+# (See http://www.pythonware.com/products/pil/ for more info)
+# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
+# *** Uncomment and edit for TOGL extension only:
+# -DWITH_TOGL togl.c \
+# *** Uncomment and edit to reflect your Tcl/Tk versions:
+# -ltk8.2 -ltcl8.2 \
+# *** Uncomment and edit to reflect where your X11 libraries are:
+# -L/usr/X11R6/lib \
+# *** Or uncomment this for Solaris:
+# -L/usr/openwin/lib \
+# *** Uncomment these for TOGL extension only:
+# -lGL -lGLU -lXext -lXmu \
+# *** Uncomment for AIX:
+# -lld \
+# *** Always uncomment this; X11 libraries to link with:
+# -lX11
+
+# Lance Ellinghaus's syslog module
+syslog syslogmodule.c # syslog daemon interface
+
+
+# Curses support, requring the System V version of curses, often
+# provided by the ncurses library. e.g. on Linux, link with -lncurses
+# instead of -lcurses).
+#
+# First, look at Setup.config; configure may have set this for you.
+
+#_curses _cursesmodule.c -lcurses -ltermcap
+# Wrapper for the panel library that's part of ncurses and SYSV curses.
+#_curses_panel _curses_panel.c -lpanel -lncurses
+
+
+# Generic (SunOS / SVR4) dynamic loading module.
+# This is not needed for dynamic loading of Python modules --
+# it is a highly experimental and dangerous device for calling
+# *arbitrary* C functions in *arbitrary* shared libraries:
+
+#dl dlmodule.c
+
+
+# Modules that provide persistent dictionary-like semantics. You will
+# probably want to arrange for at least one of them to be available on
+# your machine, though none are defined by default because of library
+# dependencies. The Python module anydbm.py provides an
+# implementation independent wrapper for these; dumbdbm.py provides
+# similar functionality (but slower of course) implemented in Python.
+
+# The standard Unix dbm module has been moved to Setup.config so that
+# it will be compiled as a shared library by default. Compiling it as
+# a built-in module causes conflicts with the pybsddb3 module since it
+# creates a static dependency on an out-of-date version of db.so.
+#
+# First, look at Setup.config; configure may have set this for you.
+
+#dbm -I$(prefix)/include -L$(prefix)/lib dbmmodule.c # dbm(3) may require -lndbm or similar
+
+# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
+#
+# First, look at Setup.config; configure may have set this for you.
+
+#gdbm gdbmmodule.c -I$(prefix)/include -L$(prefix)/lib -lgdbm
+
+
+# Sleepycat Berkeley DB interface.
+#
+# This requires the Sleepycat DB code, see http://www.sleepycat.com/
+# The earliest supported version of that library is 3.0, the latest
+# supported version is 4.0 (4.1 is specifically not supported, as that
+# changes the semantics of transactional databases). A list of available
+# releases can be found at
+#
+# http://www.sleepycat.com/update/index.html
+#
+# Edit the variables DB and DBLIBVERto point to the db top directory
+# and the subdirectory of PORT where you built it.
+#DB=/usr/local/BerkeleyDB.4.0
+#DBLIBVER=4.0
+#DBINC=$(DB)/include
+#DBLIB=$(DB)/lib
+#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+# Historical Berkeley DB 1.85
+#
+# This module is deprecated; the 1.85 version of the Berkeley DB library has
+# bugs that can cause data corruption. If you can, use later versions of the
+# library instead, available from <http://www.sleepycat.com/>.
+
+#DB=/depot/sundry/src/berkeley-db/db.1.85
+#DBPORT=$(DB)/PORT/irix.5.3
+#bsddb185 bsddbmodule.c -I$(DBPORT)/include -I$(DBPORT) $(DBPORT)/libdb.a
+
+
+
+# Helper module for various ascii-encoders
+binascii binascii.c
+
+# Fred Drake's interface to the Python parser
+parser parsermodule.c
+
+# cStringIO and cPickle
+cStringIO cStringIO.c
+cPickle cPickle.c
+
+
+# Lee Busby's SIGFPE modules.
+# The library to link fpectl with is platform specific.
+# Choose *one* of the options below for fpectl:
+
+# For SGI IRIX (tested on 5.3):
+#fpectl fpectlmodule.c -lfpe
+
+# For Solaris with SunPro compiler (tested on Solaris 2.5 with SunPro C 4.2):
+# (Without the compiler you don't have -lsunmath.)
+#fpectl fpectlmodule.c -R/opt/SUNWspro/lib -lsunmath -lm
+
+# For other systems: see instructions in fpectlmodule.c.
+#fpectl fpectlmodule.c ...
+
+# Test module for fpectl. No extra libraries needed.
+#fpetest fpetestmodule.c
+
+# Andrew Kuchling's zlib module.
+# This require zlib 1.1.3 (or later).
+# See http://www.gzip.org/zlib/
+zlib zlibmodule.c -I$(prefix)/include -L$(prefix)/lib -lz
+
+# Interface to the Expat XML parser
+#
+# Expat was written by James Clark and is now maintained by a group of
+# developers on SourceForge; see www.libexpat.org for more
+# information. The pyexpat module was written by Paul Prescod after a
+# prototype by Jack Jansen. Source of Expat 1.95.2 is included in
+# Modules/expat/. Usage of a system shared libexpat.so/expat.dll is
+# not advised.
+#
+# More information on Expat can be found at www.libexpat.org.
+#
+pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat $(EXPATDEFINES) -I$(prefix)/include -L$(prefix)/lib -lexpat
+
+
+# Hye-Shik Chang's CJKCodecs
+
+# multibytecodec is required for all the other CJK codec modules
+_multibytecodec cjkcodecs/multibytecodec.c
+
+_codecs_cn cjkcodecs/_codecs_cn.c
+_codecs_hk cjkcodecs/_codecs_hk.c
+_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+_codecs_jp cjkcodecs/_codecs_jp.c
+_codecs_kr cjkcodecs/_codecs_kr.c
+_codecs_tw cjkcodecs/_codecs_tw.c
+
+# Example -- included for reference only:
+# xx xxmodule.c
+
+# Another example -- the 'xxsubtype' module shows C-level subtyping in action
+xxsubtype xxsubtype.c
+
+_lsprof _lsprof.c rotatingtree.c
+_json _json.c
+_fileio _fileio.c
+_heapq _heapqmodule.c
+_hotshot _hotshot.c
+future_builtins future_builtins.c
+
+SQLITEDEFINES='-DMODULE_NAME="sqlite3"'
+_sqlite3 _sqlite/connection.c \
+ _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/prepare_protocol.c \
+ _sqlite/row.c _sqlite/statement.c _sqlite/module.c _sqlite/util.c _sqlite/cache.c \
+ -I$(prefix)/include -L$(prefix)/lib -lsqlite3 $(SQLITEDEFINES)
+
+_ctypes _ctypes/callbacks.c _ctypes/callproc.c _ctypes/cfield.c _ctypes/_ctypes.c \
+ _ctypes/malloc_closure.c _ctypes/stgdict.c \
+ -I$(prefix)/include/ffi -L$(prefix)/lib -lffi
+
+#bz2 bz2module.c -I$(prefix)/include -L$(prefix)/lib -lbz2
diff --git a/tools/depends/target/python26/python-osx-environ-fix.patch b/tools/depends/target/python26/python-osx-environ-fix.patch
new file mode 100644
index 0000000000..b6f6a725e0
--- /dev/null
+++ b/tools/depends/target/python26/python-osx-environ-fix.patch
@@ -0,0 +1,25 @@
+Index: Modules/posixmodule.c
+===================================================================
+--- a/Modules/posixmodule.c (revision 52827)
++++ b/Modules/posixmodule.c (working copy)
+@@ -314,7 +314,7 @@
+ #endif
+
+ /* Return a dictionary corresponding to the POSIX environment table */
+-#ifdef WITH_NEXT_FRAMEWORK
++#ifdef __APPLE__
+ /* On Darwin/MacOSX a shared library or framework has no access to
+ ** environ directly, we must obtain it with _NSGetEnviron().
+ */
+@@ -332,7 +332,7 @@
+ d = PyDict_New();
+ if (d == NULL)
+ return NULL;
+-#ifdef WITH_NEXT_FRAMEWORK
++#ifdef __APPLE__
+ if (environ == NULL)
+ environ = *_NSGetEnviron();
+ #endif
+
+
+