summaryrefslogtreecommitdiffstats
path: root/meta/packages/python/python-2.6.1/04-default-is-optimized.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/python/python-2.6.1/04-default-is-optimized.patch')
-rw-r--r--meta/packages/python/python-2.6.1/04-default-is-optimized.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/packages/python/python-2.6.1/04-default-is-optimized.patch b/meta/packages/python/python-2.6.1/04-default-is-optimized.patch
new file mode 100644
index 0000000000..805f4f696c
--- /dev/null
+++ b/meta/packages/python/python-2.6.1/04-default-is-optimized.patch
@@ -0,0 +1,52 @@
1# when compiling for an embedded system, we need every bit of
2# performance we can get. default to optimized with the option
3# of opt-out.
4# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
5
6Index: Python-2.6.1/Python/compile.c
7===================================================================
8--- Python-2.6.1.orig/Python/compile.c
9+++ Python-2.6.1/Python/compile.c
10@@ -32,7 +32,7 @@
11 #include "symtable.h"
12 #include "opcode.h"
13
14-int Py_OptimizeFlag = 0;
15+int Py_OptimizeFlag = 1;
16
17 #define DEFAULT_BLOCK_SIZE 16
18 #define DEFAULT_BLOCKS 8
19Index: Python-2.6.1/Modules/main.c
20===================================================================
21--- Python-2.6.1.orig/Modules/main.c
22+++ Python-2.6.1/Modules/main.c
23@@ -40,7 +40,7 @@ static char **orig_argv;
24 static int orig_argc;
25
26 /* command line options */
27-#define BASE_OPTS "3bBc:dEhiJm:OQ:sStuUvVW:xX?"
28+#define BASE_OPTS "3bBc:dEhiJm:NOQ:sStuUvVW:xX?"
29
30 #ifndef RISCOS
31 #define PROGRAM_OPTS BASE_OPTS
32@@ -69,8 +69,7 @@ Options and arguments (and corresponding
33 static char *usage_2 = "\
34 if stdin does not appear to be a terminal; also PYTHONINSPECT=x\n\
35 -m mod : run library module as a script (terminates option list)\n\
36--O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
37--OO : remove doc-strings in addition to the -O optimizations\n\
38+-N : do NOT optimize generated bytecode\n\
39 -Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n\
40 -s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\
41 -S : don't imply 'import site' on initialization\n\
42@@ -353,8 +352,8 @@ Py_Main(int argc, char **argv)
43
44 /* case 'J': reserved for Jython */
45
46- case 'O':
47- Py_OptimizeFlag++;
48+ case 'N':
49+ Py_OptimizeFlag=0;
50 break;
51
52 case 'B':