working python 2.5... no threading, yet.
git-svn-id: svn://svn.openwrt.org/openwrt/packages@7016 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@ -1,129 +1,82 @@
|
||||
diff -uN Python-2.4.3.orig/Makefile.pre.in Python-2.4.3.cc/Makefile.pre.in
|
||||
--- Python-2.4.3.orig/Makefile.pre.in 2006-03-13 07:08:41.000000000 -0600
|
||||
+++ Python-2.4.3.cc/Makefile.pre.in 2006-10-13 14:47:12.000000000 -0500
|
||||
@@ -162,6 +162,7 @@
|
||||
diff -ruNb Python-2.5.pris/Makefile.pre.in Python-2.5/Makefile.pre.in
|
||||
--- Python-2.5.pris/Makefile.pre.in 2006-07-30 11:20:10.000000000 -0500
|
||||
+++ Python-2.5/Makefile.pre.in 2007-04-19 17:02:07.078288000 -0500
|
||||
@@ -170,6 +170,7 @@
|
||||
|
||||
PYTHON= python$(EXE)
|
||||
BUILDPYTHON= python$(BUILDEXE)
|
||||
+HOSTPYTHON= ./$(BUILDPYTHON)
|
||||
+HOSTPYTHON= $(BUILDPYTHON)
|
||||
|
||||
# === Definitions added by makesetup ===
|
||||
|
||||
@@ -189,6 +190,8 @@
|
||||
@@ -196,7 +197,7 @@
|
||||
##########################################################################
|
||||
# Parser
|
||||
PGEN= Parser/pgen$(EXE)
|
||||
|
||||
+HOSTPGEN= $(PGEN)
|
||||
+
|
||||
-
|
||||
+HOSTPGEN= $(PGEN)$(EXE)
|
||||
POBJS= \
|
||||
Parser/acceler.o \
|
||||
Parser/grammar1.o \
|
||||
@@ -320,8 +323,8 @@
|
||||
@@ -345,8 +346,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*) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
|
||||
+ *) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -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
|
||||
|
||||
# buildno should really depend on something like LIBRARY_SRC
|
||||
@@ -442,8 +445,7 @@
|
||||
# Build static library
|
||||
@@ -470,7 +471,7 @@
|
||||
|
||||
|
||||
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
|
||||
- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
||||
-
|
||||
+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
||||
|
||||
$(PGEN): $(PGENOBJS)
|
||||
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
|
||||
|
||||
@@ -723,19 +725,19 @@
|
||||
done
|
||||
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
|
||||
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
-d $(LIBDEST) -f \
|
||||
-x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
|
||||
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
-d $(LIBDEST) -f \
|
||||
-x '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
|
||||
|
||||
@@ -830,7 +832,8 @@
|
||||
@@ -885,7 +886,7 @@
|
||||
# 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)' \
|
||||
+ $(HOSTPYTHON) -E $(srcdir)/setup.py install \
|
||||
+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
|
||||
--prefix=$(prefix) \
|
||||
--install-scripts=$(BINDIR) \
|
||||
--install-platlib=$(DESTSHARED) \
|
||||
diff -uN Python-2.4.3.orig/setup.py Python-2.4.3.cc/setup.py
|
||||
--- Python-2.4.3.orig/setup.py 2006-03-23 13:07:46.000000000 -0600
|
||||
+++ Python-2.4.3.cc/setup.py 2006-10-13 15:36:01.000000000 -0500
|
||||
@@ -205,26 +205,30 @@
|
||||
diff -ruNb Python-2.5.pris/setup.py Python-2.5/setup.py
|
||||
--- Python-2.5.pris/setup.py 2006-08-09 18:42:18.000000000 -0500
|
||||
+++ Python-2.5/setup.py 2007-04-19 16:58:15.395808750 -0500
|
||||
@@ -209,6 +209,7 @@
|
||||
try:
|
||||
imp.load_dynamic(ext.name, ext_filename)
|
||||
except ImportError, why:
|
||||
- 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)
|
||||
+ return
|
||||
self.announce('*** WARNING: renaming "%s" since importing it'
|
||||
' failed: %s' % (ext.name, why), level=3)
|
||||
assert not self.inplace
|
||||
@@ -244,8 +245,6 @@
|
||||
|
||||
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.
|
||||
@@ -279,12 +278,6 @@
|
||||
for directory in 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"))
|
||||
-
|
||||
- # 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') != "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" '
|
||||
try:
|
||||
have_unicode = unicode
|
||||
except NameError:
|
||||
|
Reference in New Issue
Block a user