update to python 2.5.1, security and bug fixes... clean up the makefile slightly...
[openwrt/svn-archive/archive.git] / lang / python / patches / 000-cross-compile.patch
1 Index: Python-2.5.1/Makefile.pre.in
2 ===================================================================
3 --- Python-2.5.1.orig/Makefile.pre.in 2007-07-30 12:55:24.000000000 -0500
4 +++ Python-2.5.1/Makefile.pre.in 2007-07-30 12:55:24.000000000 -0500
5 @@ -170,6 +170,7 @@
6
7 PYTHON= python$(EXE)
8 BUILDPYTHON= python$(BUILDEXE)
9 +HOSTPYTHON= $(BUILDPYTHON)
10
11 # === Definitions added by makesetup ===
12
13 @@ -196,7 +197,7 @@
14 ##########################################################################
15 # Parser
16 PGEN= Parser/pgen$(EXE)
17 -
18 +HOSTPGEN= $(PGEN)$(EXE)
19 POBJS= \
20 Parser/acceler.o \
21 Parser/grammar1.o \
22 @@ -345,8 +346,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
31
32 # Build static library
33 @@ -470,7 +471,7 @@
34
35
36 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
37 - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
38 + -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
39
40 $(PGEN): $(PGENOBJS)
41 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
42 @@ -885,7 +886,7 @@
43 # Install the dynamically loadable modules
44 # This goes into $(exec_prefix)
45 sharedinstall:
46 - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
47 + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
48 --prefix=$(prefix) \
49 --install-scripts=$(BINDIR) \
50 --install-platlib=$(DESTSHARED) \
51 Index: Python-2.5.1/setup.py
52 ===================================================================
53 --- Python-2.5.1.orig/setup.py 2007-07-30 12:55:24.000000000 -0500
54 +++ Python-2.5.1/setup.py 2007-07-30 12:57:10.000000000 -0500
55 @@ -209,6 +209,7 @@
56 try:
57 imp.load_dynamic(ext.name, ext_filename)
58 except ImportError, why:
59 + return
60 self.announce('*** WARNING: renaming "%s" since importing it'
61 ' failed: %s' % (ext.name, why), level=3)
62 assert not self.inplace
63 @@ -244,8 +245,6 @@
64
65 def detect_modules(self):
66 # Ensure that /usr/local is always used
67 - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
68 - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
69
70 # Add paths specified in the environment variables LDFLAGS and
71 # CPPFLAGS for header and library files.
72 @@ -279,12 +278,6 @@
73 for directory in options.dirs:
74 add_dir_to_list(dir_list, directory)
75
76 - if os.path.normpath(sys.prefix) != '/usr':
77 - add_dir_to_list(self.compiler.library_dirs,
78 - sysconfig.get_config_var("LIBDIR"))
79 - add_dir_to_list(self.compiler.include_dirs,
80 - sysconfig.get_config_var("INCLUDEDIR"))
81 -
82 try:
83 have_unicode = unicode
84 except NameError: