summaryrefslogtreecommitdiffstats
path: root/patches/Python-2.3
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2003-09-08 23:45:22 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2003-09-08 23:45:22 +0000
commit7326c4eeaeb38b0ac34701626f46af109a1b8cbf (patch)
tree6dd455c0e7a69ea175fd2f52202d49bef7d953c2 /patches/Python-2.3
parent49fa4cbe31c6261b9c5586cba2af8f99be212231 (diff)
downloadptxdist-7326c4eeaeb38b0ac34701626f46af109a1b8cbf.tar.gz
ptxdist-7326c4eeaeb38b0ac34701626f46af109a1b8cbf.tar.xz
* inital add
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunk@281 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'patches/Python-2.3')
-rw-r--r--patches/Python-2.3/python23-xcompile.diff134
1 files changed, 134 insertions, 0 deletions
diff --git a/patches/Python-2.3/python23-xcompile.diff b/patches/Python-2.3/python23-xcompile.diff
new file mode 100644
index 000000000..9432aa20e
--- /dev/null
+++ b/patches/Python-2.3/python23-xcompile.diff
@@ -0,0 +1,134 @@
+#
+# thanks to David R Bacon for this patch
+#
+# http://biscuit.user.cis.ksu.edu/~dbacon/python23-xcompile.patch.bz2
+#
+# it's based on Klaus Reimer patch
+# http://www.ailis.de/~k/patches/
+#
+--- Python-2.3/Makefile.pre.in 2003-07-13 05:10:42.000000000 -0500
++++ Python-2.3-patched/Makefile.pre.in 2003-09-03 22:24:26.000000000 -0500
+@@ -159,6 +159,7 @@
+
+ PYTHON= python$(EXE)
+ BUILDPYTHON= python$(BUILDEXE)
++HOSTPYTHON= ./$(BUILDPYTHON)
+
+ # === Definitions added by makesetup ===
+
+@@ -186,6 +187,8 @@
+ # Parser
+ PGEN= Parser/pgen$(EXE)
+
++HOSTPGEN= $(PGEN)
++
+ POBJS= \
+ Parser/acceler.o \
+ Parser/grammar1.o \
+@@ -314,8 +317,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
+
+ # buildno should really depend on something like LIBRARY_SRC
+@@ -432,7 +435,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)
+@@ -702,19 +705,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
+
+@@ -809,7 +812,9 @@
+ # Install the dynamically loadable modules
+ # This goes into $(exec_prefix)
+ sharedinstall:
+- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
++ LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
++ CROSS_COMPILE='$(CROSS_COMPILE)' \
++ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --install-platlib=$(DESTSHARED) \
+--- Python-2.3/setup.py 2003-07-10 07:48:39.000000000 -0500
++++ Python-2.3-patched/setup.py 2003-09-03 22:29:42.000000000 -0500
+@@ -206,26 +206,29 @@
+ 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)
+-
+- # 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('stuff and things')
+ except:
+ exc_type, why, tb = sys.exc_info()
+ self.announce('*** WARNING: importing extension "%s" '