Default gumstix configuration changed
[gumsense-br.git] / package / python / python-cross-compile.patch
blob6a78648008bf88e1ebcce2c15ae7c00826e3f2c1
1 Ripped from OpenEmbedded
3 --- Python-2.4c1/Makefile.pre.in
4 +++ Python-2.4c1/Makefile.pre.in
5 @@ -162,6 +162,7 @@
7 PYTHON= python$(EXE)
8 BUILDPYTHON= python$(BUILDEXE)
9 +HOSTPYTHON= $(BUILDPYTHON)
11 # === Definitions added by makesetup ===
13 @@ -188,7 +189,7 @@
14 ##########################################################################
15 # Parser
16 PGEN= Parser/pgen$(EXE)
18 +HOSTPGEN= $(PGEN)$(EXE)
19 POBJS= \
20 Parser/acceler.o \
21 Parser/grammar1.o \
22 @@ -320,8 +321,8 @@
23 # Build the shared modules
24 sharedmods: $(BUILDPYTHON)
25 case $$MAKEFLAGS in \
26 - *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
27 - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
28 + *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
29 + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
30 esac
32 # buildno should really depend on something like LIBRARY_SRC
33 @@ -442,7 +443,7 @@
36 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
37 - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
38 + -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
40 $(PGEN): $(PGENOBJS)
41 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
42 @@ -718,19 +719,19 @@
43 done
44 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
45 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
46 - ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
47 + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
48 -d $(LIBDEST) -f \
49 -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
50 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
51 - ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
52 + $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
53 -d $(LIBDEST) -f \
54 -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
55 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
56 - ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
57 + $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
58 -d $(LIBDEST)/site-packages -f \
59 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
60 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
61 - ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
62 + $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
63 -d $(LIBDEST)/site-packages -f \
64 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
66 @@ -825,7 +826,7 @@
67 # Install the dynamically loadable modules
68 # This goes into $(exec_prefix)
69 sharedinstall:
70 - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
71 + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
72 --prefix=$(prefix) \
73 --install-scripts=$(BINDIR) \
74 --install-platlib=$(DESTSHARED) \
75 --- Python-2.4c1/setup.py
76 +++ Python-2.4c1/setup.py
77 @@ -206,6 +206,7 @@
78 try:
79 imp.load_dynamic(ext.name, ext_filename)
80 except ImportError, why:
81 + return
82 self.announce('*** WARNING: renaming "%s" since importing it'
83 ' failed: %s' % (ext.name, why), level=3)
84 assert not self.inplace
85 @@ -239,8 +240,6 @@
87 def detect_modules(self):
88 # Ensure that /usr/local is always used
89 - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
90 - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
92 # Add paths to popular package managers on OS X/darwin
93 if sys.platform == "darwin":
94 @@ -260,12 +260,6 @@
95 add_dir_to_list(self.compiler.library_dirs, '/opt/local/lib')
96 add_dir_to_list(self.compiler.include_dirs, '/opt/local/include')
98 - if os.path.normpath(sys.prefix) != '/usr':
99 - add_dir_to_list(self.compiler.library_dirs,
100 - sysconfig.get_config_var("LIBDIR"))
101 - add_dir_to_list(self.compiler.include_dirs,
102 - sysconfig.get_config_var("INCLUDEDIR"))
104 try:
105 have_unicode = unicode
106 except NameError: