[packages/python] partially revert commit 31092, apply changes for real now - stupid me..

git-svn-id: svn://svn.openwrt.org/openwrt/packages@31140 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
mirko
2012-03-29 14:11:26 +00:00
parent ff029ef59c
commit 5015286f7f
13 changed files with 119 additions and 888 deletions

View File

@ -4,7 +4,7 @@
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -175,6 +175,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
@@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
PYTHON= python$(EXE)
BUILDPYTHON= python$(BUILDEXE)
@ -12,16 +12,15 @@
# 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
@@ -205,7 +206,7 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
@@ -214,6 +215,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
##########################################################################
# Parser
PGEN= Parser/pgen$(EXE)
-
+HOSTPGEN= $(PGEN)$(EXE)
POBJS= \
Parser/acceler.o \
Parser/grammar1.o \
@@ -370,7 +371,7 @@ build_all_generate_profile:
@@ -384,7 +386,7 @@ build_all_generate_profile:
$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
run_profile_task:
@ -30,12 +29,12 @@
build_all_use_profile:
$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
@@ -388,14 +389,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
@@ -402,14 +404,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
$(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
- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
+ $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
# Build the shared modules
@ -48,34 +47,34 @@
esac
# Build static library
@@ -517,7 +518,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
@@ -543,7 +545,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
$(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
-@$(INSTALL) -d Include
- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-touch Parser/pgen.stamp
$(PGEN): $(PGENOBJS)
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
@@ -676,7 +677,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
@@ -708,7 +710,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
TESTOPTS= -l $(EXTRATESTOPTS)
TESTPROG= $(srcdir)/Lib/test/regrtest.py
-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
+TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -E -tt
-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
+TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
test: all platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
@@ -1001,7 +1002,7 @@ libainstall: all
@@ -1062,7 +1064,7 @@ libainstall: all python-config
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall:
sharedinstall: sharedmods
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
@@ -1039,7 +1040,7 @@ frameworkinstallstructure: $(LDLIBRARY)
@@ -1100,7 +1102,7 @@ frameworkinstallstructure: $(LDLIBRARY)
fi; \
done
$(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
@ -84,7 +83,7 @@
$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
@@ -1081,7 +1082,7 @@ frameworkinstallextras:
@@ -1135,7 +1137,7 @@ frameworkinstallextras:
# This installs a few of the useful scripts in Tools/scripts
scriptsinstall:
SRCDIR=$(srcdir) $(RUNSHARED) \
@ -92,8 +91,8 @@
+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--root=/$(DESTDIR)
@@ -1103,7 +1104,7 @@ config.status: $(srcdir)/configure
--root=$(DESTDIR)/
@@ -1157,7 +1159,7 @@ config.status: $(srcdir)/configure
# Run reindent on the library
reindent:
@ -102,7 +101,7 @@
# Rerun configure with the same options as it was run last time,
# provided the config.status script exists
@@ -1200,7 +1201,7 @@ funny:
@@ -1260,7 +1262,7 @@ funny:
# Perform some verification checks on any modified files.
patchcheck:

View File

@ -1,89 +0,0 @@
---
configure.in | 46 ++++++++++++++++++++++++++++++++++------------
1 file changed, 34 insertions(+), 12 deletions(-)
--- a/configure.in
+++ b/configure.in
@@ -2653,6 +2653,7 @@ AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_
# 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>
@@ -2662,12 +2663,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>
@@ -2677,10 +2685,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
@@ -3781,6 +3795,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>
@@ -3814,10 +3829,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,

View File

@ -1,20 +0,0 @@
--- a/configure
+++ b/configure
@@ -2070,6 +2070,7 @@ then
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
+ linux3) MACHDEP="linux2";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
atheos*) MACHDEP="atheos";;
--- a/configure.in
+++ b/configure.in
@@ -240,6 +240,7 @@ then
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
+ linux3) MACHDEP="linux2";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
atheos*) MACHDEP="atheos";;

View File

@ -4,18 +4,20 @@
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -887,22 +887,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL
done; \
done
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
@@ -940,26 +940,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
fi
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- $(DESTDIR)$(LIBDEST)
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- $(DESTDIR)$(LIBDEST)
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
@ -24,6 +26,8 @@
- ./$(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()"
- -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):

View File

@ -4,29 +4,37 @@
--- a/setup.py
+++ b/setup.py
@@ -309,9 +309,6 @@ class PyBuildExt(build_ext):
return sys.platform
@@ -368,11 +368,6 @@ class PyBuildExt(build_ext):
os.unlink(tmpfile)
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')
- self.add_multiarch_paths()
-
# Add paths specified in the environment variables LDFLAGS and
# CPPFLAGS for header and library files.
@@ -347,11 +344,6 @@ class PyBuildExt(build_ext):
# We must get the values from the Makefile and not the environment
@@ -407,17 +402,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':
- if os.path.normpath(sys.prefix) != '/usr' \
- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
- # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
- # (PYTHONFRAMEWORK is set) to avoid # linking problems when
- # building a framework with different architectures than
- # the one that is currently installed (issue #7473)
- 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):
except NameError:
@@ -426,11 +410,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.

View File

@ -4,7 +4,7 @@
--- a/setup.py
+++ b/setup.py
@@ -270,36 +270,6 @@ class PyBuildExt(build_ext):
@@ -307,36 +307,6 @@ class PyBuildExt(build_ext):
ext_filename = os.path.join(
self.build_lib,
self.get_ext_filename(self.get_ext_fullname(ext.name)))

View File

@ -4,7 +4,7 @@
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1118,11 +1118,11 @@ TAGS::
@@ -1169,12 +1169,12 @@ TAGS::
# Sanitation targets -- clean leaves libraries, executables and tags
# files, which clobber removes as well
pycremoval:
@ -12,10 +12,12 @@
+ find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';'
clean: pycremoval
- find . -name '*.o' -exec rm -f {} ';'
- find . -name '*.[oa]' -exec rm -f {} ';'
- find . -name '*.s[ol]' -exec rm -f {} ';'
+ find . ! -path './ipkg-install/*' -name '*.o' -exec rm -f {} ';'
- find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
+ find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';'
+ find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';'
find $(srcdir)/build -name 'fficonfig.h' -exec rm -f {} ';' || true
find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true
+ find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
find build -name 'fficonfig.h' -exec rm -f {} ';' || true
find build -name 'fficonfig.py' -exec rm -f {} ';' || true
-rm -f Lib/lib2to3/*Grammar*.pickle

View File

@ -4,7 +4,7 @@
--- a/Lib/distutils/command/build_scripts.py
+++ b/Lib/distutils/command/build_scripts.py
@@ -54,10 +54,7 @@ class build_scripts (Command):
@@ -51,10 +51,7 @@ class build_scripts (Command):
def copy_scripts (self):
@ -14,9 +14,9 @@
- line to refer to the current Python interpreter as we copy.
+ """Copy each script listed in 'self.scripts'
"""
_sysconfig = __import__('sysconfig')
self.mkpath(self.build_dir)
outfiles = []
@@ -80,41 +77,9 @@ class build_scripts (Command):
@@ -78,41 +75,9 @@ class build_scripts (Command):
if not self.dry_run:
raise
f = None
@ -36,16 +36,16 @@
- self.build_dir)
- if not self.dry_run:
- outf = open(outfile, "w")
- if not sysconfig.python_build:
- if not _sysconfig.is_python_build():
- outf.write("#!%s%s\n" %
- (self.executable,
- post_interp))
- else:
- outf.write("#!%s%s\n" %
- (os.path.join(
- sysconfig.get_config_var("BINDIR"),
- "python%s%s" % (sysconfig.get_config_var("VERSION"),
- sysconfig.get_config_var("EXE"))),
- _sysconfig.get_config_var("BINDIR"),
- "python%s%s" % (_sysconfig.get_config_var("VERSION"),
- _sysconfig.get_config_var("EXE"))),
- post_interp))
- outf.writelines(f.readlines())
- outf.close()

View File

@ -1,16 +0,0 @@
---
Lib/ctypes/__init__.py | 6 ------
1 file changed, 6 deletions(-)
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -538,9 +538,3 @@ for kind in [c_ushort, c_uint, c_ulong,
elif sizeof(kind) == 4: c_uint32 = kind
elif sizeof(kind) == 8: c_uint64 = kind
del(kind)
-
-# XXX for whatever reasons, creating the first instance of a callback
-# function is needed for the unittests on Win64 to succeed. This MAY
-# be a compiler bug, since the problem occurs only when _ctypes is
-# compiled with the MS SDK compiler. Or an uninitialized variable?
-CFUNCTYPE(c_int)(lambda: None)

View File

@ -4,26 +4,21 @@
--- a/setup.py
+++ b/setup.py
@@ -622,9 +622,10 @@ class PyBuildExt(build_ext):
@@ -704,8 +704,7 @@ class PyBuildExt(build_ext):
#print 'openssl_ver = 0x%08x' % openssl_ver
min_openssl_ver = 0x00907000
have_any_openssl = ssl_incs is not None and ssl_libs is not None
- have_usable_openssl = (have_any_openssl and
- openssl_ver >= min_openssl_ver)
+ have_usable_openssl = False
- if (ssl_incs is not None and
- ssl_libs is not None and
- openssl_ver >= 0x00907000):
+# if (ssl_incs is not None and
+# ssl_libs is not None and
+# openssl_ver >= 0x00907000):
+ if False:
# The _hashlib module wraps optimized implementations
# of hash functions from the OpenSSL library.
exts.append( Extension('_hashlib', ['_hashopenssl.c'],
@@ -644,7 +645,8 @@ class PyBuildExt(build_ext):
if have_any_openssl:
if have_usable_openssl:
@@ -730,7 +729,7 @@ class PyBuildExt(build_ext):
depends = ['md5.h']) )
missing.append('_hashlib')
- if (openssl_ver < 0x00908000):
+# if (openssl_ver < 0x00908000):
min_sha2_openssl_ver = 0x00908000
- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:
+ if True:
# OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
exts.append( Extension('_sha256', ['sha256module.c']) )