--- /dev/null
+From 6eeab87bc852481e599325549c854b701bf2e39f Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <aa@ocedo.com>
+Date: Thu, 25 Sep 2014 18:18:29 +0300
+Subject: [PATCH] enable zlib
+
+---
+ Modules/Setup.dist | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Modules/Setup.dist b/Modules/Setup.dist
+index 01fb85f..01ac492 100644
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -358,7 +358,7 @@ _symtable symtablemodule.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -lz
+
+ # Interface to the Expat XML parser
+ #
+--
+1.8.4.5
+
--- /dev/null
+diff --git a/setup.py b/setup.py
+index 93f390f..ace1494 100644
+--- a/setup.py
++++ b/setup.py
+@@ -461,7 +461,8 @@ class PyBuildExt(build_ext):
+ add_dir_to_list(dir_list, directory)
+
+ if os.path.normpath(sys.base_prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
++ and not cross_compiling:
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
--- /dev/null
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index f36c11d..f2b6c71 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1217,32 +1217,6 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+ done; \
+ done
+ $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+- if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+- $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+- $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+- fi
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST) -f \
+- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+- $(DESTDIR)$(LIBDEST)
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST) -f \
+- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+- $(DESTDIR)$(LIBDEST)
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST)/site-packages -f \
+- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST)/site-packages -f \
+- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
--- /dev/null
+diff --git a/Python/pythonrun.c b/Python/pythonrun.c
+index 0327830..df41cda 100644
+--- a/Python/pythonrun.c
++++ b/Python/pythonrun.c
+@@ -124,7 +124,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
+ int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
+ int Py_NoSiteFlag; /* Suppress 'import site' */
+ int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
+-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
+ int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
+ int Py_FrozenFlag; /* Needed by getpath.c */
+ int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
+@@ -350,7 +350,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
+ if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
+ Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
+ if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
+- Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
++ Py_DontWriteBytecodeFlag = atoi(p);
+ /* The variable is only tested for existence here; _PyRandom_Init will
+ check its value further. */
+ if ((p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0')
+++ /dev/null
-From 6eeab87bc852481e599325549c854b701bf2e39f Mon Sep 17 00:00:00 2001
-From: Alexandru Ardelean <aa@ocedo.com>
-Date: Thu, 25 Sep 2014 18:18:29 +0300
-Subject: [PATCH] enable zlib
-
----
- Modules/Setup.dist | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Modules/Setup.dist b/Modules/Setup.dist
-index 01fb85f..01ac492 100644
---- a/Modules/Setup.dist
-+++ b/Modules/Setup.dist
-@@ -358,7 +358,7 @@ _symtable symtablemodule.c
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See http://www.gzip.org/zlib/
--#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -lz
-
- # Interface to the Expat XML parser
- #
---
-1.8.4.5
-
+++ /dev/null
-diff --git a/setup.py b/setup.py
-index 93f390f..ace1494 100644
---- a/setup.py
-+++ b/setup.py
-@@ -461,7 +461,8 @@ class PyBuildExt(build_ext):
- add_dir_to_list(dir_list, directory)
-
- if os.path.normpath(sys.base_prefix) != '/usr' \
-- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
-+ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
-+ and not cross_compiling:
- # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
- # (PYTHONFRAMEWORK is set) to avoid # linking problems when
- # building a framework with different architectures than
+++ /dev/null
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index f36c11d..f2b6c71 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1217,32 +1217,6 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
- done; \
- done
- $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
-- if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
-- $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
-- $(DESTDIR)$(LIBDEST)/distutils/tests ; \
-- fi
-- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
-- -d $(LIBDEST) -f \
-- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
-- $(DESTDIR)$(LIBDEST)
-- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
-- -d $(LIBDEST) -f \
-- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
-- $(DESTDIR)$(LIBDEST)
-- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
-- -d $(LIBDEST)/site-packages -f \
-- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
-- -d $(LIBDEST)/site-packages -f \
-- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
-- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
-
- # Create the PLATDIR source directory, if one wasn't distributed..
- $(srcdir)/Lib/$(PLATDIR):
+++ /dev/null
-diff --git a/Python/pythonrun.c b/Python/pythonrun.c
-index 0327830..df41cda 100644
---- a/Python/pythonrun.c
-+++ b/Python/pythonrun.c
-@@ -124,7 +124,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
- int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
- int Py_NoSiteFlag; /* Suppress 'import site' */
- int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
--int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
-+int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
- int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
- int Py_FrozenFlag; /* Needed by getpath.c */
- int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
-@@ -350,7 +350,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
- if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
- Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
- if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
-- Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
-+ Py_DontWriteBytecodeFlag = atoi(p);
- /* The variable is only tested for existence here; _PyRandom_Init will
- check its value further. */
- if ((p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0')