Update python to 2.6.1.
Get rid of the virtual python-core package and instead python depends on python-mini and provides files missing in python-mini for a full featured python installation. Thus also update the dependencies of various python packages. git-svn-id: svn://svn.openwrt.org/openwrt/packages@14760 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@ -2,7 +2,7 @@ Index: Python-2.5.1/Makefile.pre.in
|
||||
===================================================================
|
||||
--- Python-2.5.1.orig/Makefile.pre.in 2007-07-30 12:55:24.000000000 -0500
|
||||
+++ Python-2.5.1/Makefile.pre.in 2007-07-30 12:55:24.000000000 -0500
|
||||
@@ -170,6 +170,7 @@
|
||||
@@ -175,6 +175,7 @@
|
||||
|
||||
PYTHON= python$(EXE)
|
||||
BUILDPYTHON= python$(BUILDEXE)
|
||||
@ -10,7 +10,7 @@ Index: Python-2.5.1/Makefile.pre.in
|
||||
|
||||
# === Definitions added by makesetup ===
|
||||
|
||||
@@ -196,7 +197,7 @@
|
||||
@@ -205,7 +206,7 @@
|
||||
##########################################################################
|
||||
# Parser
|
||||
PGEN= Parser/pgen$(EXE)
|
||||
@ -19,28 +19,28 @@ Index: Python-2.5.1/Makefile.pre.in
|
||||
POBJS= \
|
||||
Parser/acceler.o \
|
||||
Parser/grammar1.o \
|
||||
@@ -345,8 +346,8 @@
|
||||
@@ -394,8 +395,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;; \
|
||||
@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;; \
|
||||
+ *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
|
||||
esac
|
||||
|
||||
# Build static library
|
||||
@@ -470,8 +471,8 @@
|
||||
@@ -512,8 +513,8 @@
|
||||
|
||||
|
||||
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
|
||||
-@ mkdir Include
|
||||
-@$(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)
|
||||
@@ -885,7 +886,7 @@
|
||||
@@ -993,7 +994,7 @@
|
||||
# Install the dynamically loadable modules
|
||||
# This goes into $(exec_prefix)
|
||||
sharedinstall:
|
||||
@ -49,37 +49,70 @@ Index: Python-2.5.1/Makefile.pre.in
|
||||
--prefix=$(prefix) \
|
||||
--install-scripts=$(BINDIR) \
|
||||
--install-platlib=$(DESTSHARED) \
|
||||
Index: Python-2.5.1/setup.py
|
||||
===================================================================
|
||||
--- Python-2.5.1.orig/setup.py 2007-07-30 12:55:24.000000000 -0500
|
||||
+++ Python-2.5.1/setup.py 2007-07-30 12:57:10.000000000 -0500
|
||||
@@ -209,6 +209,7 @@
|
||||
try:
|
||||
imp.load_dynamic(ext.name, ext_filename)
|
||||
except ImportError, why:
|
||||
+ return
|
||||
self.announce('*** WARNING: renaming "%s" since importing it'
|
||||
' failed: %s' % (ext.name, why), level=3)
|
||||
assert not self.inplace
|
||||
@@ -244,8 +245,6 @@
|
||||
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
index c2ce5c6..63dc91e 100644
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -371,7 +371,7 @@ build_all_generate_profile:
|
||||
$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
|
||||
|
||||
def detect_modules(self):
|
||||
# Ensure that /usr/local is always used
|
||||
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||
run_profile_task:
|
||||
- ./$(BUILDPYTHON) $(PROFILE_TASK)
|
||||
+ $(HOSTPYTHON) $(PROFILE_TASK)
|
||||
|
||||
# Add paths specified in the environment variables LDFLAGS and
|
||||
# CPPFLAGS for header and library files.
|
||||
@@ -279,12 +278,6 @@
|
||||
for directory in options.dirs:
|
||||
add_dir_to_list(dir_list, directory)
|
||||
build_all_use_profile:
|
||||
$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
|
||||
@@ -389,7 +389,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
|
||||
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
|
||||
|
||||
platform: $(BUILDPYTHON)
|
||||
- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
|
||||
+ $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
|
||||
|
||||
|
||||
# Build the shared modules
|
||||
@@ -669,7 +669,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
|
||||
|
||||
TESTOPTS= -l $(EXTRATESTOPTS)
|
||||
TESTPROG= $(srcdir)/Lib/test/regrtest.py
|
||||
-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
|
||||
+TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -E -tt
|
||||
test: all platform
|
||||
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
|
||||
|
||||
@@ -1032,7 +1014,7 @@ frameworkinstallstructure: $(LDLIBRARY)
|
||||
fi; \
|
||||
done
|
||||
$(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
|
||||
- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
|
||||
+ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
|
||||
$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
|
||||
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
|
||||
$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
|
||||
@@ -1074,7 +1056,7 @@ frameworkinstallextras:
|
||||
# This installs a few of the useful scripts in Tools/scripts
|
||||
scriptsinstall:
|
||||
SRCDIR=$(srcdir) $(RUNSHARED) \
|
||||
- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
|
||||
+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \
|
||||
--prefix=$(prefix) \
|
||||
--install-scripts=$(BINDIR) \
|
||||
--root=/$(DESTDIR)
|
||||
@@ -1096,7 +1078,7 @@ config.status: $(srcdir)/configure
|
||||
|
||||
# Run reindent on the library
|
||||
reindent:
|
||||
- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
|
||||
+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
|
||||
|
||||
# Rerun configure with the same options as it was run last time,
|
||||
# provided the config.status script exists
|
||||
@@ -1192,7 +1174,7 @@ funny:
|
||||
|
||||
# Perform some verification checks on any modified files.
|
||||
patchcheck:
|
||||
- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
|
||||
+ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
|
||||
|
||||
# Dependencies
|
||||
|
||||
- if os.path.normpath(sys.prefix) != '/usr':
|
||||
- add_dir_to_list(self.compiler.library_dirs,
|
||||
- sysconfig.get_config_var("LIBDIR"))
|
||||
- add_dir_to_list(self.compiler.include_dirs,
|
||||
- sysconfig.get_config_var("INCLUDEDIR"))
|
||||
-
|
||||
try:
|
||||
have_unicode = unicode
|
||||
except NameError:
|
||||
|
@ -1,38 +0,0 @@
|
||||
Index: Python-2.5.1/setup.py
|
||||
===================================================================
|
||||
--- Python-2.5.1.orig/setup.py 2007-07-30 12:55:24.000000000 -0500
|
||||
+++ Python-2.5.1/setup.py 2007-07-30 12:57:03.000000000 -0500
|
||||
@@ -244,7 +244,18 @@
|
||||
return sys.platform
|
||||
|
||||
def detect_modules(self):
|
||||
- # Ensure that /usr/local is always used
|
||||
+ try:
|
||||
+ modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
|
||||
+ except KeyError:
|
||||
+ modules_include_dirs = ['/usr/include']
|
||||
+ try:
|
||||
+ modules_lib_dirs = os.environ["PYTHON_MODULES_LIB"].split()
|
||||
+ except KeyError:
|
||||
+ modules_lib_dirs = ['/usr/lib']
|
||||
+ for dir in modules_include_dirs:
|
||||
+ add_dir_to_list(self.compiler.include_dirs, dir)
|
||||
+ for dir in modules_lib_dirs:
|
||||
+ add_dir_to_list(self.compiler.library_dirs, dir)
|
||||
|
||||
# Add paths specified in the environment variables LDFLAGS and
|
||||
# CPPFLAGS for header and library files.
|
||||
@@ -286,11 +297,8 @@
|
||||
# lib_dirs and inc_dirs are used to search for files;
|
||||
# if a file is found in one of those directories, it can
|
||||
# be assumed that no additional -I,-L directives are needed.
|
||||
- lib_dirs = self.compiler.library_dirs + [
|
||||
- '/lib64', '/usr/lib64',
|
||||
- '/lib', '/usr/lib',
|
||||
- ]
|
||||
- inc_dirs = self.compiler.include_dirs + ['/usr/include']
|
||||
+ lib_dirs = self.compiler.library_dirs
|
||||
+ inc_dirs = self.compiler.include_dirs
|
||||
exts = []
|
||||
|
||||
config_h = sysconfig.get_config_h_filename()
|
87
lang/python/patches/010-cannot-run-test-programm.patch
Normal file
87
lang/python/patches/010-cannot-run-test-programm.patch
Normal file
@ -0,0 +1,87 @@
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 14095a1..e7ab47f 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -2559,6 +2559,7 @@ AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
|
||||
# On Tru64, chflags seems to be present, but calling it will
|
||||
# exit Python
|
||||
AC_MSG_CHECKING(for chflags)
|
||||
+AC_CACHE_VAL(ac_cv_have_chflags, [
|
||||
AC_TRY_RUN([
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@@ -2568,12 +2569,19 @@ int main(int argc, char*argv[])
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
-],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
|
||||
- AC_MSG_RESULT(yes),
|
||||
- AC_MSG_RESULT(no)
|
||||
-)
|
||||
+],
|
||||
+ac_cv_have_chflags=yes,
|
||||
+ac_cv_have_chflags=no,
|
||||
+ac_cv_have_chflags=no)])
|
||||
+AC_MSG_RESULT($ac_cv_have_chflags)
|
||||
+if test "$ac_cv_have_chflags" = yes
|
||||
+then
|
||||
+ AC_DEFINE(HAVE_CHFLAGS, 1,
|
||||
+ [Define to 1 if you have the `chflags' function.])
|
||||
+fi
|
||||
|
||||
AC_MSG_CHECKING(for lchflags)
|
||||
+AC_CACHE_VAL(ac_cv_have_lchflags, [
|
||||
AC_TRY_RUN([
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@@ -2583,10 +2591,16 @@ int main(int argc, char*argv[])
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
-],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
|
||||
- AC_MSG_RESULT(yes),
|
||||
- AC_MSG_RESULT(no)
|
||||
-)
|
||||
+],
|
||||
+ac_cv_have_lchflags=yes,
|
||||
+ac_cv_have_lchflags=no,
|
||||
+ac_cv_have_lchflags=no)])
|
||||
+AC_MSG_RESULT($ac_cv_have_lchflags)
|
||||
+if test "$ac_cv_have_lchflags" = yes
|
||||
+then
|
||||
+ AC_DEFINE(HAVE_CHFLAGS, 1,
|
||||
+ [Define to 1 if you have the `lchflags' function.])
|
||||
+fi
|
||||
|
||||
dnl Check if system zlib has *Copy() functions
|
||||
dnl
|
||||
@@ -3664,6 +3664,7 @@ else
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for %zd printf() format support)
|
||||
+AC_CACHE_VAL(ac_cv_py_format_size_t, [
|
||||
AC_TRY_RUN([#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -3697,10 +3698,17 @@ int main()
|
||||
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_cv_py_format_size_t=yes,
|
||||
+ac_cv_py_format_size_t=no,
|
||||
+ac_cv_py_format_size_t=no)])
|
||||
+AC_MSG_RESULT($ac_cv_py_format_size_t)
|
||||
+if test "$ac_cv_pyt_format_t" = yes
|
||||
+then
|
||||
+ AC_DEFINE(PY_FORMAT_SIZE_T, "z",
|
||||
+ [Define to printf format modifier for Py_ssize_t])
|
||||
+fi
|
||||
|
||||
AC_CHECK_TYPE(socklen_t,,
|
||||
AC_DEFINE(socklen_t,int,
|
@ -1,38 +0,0 @@
|
||||
Index: Python-2.5.1/setup.py
|
||||
===================================================================
|
||||
--- Python-2.5.1.orig/setup.py 2007-07-30 12:55:24.000000000 -0500
|
||||
+++ Python-2.5.1/setup.py 2007-07-30 12:55:24.000000000 -0500
|
||||
@@ -15,7 +15,14 @@
|
||||
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 = []
|
||||
+try:
|
||||
+ disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()
|
||||
+except KeyError:
|
||||
+ disabled_module_list = []
|
||||
+try:
|
||||
+ disable_ssl = os.environ["PYTHON_DISABLE_SSL"]
|
||||
+except KeyError:
|
||||
+ disable_ssl = 0
|
||||
|
||||
def add_dir_to_list(dirlist, dir):
|
||||
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
|
||||
@@ -244,6 +251,7 @@
|
||||
return sys.platform
|
||||
|
||||
def detect_modules(self):
|
||||
+ global disable_ssl
|
||||
try:
|
||||
modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
|
||||
except KeyError:
|
||||
@@ -538,7 +546,8 @@
|
||||
] )
|
||||
|
||||
if (ssl_incs is not None and
|
||||
- ssl_libs is not None):
|
||||
+ ssl_libs is not None and
|
||||
+ not disable_ssl):
|
||||
exts.append( Extension('_ssl', ['_ssl.c'],
|
||||
include_dirs = ssl_incs,
|
||||
library_dirs = ssl_libs,
|
@ -1,6 +1,8 @@
|
||||
--- Python-2.5/Makefile.pre.in 2007-04-19 18:46:05.510965874 -0500
|
||||
+++ Python-2.5.new/Makefile.pre.in 2007-04-19 18:44:45.650965874 -0500
|
||||
@@ -773,22 +773,6 @@
|
||||
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
index a341e63..e949653 100644
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -879,22 +879,6 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
|
||||
done; \
|
||||
done
|
||||
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
|
||||
@ -20,6 +22,6 @@
|
||||
- ./$(BUILDPYTHON) -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()"
|
||||
|
||||
# Create the PLATDIR source directory, if one wasn't distributed..
|
||||
$(srcdir)/Lib/$(PLATDIR):
|
@ -1,17 +0,0 @@
|
||||
Index: Python-2.5.1/Python/import.c
|
||||
===================================================================
|
||||
--- Python-2.5.1.orig/Python/import.c 2007-07-30 12:55:23.000000000 -0500
|
||||
+++ Python-2.5.1/Python/import.c 2007-07-30 12:55:24.000000000 -0500
|
||||
@@ -864,8 +864,12 @@
|
||||
write_compiled_module(PyCodeObject *co, char *cpathname, time_t mtime)
|
||||
{
|
||||
FILE *fp;
|
||||
+ char *py_dontcompile = getenv("PYTHON_DONTCOMPILE");
|
||||
|
||||
+ if (!py_dontcompile)
|
||||
fp = open_exclusive(cpathname);
|
||||
+ else
|
||||
+ fp = NULL;
|
||||
if (fp == NULL) {
|
||||
if (Py_VerboseFlag)
|
||||
PySys_WriteStderr(
|
@ -1,140 +0,0 @@
|
||||
diff -Naur Python-2.5.4/configure Python-2.5.4-cross/configure
|
||||
--- Python-2.5.4/configure 2008-12-13 15:13:52.000000000 +0100
|
||||
+++ Python-2.5.4-cross/configure 2009-01-01 15:16:01.000000000 +0100
|
||||
@@ -22326,39 +22326,6 @@
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
-{ echo "$as_me:$LINENO: checking for /dev/ptmx" >&5
|
||||
-echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6; }
|
||||
-
|
||||
-if test -r /dev/ptmx
|
||||
-then
|
||||
- { echo "$as_me:$LINENO: result: yes" >&5
|
||||
-echo "${ECHO_T}yes" >&6; }
|
||||
-
|
||||
-cat >>confdefs.h <<\_ACEOF
|
||||
-#define HAVE_DEV_PTMX 1
|
||||
-_ACEOF
|
||||
-
|
||||
-else
|
||||
- { echo "$as_me:$LINENO: result: no" >&5
|
||||
-echo "${ECHO_T}no" >&6; }
|
||||
-fi
|
||||
-
|
||||
-{ echo "$as_me:$LINENO: checking for /dev/ptc" >&5
|
||||
-echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6; }
|
||||
-
|
||||
-if test -r /dev/ptc
|
||||
-then
|
||||
- { echo "$as_me:$LINENO: result: yes" >&5
|
||||
-echo "${ECHO_T}yes" >&6; }
|
||||
-
|
||||
-cat >>confdefs.h <<\_ACEOF
|
||||
-#define HAVE_DEV_PTC 1
|
||||
-_ACEOF
|
||||
-
|
||||
-else
|
||||
- { echo "$as_me:$LINENO: result: no" >&5
|
||||
-echo "${ECHO_T}no" >&6; }
|
||||
-fi
|
||||
|
||||
case $MACHDEP in
|
||||
darwin)
|
||||
@@ -22426,96 +22393,6 @@
|
||||
|
||||
|
||||
|
||||
-{ 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
|
||||
-/* confdefs.h. */
|
||||
-_ACEOF
|
||||
-cat confdefs.h >>conftest.$ac_ext
|
||||
-cat >>conftest.$ac_ext <<_ACEOF
|
||||
-/* end confdefs.h. */
|
||||
-#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;
|
||||
-}
|
||||
-_ACEOF
|
||||
-rm -f conftest$ac_exeext
|
||||
-if { (ac_try="$ac_link"
|
||||
-case "(($ac_try" in
|
||||
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
- *) ac_try_echo=$ac_try;;
|
||||
-esac
|
||||
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
- (eval "$ac_link") 2>&5
|
||||
- ac_status=$?
|
||||
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
|
||||
- { (case "(($ac_try" in
|
||||
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
- *) ac_try_echo=$ac_try;;
|
||||
-esac
|
||||
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
- (eval "$ac_try") 2>&5
|
||||
- ac_status=$?
|
||||
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
- (exit $ac_status); }; }; then
|
||||
- { echo "$as_me:$LINENO: result: yes" >&5
|
||||
-echo "${ECHO_T}yes" >&6; }
|
||||
-
|
||||
-cat >>confdefs.h <<\_ACEOF
|
||||
-#define PY_FORMAT_SIZE_T "z"
|
||||
-_ACEOF
|
||||
-
|
||||
-else
|
||||
- echo "$as_me: program exited with status $ac_status" >&5
|
||||
-echo "$as_me: failed program was:" >&5
|
||||
-sed 's/^/| /' conftest.$ac_ext >&5
|
||||
-
|
||||
-( exit $ac_status )
|
||||
-{ echo "$as_me:$LINENO: result: no" >&5
|
||||
-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
|
||||
-
|
||||
-
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for socklen_t" >&5
|
||||
echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; }
|
40
lang/python/patches/030-fixup-include-dirs.patch
Normal file
40
lang/python/patches/030-fixup-include-dirs.patch
Normal file
@ -0,0 +1,40 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 32e1af8..f7f190f 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -309,9 +309,6 @@ class PyBuildExt(build_ext):
|
||||
return sys.platform
|
||||
|
||||
def detect_modules(self):
|
||||
- # Ensure that /usr/local is always used
|
||||
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||
|
||||
# Add paths specified in the environment variables LDFLAGS and
|
||||
# CPPFLAGS for header and library files.
|
||||
@@ -347,11 +344,6 @@ class PyBuildExt(build_ext):
|
||||
for directory in reversed(options.dirs):
|
||||
add_dir_to_list(dir_list, directory)
|
||||
|
||||
- if os.path.normpath(sys.prefix) != '/usr':
|
||||
- add_dir_to_list(self.compiler.library_dirs,
|
||||
- sysconfig.get_config_var("LIBDIR"))
|
||||
- add_dir_to_list(self.compiler.include_dirs,
|
||||
- sysconfig.get_config_var("INCLUDEDIR"))
|
||||
|
||||
try:
|
||||
have_unicode = unicode
|
||||
@@ -361,11 +353,8 @@ class PyBuildExt(build_ext):
|
||||
# lib_dirs and inc_dirs are used to search for files;
|
||||
# if a file is found in one of those directories, it can
|
||||
# be assumed that no additional -I,-L directives are needed.
|
||||
- lib_dirs = self.compiler.library_dirs + [
|
||||
- '/lib64', '/usr/lib64',
|
||||
- '/lib', '/usr/lib',
|
||||
- ]
|
||||
- inc_dirs = self.compiler.include_dirs + ['/usr/include']
|
||||
+ lib_dirs = self.compiler.library_dirs
|
||||
+ inc_dirs = self.compiler.include_dirs
|
||||
exts = []
|
||||
missing = []
|
||||
|
@ -0,0 +1,41 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index f7f190f..6ca7a1d 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -270,36 +270,6 @@ class PyBuildExt(build_ext):
|
||||
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)')
|
||||
- except:
|
||||
- exc_type, why, tb = sys.exc_info()
|
||||
- self.announce('*** WARNING: importing extension "%s" '
|
||||
- 'failed with %s: %s' % (ext.name, exc_type, why),
|
||||
- level=3)
|
||||
- self.failed.append(ext.name)
|
||||
|
||||
def get_platform(self):
|
||||
|
@ -1,108 +0,0 @@
|
||||
diff -urN Python-2.5.1.orig/Include/pyerrors.h Python-2.5.1/Include/pyerrors.h
|
||||
--- Python-2.5.1.orig/Include/pyerrors.h 2008-08-10 13:46:48.000000000 +0200
|
||||
+++ Python-2.5.1/Include/pyerrors.h 2008-08-10 13:51:05.000000000 +0200
|
||||
@@ -239,6 +239,9 @@
|
||||
PyAPI_FUNC(int) PyErr_CheckSignals(void);
|
||||
PyAPI_FUNC(void) PyErr_SetInterrupt(void);
|
||||
|
||||
+/* In signalmodule.c */
|
||||
+int PySignal_SetWakeupFd(int fd);
|
||||
+
|
||||
/* Support for adding program text to SyntaxErrors */
|
||||
PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int);
|
||||
PyAPI_FUNC(PyObject *) PyErr_ProgramText(const char *, int);
|
||||
diff -urN Python-2.5.1.orig/Modules/signalmodule.c Python-2.5.1/Modules/signalmodule.c
|
||||
--- Python-2.5.1.orig/Modules/signalmodule.c 2008-08-10 13:46:48.000000000 +0200
|
||||
+++ Python-2.5.1/Modules/signalmodule.c 2008-08-10 13:50:02.000000000 +0200
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
+#include <sys/stat.h>
|
||||
+
|
||||
#ifndef SIG_ERR
|
||||
#define SIG_ERR ((PyOS_sighandler_t)(-1))
|
||||
#endif
|
||||
@@ -75,4 +77,6 @@
|
||||
PyObject *func;
|
||||
} Handlers[NSIG];
|
||||
|
||||
+static int wakeup_fd = -1;
|
||||
+
|
||||
/* Speed up sigcheck() when none tripped */
|
||||
@@ -112,6 +116,7 @@
|
||||
static void
|
||||
signal_handler(int sig_num)
|
||||
{
|
||||
+ const char dummy_byte = '\0';
|
||||
#ifdef WITH_THREAD
|
||||
#ifdef WITH_PTH
|
||||
if (PyThread_get_thread_ident() != main_thread) {
|
||||
@@ -125,6 +130,8 @@
|
||||
is_tripped++;
|
||||
Handlers[sig_num].tripped = 1;
|
||||
Py_AddPendingCall(checksignals_witharg, NULL);
|
||||
+ if (wakeup_fd != -1)
|
||||
+ write(wakeup_fd, &dummy_byte, 1);
|
||||
#ifdef WITH_THREAD
|
||||
}
|
||||
#endif
|
||||
@@ -264,6 +271,50 @@
|
||||
anything else -- the callable Python object used as a handler");
|
||||
|
||||
|
||||
+static PyObject *
|
||||
+signal_set_wakeup_fd(PyObject *self, PyObject *args)
|
||||
+{
|
||||
+ struct stat buf;
|
||||
+ int fd, old_fd;
|
||||
+ if (!PyArg_ParseTuple(args, "i:set_wakeup_fd", &fd))
|
||||
+ return NULL;
|
||||
+#ifdef WITH_THREAD
|
||||
+ if (PyThread_get_thread_ident() != main_thread) {
|
||||
+ PyErr_SetString(PyExc_ValueError,
|
||||
+ "set_wakeup_fd only works in main thread");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+#endif
|
||||
+ if (fd != -1 && fstat(fd, &buf) != 0) {
|
||||
+ PyErr_SetString(PyExc_ValueError, "invalid fd");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ old_fd = wakeup_fd;
|
||||
+ wakeup_fd = fd;
|
||||
+ return PyLong_FromLong(old_fd);
|
||||
+}
|
||||
+
|
||||
+PyDoc_STRVAR(set_wakeup_fd_doc,
|
||||
+"set_wakeup_fd(fd) -> fd\n\
|
||||
+\n\
|
||||
+Sets the fd to be written to (with '\\0') when a signal\n\
|
||||
+comes in. A library can use this to wakeup select or poll.\n\
|
||||
+The previous fd is returned.\n\
|
||||
+\n\
|
||||
+The fd must be non-blocking.");
|
||||
+
|
||||
+/* C API for the same, without all the error checking */
|
||||
+int
|
||||
+PySignal_SetWakeupFd(int fd)
|
||||
+{
|
||||
+ int old_fd = wakeup_fd;
|
||||
+ if (fd < 0)
|
||||
+ fd = -1;
|
||||
+ wakeup_fd = fd;
|
||||
+ return old_fd;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/* List of functions defined in the module */
|
||||
static PyMethodDef signal_methods[] = {
|
||||
#ifdef HAVE_ALARM
|
||||
@@ -271,6 +322,7 @@
|
||||
#endif
|
||||
{"signal", signal_signal, METH_VARARGS, signal_doc},
|
||||
{"getsignal", signal_getsignal, METH_VARARGS, getsignal_doc},
|
||||
+ {"set_wakeup_fd", signal_set_wakeup_fd, METH_VARARGS, set_wakeup_fd_doc},
|
||||
#ifdef HAVE_PAUSE
|
||||
{"pause", (PyCFunction)signal_pause,
|
||||
METH_NOARGS,pause_doc},
|
@ -1,7 +1,8 @@
|
||||
diff -ruN Python-2.5.4.orig/Lib/distutils/command/build_scripts.py Python-2.5.4/Lib/distutils/command/build_scripts.py
|
||||
--- Python-2.5.4.orig/Lib/distutils/command/build_scripts.py 2009-01-11 06:17:43.000000000 +0100
|
||||
+++ Python-2.5.4/Lib/distutils/command/build_scripts.py 2009-01-11 15:01:54.000000000 +0100
|
||||
@@ -54,15 +54,10 @@
|
||||
diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py
|
||||
index c0d8f70..d36e29c 100644
|
||||
--- a/Lib/distutils/command/build_scripts.py
|
||||
+++ b/Lib/distutils/command/build_scripts.py
|
||||
@@ -51,10 +51,7 @@ class build_scripts (Command):
|
||||
|
||||
|
||||
def copy_scripts (self):
|
||||
@ -9,19 +10,20 @@ diff -ruN Python-2.5.4.orig/Lib/distutils/command/build_scripts.py Python-2.5.4/
|
||||
- Python script in the Unix way (first line matches 'first_line_re',
|
||||
- ie. starts with "\#!" and contains "python"), then adjust the first
|
||||
- line to refer to the current Python interpreter as we copy.
|
||||
- """
|
||||
+ """Copy each script listed in 'self.scripts'"""
|
||||
+ """Copy each script listed in 'self.scripts';
|
||||
"""
|
||||
self.mkpath(self.build_dir)
|
||||
outfiles = []
|
||||
for script in self.scripts:
|
||||
- adjust = 0
|
||||
script = convert_path(script)
|
||||
outfile = os.path.join(self.build_dir, os.path.basename(script))
|
||||
outfiles.append(outfile)
|
||||
@@ -86,34 +81,12 @@
|
||||
self.warn("%s is an empty file (skipping)" % script)
|
||||
continue
|
||||
|
||||
@@ -77,41 +74,9 @@ class build_scripts (Command):
|
||||
if not self.dry_run:
|
||||
raise
|
||||
f = None
|
||||
- else:
|
||||
- first_line = f.readline()
|
||||
- if not first_line:
|
||||
- self.warn("%s is an empty file (skipping)" % script)
|
||||
- continue
|
||||
-
|
||||
- match = first_line_re.match(first_line)
|
||||
- if match:
|
||||
- adjust = 1
|
||||
@ -40,7 +42,8 @@ diff -ruN Python-2.5.4.orig/Lib/distutils/command/build_scripts.py Python-2.5.4/
|
||||
- outf.write("#!%s%s\n" %
|
||||
- (os.path.join(
|
||||
- sysconfig.get_config_var("BINDIR"),
|
||||
- "python" + sysconfig.get_config_var("EXE")),
|
||||
- "python" + sysconfig.get_config_var("VERSION")
|
||||
- + sysconfig.get_config_var("EXE")),
|
||||
- post_interp))
|
||||
- outf.writelines(f.readlines())
|
||||
- outf.close()
|
||||
@ -52,9 +55,6 @@ diff -ruN Python-2.5.4.orig/Lib/distutils/command/build_scripts.py Python-2.5.4/
|
||||
- self.copy_file(script, outfile)
|
||||
+ if f:
|
||||
+ f.close()
|
||||
+
|
||||
+ log.info("copying %s -> %s", script,
|
||||
+ self.build_dir)
|
||||
+ self.copy_file(script, outfile)
|
||||
|
||||
if os.name == 'posix':
|
||||
|
Reference in New Issue
Block a user