update to python-2.4.1 with the help of open embedded

This commit is contained in:
Mike Frysinger 2005-08-13 02:45:34 +00:00
parent 2b374759b4
commit 7c64d3c23d
2 changed files with 32 additions and 43 deletions

View File

@ -1,34 +1,36 @@
--- Python-2.3.4/Makefile.pre.in.orig 2003-11-18 14:54:00.000000000 -0500 Ripped from OpenEmbedded
+++ Python-2.3.4/Makefile.pre.in 2004-07-29 21:44:47.075924464 -0400
@@ -159,6 +159,7 @@ --- Python-2.4c1/Makefile.pre.in
+++ Python-2.4c1/Makefile.pre.in
@@ -162,6 +162,7 @@
PYTHON= python$(EXE) PYTHON= python$(EXE)
BUILDPYTHON= python$(BUILDEXE) BUILDPYTHON= python$(BUILDEXE)
+HOSTPYTHON= ./$(BUILDPYTHON) +HOSTPYTHON= $(BUILDPYTHON)
# === Definitions added by makesetup === # === Definitions added by makesetup ===
@@ -186,6 +187,8 @@ @@ -188,7 +189,7 @@
##########################################################################
# Parser # Parser
PGEN= Parser/pgen$(EXE) PGEN= Parser/pgen$(EXE)
-
+HOSTPGEN= $(PGEN) +HOSTPGEN= $(PGEN)$(EXE)
+
POBJS= \ POBJS= \
Parser/acceler.o \ Parser/acceler.o \
Parser/grammar1.o \ Parser/grammar1.o \
@@ -314,8 +317,8 @@ @@ -320,8 +321,8 @@
# Build the shared modules # Build the shared modules
sharedmods: $(BUILDPYTHON) sharedmods: $(BUILDPYTHON)
case $$MAKEFLAGS in \ case $$MAKEFLAGS in \
- *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ - *-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;; \ - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' CROSS_COMPILE='yes' OPT='$(OPT)' DESTDIR='$(DESTDIR)' $(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)' CROSS_COMPILE='yes' OPT='$(OPT)' DESTDIR='$(DESTDIR)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
esac esac
# buildno should really depend on something like LIBRARY_SRC # buildno should really depend on something like LIBRARY_SRC
@@ -432,7 +435,7 @@ @@ -442,7 +443,7 @@
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
@ -37,7 +39,7 @@
$(PGEN): $(PGENOBJS) $(PGEN): $(PGENOBJS)
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
@@ -705,19 +708,19 @@ @@ -718,19 +719,19 @@
done done
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
@ -50,68 +52,55 @@
+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ + $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \ -d $(LIBDEST) -f \
-x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST) -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ - ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ + $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \ -d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ - ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ + $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \ -d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
@@ -812,7 +815,8 @@ @@ -825,7 +826,7 @@
# Install the dynamically loadable modules # Install the dynamically loadable modules
# This goes into $(exec_prefix) # This goes into $(exec_prefix)
sharedinstall: sharedinstall:
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \ + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
+ $(HOSTPYTHON) -E $(srcdir)/setup.py install \
--prefix=$(prefix) \ --prefix=$(prefix) \
--install-scripts=$(BINDIR) \ --install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \ --install-platlib=$(DESTSHARED) \
--- Python-2.3.4/setup.py.orig 2004-07-29 21:32:12.993562408 -0400 --- Python-2.4c1/setup.py
+++ Python-2.3.4/setup.py 2004-07-29 21:47:12.174866072 -0400 +++ Python-2.4c1/setup.py
@@ -213,6 +213,7 @@ @@ -206,6 +206,7 @@
try: try:
imp.load_dynamic(ext.name, ext_filename) imp.load_dynamic(ext.name, ext_filename)
except ImportError, why: except ImportError, why:
+ if os.environ.get('CROSS_COMPILE') != "yes": + return
self.announce('*** WARNING: renaming "%s" since importing it' self.announce('*** WARNING: renaming "%s" since importing it'
' failed: %s' % (ext.name, why), level=3) ' failed: %s' % (ext.name, why), level=3)
assert not self.inplace assert not self.inplace
@@ -233,6 +234,9 @@ @@ -239,8 +240,6 @@
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" '
@@ -245,8 +245,9 @@
def detect_modules(self): def detect_modules(self):
# Ensure that /usr/local is always used # Ensure that /usr/local is always used
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ #add_dir_to_list(self.compiler.library_dirs, os.getenv('DESTDIR') + '/lib')
+ #add_dir_to_list(self.compiler.library_dirs, os.getenv('DESTDIR') + '/usr/lib')
+ #add_dir_to_list(self.compiler.include_dirs, os.getenv('DESTDIR') + '/usr/include')
# fink installs lots of goodies in /sw/... - make sure we # Add paths to popular package managers on OS X/darwin
# check there if sys.platform == "darwin":
@@ -254,11 +255,6 @@ @@ -260,12 +260,6 @@
add_dir_to_list(self.compiler.library_dirs, '/sw/lib') add_dir_to_list(self.compiler.library_dirs, '/opt/local/lib')
add_dir_to_list(self.compiler.include_dirs, '/sw/include') add_dir_to_list(self.compiler.include_dirs, '/opt/local/include')
- if os.path.normpath(sys.prefix) != '/usr': - if os.path.normpath(sys.prefix) != '/usr':
- add_dir_to_list(self.compiler.library_dirs, - add_dir_to_list(self.compiler.library_dirs,
- sysconfig.get_config_var("LIBDIR")) - sysconfig.get_config_var("LIBDIR"))
- add_dir_to_list(self.compiler.include_dirs, - add_dir_to_list(self.compiler.include_dirs,
- sysconfig.get_config_var("INCLUDEDIR")) - sysconfig.get_config_var("INCLUDEDIR"))
-
try: try:
have_unicode = unicode have_unicode = unicode
except NameError:

View File

@ -3,7 +3,7 @@
# python # python
# #
############################################################# #############################################################
PYTHON_VERSION=2.3.4 PYTHON_VERSION=2.4.1
PYTHON_SOURCE:=Python-$(PYTHON_VERSION).tar.bz2 PYTHON_SOURCE:=Python-$(PYTHON_VERSION).tar.bz2
PYTHON_SITE:=http://python.org/ftp/python/$(PYTHON_VERSION) PYTHON_SITE:=http://python.org/ftp/python/$(PYTHON_VERSION)
PYTHON_DIR:=$(BUILD_DIR)/Python-$(PYTHON_VERSION) PYTHON_DIR:=$(BUILD_DIR)/Python-$(PYTHON_VERSION)