1 # We need to ensure our host tools get run during build, not the freshly
2 # built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN.
3 # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
5 Index: Python-2.6.6/Makefile.pre.in
6 ===================================================================
7 --- Python-2.6.6.orig/Makefile.pre.in
8 +++ Python-2.6.6/Makefile.pre.in
9 @@ -175,6 +175,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
12 BUILDPYTHON= python$(BUILDEXE)
13 +HOSTPYTHON= $(BUILDPYTHON)
15 # The task to run while instrument when building the profile-opt target
16 PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
17 @@ -205,7 +206,7 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
18 ##########################################################################
20 PGEN= Parser/pgen$(EXE)
22 +HOSTPGEN= $(PGEN)$(EXE)
26 @@ -394,8 +395,8 @@ platform: $(BUILDPYTHON)
27 # Build the shared modules
28 sharedmods: $(BUILDPYTHON)
29 @case $$MAKEFLAGS in \
30 - *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
31 - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
32 + *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
33 + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
36 # Build static library
37 @@ -517,7 +518,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
39 $(GRAMMAR_STAMP): $(PGEN) $(GRAMMAR_INPUT)
40 -@$(INSTALL) -d Include
41 - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
42 + -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
43 touch $(GRAMMAR_STAMP)
46 @@ -887,23 +888,23 @@ libinstall: build_all $(srcdir)/Lib/$(PL
48 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
49 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
50 - ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
51 + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
53 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
54 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
55 - ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
56 + $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
58 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
59 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
60 - ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
61 + $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
62 -d $(LIBDEST)/site-packages -f \
63 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
64 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
65 - ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
66 + $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
67 -d $(LIBDEST)/site-packages -f \
68 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
69 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
70 - ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
71 + $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
73 # Create the PLATDIR source directory, if one wasn't distributed..
74 $(srcdir)/Lib/$(PLATDIR):
75 @@ -1001,7 +1002,7 @@ libainstall: all
76 # Install the dynamically loadable modules
77 # This goes into $(exec_prefix)
79 - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
80 + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
82 --install-scripts=$(BINDIR) \
83 --install-platlib=$(DESTSHARED) \
84 Index: Python-2.6.6/setup.py
85 ===================================================================
86 --- Python-2.6.6.orig/setup.py
87 +++ Python-2.6.6/setup.py
88 @@ -322,6 +322,7 @@ class PyBuildExt(build_ext):
89 self.failed.append(ext.name)
90 self.announce('*** WARNING: renaming "%s" since importing it'
91 ' failed: %s' % (ext.name, why), level=3)
93 assert not self.inplace
94 basename, tail = os.path.splitext(ext_filename)
95 newname = basename + "_failed" + tail
96 @@ -356,8 +357,8 @@ class PyBuildExt(build_ext):
98 def detect_modules(self):
99 # Ensure that /usr/local is always used
100 - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
101 - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
102 + # add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
103 + # add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
105 # Add paths specified in the environment variables LDFLAGS and
106 # CPPFLAGS for header and library files.
107 @@ -456,6 +457,9 @@ class PyBuildExt(build_ext):
109 # XXX Omitted modules: gl, pure, dl, SGI-specific modules
111 + lib_dirs = [ os.getenv( "STAGING_LIBDIR" ) ]
112 + inc_dirs = [ os.getenv( "STAGING_INCDIR" ) ]
115 # The following modules are all pretty straightforward, and compile
116 # on pretty much any POSIXish platform.