You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pf...@apache.org on 2016/09/02 04:43:14 UTC

svn commit: r1758877 [1/2] - in /openoffice/trunk/main: ./ python/ python/prj/

Author: pfg
Date: Fri Sep  2 04:43:14 2016
New Revision: 1758877

URL: http://svn.apache.org/viewvc?rev=1758877&view=rev
Log:
python: update to version 2.7.9.

The new version  contains many fixes including the following 
vulnerabilities:

CVE-2013-1752
CVE-2013-1753

Which may or may not apply to AOO.
It is also an important step as it uses features from the newer OpenSSL
version that was imported in r1756954.

Tested on FreeBSD, may still need adjustments for MS-Windows.

Added:
    openoffice/trunk/main/python/python-2.7.9-mingw.patch
    openoffice/trunk/main/python/python-2.7.9-nohardlink.patch
    openoffice/trunk/main/python/python-2.7.9-pcbuild.patch
    openoffice/trunk/main/python/python-2.7.9-sysbase.patch
Removed:
    openoffice/trunk/main/python/python-2.7.8-mingw.patch
    openoffice/trunk/main/python/python-2.7.8-nohardlink.patch
    openoffice/trunk/main/python/python-2.7.8-pcbuild.patch
    openoffice/trunk/main/python/python-2.7.8-sysbase.patch
Modified:
    openoffice/trunk/main/external_deps.lst
    openoffice/trunk/main/python/makefile.mk
    openoffice/trunk/main/python/prj/d.lst
    openoffice/trunk/main/python/python-freebsd.patch
    openoffice/trunk/main/python/python-md5.patch
    openoffice/trunk/main/python/python-solaris.patch
    openoffice/trunk/main/python/python-solver-before-std.patch
    openoffice/trunk/main/python/python-ssl.patch
    openoffice/trunk/main/python/pyversion.mk

Modified: openoffice/trunk/main/external_deps.lst
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/external_deps.lst?rev=1758877&r1=1758876&r2=1758877&view=diff
==============================================================================
--- openoffice/trunk/main/external_deps.lst (original)
+++ openoffice/trunk/main/external_deps.lst Fri Sep  2 04:43:14 2016
@@ -204,9 +204,9 @@ if (ENABLE_MEDIAWIKI == YES)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
 if (SYSTEM_PYTHON != YES)
-    MD5 = d4bca0159acb0b44a781292b5231936f
-    name = Python-2.7.8.tgz
-    URL1 = http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
+    MD5 = 5eebcaa0030dc4061156d3429657fb83
+    name = Python-2.7.9.tgz
+    URL1 = http://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
 if (SYSTEM_BOOST != YES)

Modified: openoffice/trunk/main/python/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/python/makefile.mk?rev=1758877&r1=1758876&r2=1758877&view=diff
==============================================================================
--- openoffice/trunk/main/python/makefile.mk (original)
+++ openoffice/trunk/main/python/makefile.mk Fri Sep  2 04:43:14 2016
@@ -42,7 +42,7 @@ all:
 
 
 TARFILE_NAME=Python-$(PYVERSION)
-TARFILE_MD5=d4bca0159acb0b44a781292b5231936f
+TARFILE_MD5=5eebcaa0030dc4061156d3429657fb83
 PATCH_FILES=\
 	python-solaris.patch \
 	python-freebsd.patch \

Modified: openoffice/trunk/main/python/prj/d.lst
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/python/prj/d.lst?rev=1758877&r1=1758876&r2=1758877&view=diff
==============================================================================
--- openoffice/trunk/main/python/prj/d.lst (original)
+++ openoffice/trunk/main/python/prj/d.lst Fri Sep  2 04:43:14 2016
@@ -36,51 +36,51 @@ mkdir: %_DEST%\lib%_EXT%\python\multipro
 mkdir: %_DEST%\lib%_EXT%\python\unittest
 mkdir: %_DEST%\lib%_EXT%\python\python2.7\config
 
-..\%__SRC%\misc\build\Python-2.7.8\Lib\* %_DEST%\lib%_EXT%\python\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\lib-old\* %_DEST%\lib%_EXT%\python\lib-old\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\lib-tk\* %_DEST%\lib%_EXT%\python\lib-tk\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\site-packages\* %_DEST%\lib%_EXT%\python\site-packages\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\encodings\* %_DEST%\lib%_EXT%\python\encodings\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\email\* %_DEST%\lib%_EXT%\python\email\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\email\mime\* %_DEST%\lib%_EXT%\python\email\mime\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\compiler\* %_DEST%\lib%_EXT%\python\compiler\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\hotshot\* %_DEST%\lib%_EXT%\python\hotshot\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\distutils\* %_DEST%\lib%_EXT%\python\distutils\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\distutils\command\* %_DEST%\lib%_EXT%\python\distutils\command\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\xml\* %_DEST%\lib%_EXT%\python\xml\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\xml\dom\* %_DEST%\lib%_EXT%\python\xml\dom\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\xml\parsers\* %_DEST%\lib%_EXT%\python\xml\parsers\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\xml\sax\* %_DEST%\lib%_EXT%\python\xml\sax\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\curses\* %_DEST%\lib%_EXT%\python\curses\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\plat-linux2\* %_DEST%\lib%_EXT%\python\plat-linux2\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\config\* %_DEST%\lib%_EXT%\python\config\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\bsddb\* %_DEST%\lib%_EXT%\python\bsddb\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\logging\* %_DEST%\lib%_EXT%\python\logging\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\idlelib\* %_DEST%\lib%_EXT%\python\idlelib\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\idlelib\Icons\* %_DEST%\lib%_EXT%\python\idlelib\Icons\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\wsgiref\* %_DEST%\lib%_EXT%\python\wsgiref\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\json\* %_DEST%\lib%_EXT%\python\json\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\lib2to3\* %_DEST%\lib%_EXT%\python\lib2to3\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\lib2to3\fixes\* %_DEST%\lib%_EXT%\python\lib2to3\fixes\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\lib2to3\pgen2\* %_DEST%\lib%_EXT%\python\lib2to3\pgen2\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\sqlite3\* %_DEST%\lib%_EXT%\python\sqlite3\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\ctypes\* %_DEST%\lib%_EXT%\python\ctypes\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\ctypes\macholib\* %_DEST%\lib%_EXT%\python\ctypes\macholib\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\xml\etree\* %_DEST%\lib%_EXT%\python\xml\etree
-..\%__SRC%\misc\build\Python-2.7.8\Lib\xml\etree\* %_DEST%\lib%_EXT%\python\xml\etree
-..\%__SRC%\misc\build\Python-2.7.8\Lib\importlib\* %_DEST%\lib%_EXT%\python\importlib\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\multiprocessing\* %_DEST%\lib%_EXT%\python\multiprocessing\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\multiprocessing\dummy\* %_DEST%\lib%_EXT%\python\multiprocessing\dummy\*
-..\%__SRC%\misc\build\Python-2.7.8\Lib\unittest\* %_DEST%\lib%_EXT%\python\unittest\*
-..\%__SRC%\misc\build\Python-2.7.8\Makefile %_DEST%\lib%_EXT%\python\python2.7\config\Makefile
+..\%__SRC%\misc\build\Python-2.7.9\Lib\* %_DEST%\lib%_EXT%\python\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\lib-old\* %_DEST%\lib%_EXT%\python\lib-old\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\lib-tk\* %_DEST%\lib%_EXT%\python\lib-tk\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\site-packages\* %_DEST%\lib%_EXT%\python\site-packages\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\encodings\* %_DEST%\lib%_EXT%\python\encodings\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\email\* %_DEST%\lib%_EXT%\python\email\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\email\mime\* %_DEST%\lib%_EXT%\python\email\mime\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\compiler\* %_DEST%\lib%_EXT%\python\compiler\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\hotshot\* %_DEST%\lib%_EXT%\python\hotshot\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\distutils\* %_DEST%\lib%_EXT%\python\distutils\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\distutils\command\* %_DEST%\lib%_EXT%\python\distutils\command\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\xml\* %_DEST%\lib%_EXT%\python\xml\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\xml\dom\* %_DEST%\lib%_EXT%\python\xml\dom\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\xml\parsers\* %_DEST%\lib%_EXT%\python\xml\parsers\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\xml\sax\* %_DEST%\lib%_EXT%\python\xml\sax\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\curses\* %_DEST%\lib%_EXT%\python\curses\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\plat-linux2\* %_DEST%\lib%_EXT%\python\plat-linux2\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\config\* %_DEST%\lib%_EXT%\python\config\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\bsddb\* %_DEST%\lib%_EXT%\python\bsddb\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\logging\* %_DEST%\lib%_EXT%\python\logging\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\idlelib\* %_DEST%\lib%_EXT%\python\idlelib\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\idlelib\Icons\* %_DEST%\lib%_EXT%\python\idlelib\Icons\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\wsgiref\* %_DEST%\lib%_EXT%\python\wsgiref\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\json\* %_DEST%\lib%_EXT%\python\json\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\lib2to3\* %_DEST%\lib%_EXT%\python\lib2to3\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\lib2to3\fixes\* %_DEST%\lib%_EXT%\python\lib2to3\fixes\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\lib2to3\pgen2\* %_DEST%\lib%_EXT%\python\lib2to3\pgen2\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\sqlite3\* %_DEST%\lib%_EXT%\python\sqlite3\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\ctypes\* %_DEST%\lib%_EXT%\python\ctypes\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\ctypes\macholib\* %_DEST%\lib%_EXT%\python\ctypes\macholib\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\xml\etree\* %_DEST%\lib%_EXT%\python\xml\etree
+..\%__SRC%\misc\build\Python-2.7.9\Lib\xml\etree\* %_DEST%\lib%_EXT%\python\xml\etree
+..\%__SRC%\misc\build\Python-2.7.9\Lib\importlib\* %_DEST%\lib%_EXT%\python\importlib\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\multiprocessing\* %_DEST%\lib%_EXT%\python\multiprocessing\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\multiprocessing\dummy\* %_DEST%\lib%_EXT%\python\multiprocessing\dummy\*
+..\%__SRC%\misc\build\Python-2.7.9\Lib\unittest\* %_DEST%\lib%_EXT%\python\unittest\*
+..\%__SRC%\misc\build\Python-2.7.9\Makefile %_DEST%\lib%_EXT%\python\python2.7\config\Makefile
 ..\%__SRC%\misc\build\python-inst\lib\python2.7\_sysconfigdata.py %_DEST%\lib%_EXT%\python\_sysconfigdata.py
 ..\pyversion.mk %_DEST%\inc%_EXT%\pyversion.mk
 
-..\%__SRC%\misc\build\Python-2.7.8\Include\* %_DEST%\inc%_EXT%\python\*
+..\%__SRC%\misc\build\Python-2.7.9\Include\* %_DEST%\inc%_EXT%\python\*
 
 #unix ONLY !
 ..\%__SRC%\misc\build\python-inst\bin\python %_DEST%\bin%_EXT%\python
-..\%__SRC%\misc\build\Python-2.7.8\pyconfig.h %_DEST%\inc%_EXT%\python\pyconfig.h
+..\%__SRC%\misc\build\Python-2.7.9\pyconfig.h %_DEST%\inc%_EXT%\python\pyconfig.h
 ..\%__SRC%\misc\build\python-inst\lib\python2.7\lib-dynload\* %_DEST%\lib%_EXT%\python\lib-dynload\*
 ..\%__SRC%\misc\build\python-inst\bin\python2.7 %_DEST%\bin%_EXT%\python
 ..\%__SRC%\misc\build\python-inst\lib\libpython2.7.so.1.0 %_DEST%\lib%_EXT%\libpython2.7.so.1.0
@@ -91,24 +91,24 @@ symlink: %_DEST%\lib%_EXT%\libpython2.7.
 
 #MingW ONLY !
 ..\%__SRC%\misc\build\python-inst\bin\python.exe %_DEST%\bin%_EXT%\python.exe
-..\%__SRC%\misc\build\Python-2.7.8\libpython2.7.dll %_DEST%\bin%_EXT%\libpython2.7.dll
+..\%__SRC%\misc\build\Python-2.7.9\libpython2.7.dll %_DEST%\bin%_EXT%\libpython2.7.dll
 
 # WINDOWS ONLY !
 ..\%__SRC%\misc\build\pyconfig.h %_DEST%\inc%_EXT%\python\pyconfig.h
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\python.exe %_DEST%\bin%_EXT%\python.exe
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\python27.dll %_DEST%\bin%_EXT%\python27.dll
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\python27.lib %_DEST%\lib%_EXT%\python27.lib
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\_socket.pyd %_DEST%\lib%_EXT%\python\_socket.pyd
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\_ssl.pyd %_DEST%\lib%_EXT%\python\_ssl.pyd
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\select.pyd %_DEST%\lib%_EXT%\python\select.pyd
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\unicodedata.pyd %_DEST%\lib%_EXT%\python\unicodedata.pyd
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\winsound.pyd %_DEST%\lib%_EXT%\python\winsound.pyd
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\pyexpat.pyd %_DEST%\lib%_EXT%\python\pyexpat.pyd
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\_testcapi.pyd %_DEST%\lib%_EXT%\python\_testcapi.pyd
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\_multiprocessing.pyd %_DEST%\lib%_EXT%\python\_multiprocessing.pyd
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\_msi.pyd %_DEST%\lib%_EXT%\python\_msi.pyd
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\_elementtree.pyd %_DEST%\lib%_EXT%\python\_elementtree.pyd
-..\%__SRC%\misc\build\Python-2.7.8\PCbuild\_ctypes.pyd %_DEST%\lib%_EXT%\python\_ctypes.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\python.exe %_DEST%\bin%_EXT%\python.exe
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\python27.dll %_DEST%\bin%_EXT%\python27.dll
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\python27.lib %_DEST%\lib%_EXT%\python27.lib
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\_socket.pyd %_DEST%\lib%_EXT%\python\_socket.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\_ssl.pyd %_DEST%\lib%_EXT%\python\_ssl.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\select.pyd %_DEST%\lib%_EXT%\python\select.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\unicodedata.pyd %_DEST%\lib%_EXT%\python\unicodedata.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\winsound.pyd %_DEST%\lib%_EXT%\python\winsound.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\pyexpat.pyd %_DEST%\lib%_EXT%\python\pyexpat.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\_testcapi.pyd %_DEST%\lib%_EXT%\python\_testcapi.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\_multiprocessing.pyd %_DEST%\lib%_EXT%\python\_multiprocessing.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\_msi.pyd %_DEST%\lib%_EXT%\python\_msi.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\_elementtree.pyd %_DEST%\lib%_EXT%\python\_elementtree.pyd
+..\%__SRC%\misc\build\Python-2.7.9\PCbuild\_ctypes.pyd %_DEST%\lib%_EXT%\python\_ctypes.pyd
 
 #linklib: libpython.so.*.*.*
 

Added: openoffice/trunk/main/python/python-2.7.9-mingw.patch
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/python/python-2.7.9-mingw.patch?rev=1758877&view=auto
==============================================================================
--- openoffice/trunk/main/python/python-2.7.9-mingw.patch (added)
+++ openoffice/trunk/main/python/python-2.7.9-mingw.patch Fri Sep  2 04:43:14 2016
@@ -0,0 +1,1056 @@
+diff -ru misc/Python-2.7.9/Include/pyport.h misc/build/Python-2.7.9/Include/pyport.h
+--- misc/Python-2.7.9/Include/pyport.h	2014-06-29 21:05:24.000000000 -0500
++++ misc/build/Python-2.7.9/Include/pyport.h	2016-01-01 17:49:55.171717963 -0500
+@@ -9,6 +9,30 @@
+ #include <inttypes.h>
+ #endif
+ 
++#if defined(__MINGW32__)
++#undef HAVE_FORKPTY
++#undef HAVE_OPENPTY
++#undef HAVE_DEV_PTMX
++#undef _POSIX_THREADS
++#undef HAVE_PTHREAD_H
++#define MS_WINDOWS
++#define MS_WIN32
++#define Py_WIN_WIDE_FILENAMES
++#ifndef PYTHONPATH
++#	define PYTHONPATH ".\\lib;.\\lib\\python" VERSION ";.\\lib\\python" VERSION "\\lib-dynload;.\\lib\\python" VERSION "\\plat-winmingw32;.\\lib\\python" VERSION "\\lib-tk"
++#endif
++#define NT_THREADS
++#define WITH_THREAD
++#define WINVER 0x0501
++#ifdef socklen_t
++#undef socklen_t
++#endif
++#define HAVE_ADDRINFO
++#define HAVE_GETADDRINFO
++#define HAVE_GETNAMEINFO
++#define HAVE_GETPEERNAME
++#endif
++
+ #ifdef HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
+diff -ru misc/Python-2.7.9/Lib/distutils/ccompiler.py misc/build/Python-2.7.9/Lib/distutils/ccompiler.py
+--- misc/Python-2.7.9/Lib/distutils/ccompiler.py	2014-06-29 21:05:25.000000000 -0500
++++ misc/build/Python-2.7.9/Lib/distutils/ccompiler.py	2016-01-01 17:49:55.172717391 -0500
+@@ -895,6 +895,7 @@
+     # on a cygwin built python we can use gcc like an ordinary UNIXish
+     # compiler
+     ('cygwin.*', 'unix'),
++    ('winmingw*', 'unix'),
+     ('os2emx', 'emx'),
+ 
+     # OS name mappings
+diff -ru misc/Python-2.7.9/Lib/distutils/command/build_ext.py misc/build/Python-2.7.9/Lib/distutils/command/build_ext.py
+--- misc/Python-2.7.9/Lib/distutils/command/build_ext.py	2014-06-29 21:05:25.000000000 -0500
++++ misc/build/Python-2.7.9/Lib/distutils/command/build_ext.py	2016-01-01 17:49:55.173717798 -0500
+@@ -221,7 +221,7 @@
+ 
+         # for extensions under Cygwin and AtheOS Python's library directory must be
+         # appended to library_dirs
+-        if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos':
++        if sys.platform[:6] == 'cygwin' or sys.platform[:8] == 'winmingw' or sys.platform[:6] == 'atheos':
+             if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
+                 # building third party extensions
+                 self.library_dirs.append(os.path.join(sys.prefix, "lib",
+@@ -723,7 +723,7 @@
+             # don't extend ext.libraries, it may be shared with other
+             # extensions, it is a reference to the original list
+             return ext.libraries + [pythonlib]
+-        elif sys.platform[:6] == "cygwin":
++        elif sys.platform[:6] == "cygwin" or sys.platform[:8] == "winmingw":
+             template = "python%d.%d"
+             pythonlib = (template %
+                    (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
+diff -ru misc/Python-2.7.9/Lib/distutils/command/install.py misc/build/Python-2.7.9/Lib/distutils/command/install.py
+--- misc/Python-2.7.9/Lib/distutils/command/install.py	2014-06-29 21:05:25.000000000 -0500
++++ misc/build/Python-2.7.9/Lib/distutils/command/install.py	2016-01-01 17:49:55.174717925 -0500
+@@ -348,9 +348,10 @@
+ 
+         # Convert directories from Unix /-separated syntax to the local
+         # convention.
+-        self.convert_paths('lib', 'purelib', 'platlib',
+-                           'scripts', 'data', 'headers',
+-                           'userbase', 'usersite')
++        if os.sep != '/':
++            self.convert_paths('lib', 'purelib', 'platlib',
++                               'scripts', 'data', 'headers',
++                               'userbase', 'usersite')
+ 
+         # Well, we're not actually fully completely finalized yet: we still
+         # have to deal with 'extra_path', which is the hack for allowing
+@@ -362,7 +363,7 @@
+ 
+         # If a new root directory was supplied, make all the installation
+         # dirs relative to it.
+-        if self.root is not None:
++        if self.root is not None and self.root != "":
+             self.change_roots('libbase', 'lib', 'purelib', 'platlib',
+                               'scripts', 'data', 'headers')
+ 
+@@ -501,7 +502,10 @@
+     def convert_paths (self, *names):
+         for name in names:
+             attr = "install_" + name
+-            setattr(self, attr, convert_path(getattr(self, attr)))
++            if self.root is None or self.root == "":
++                setattr(self, attr, getattr(self, attr).replace('/', os.sep))
++            else:
++                setattr(self, attr, convert_path(getattr(self, attr)))
+ 
+ 
+     def handle_extra_path (self):
+diff -ru misc/Python-2.7.9/Lib/distutils/spawn.py misc/build/Python-2.7.9/Lib/distutils/spawn.py
+--- misc/Python-2.7.9/Lib/distutils/spawn.py	2014-06-29 21:05:26.000000000 -0500
++++ misc/build/Python-2.7.9/Lib/distutils/spawn.py	2016-01-01 17:49:55.175718681 -0500
+@@ -212,7 +212,7 @@
+     paths = path.split(os.pathsep)
+     base, ext = os.path.splitext(executable)
+ 
+-    if (sys.platform == 'win32' or os.name == 'os2') and (ext != '.exe'):
++    if (sys.platform == 'win32' or sys.platform[:8] == "winmingw" or os.name == 'os2') and (ext != '.exe'):
+         executable = executable + '.exe'
+ 
+     if not os.path.isfile(executable):
+diff -ru misc/Python-2.7.9/Lib/distutils/sysconfig.py misc/build/Python-2.7.9/Lib/distutils/sysconfig.py
+--- misc/Python-2.7.9/Lib/distutils/sysconfig.py	2014-06-29 21:05:26.000000000 -0500
++++ misc/build/Python-2.7.9/Lib/distutils/sysconfig.py	2016-01-01 17:49:55.175718681 -0500
+@@ -450,6 +450,9 @@
+     global _config_vars
+     if _config_vars is None:
+         func = globals().get("_init_" + os.name)
++        if sys.platform[:8] == "winmingw":
++            func = globals().get("_init_posix")
++
+         if func:
+             func()
+         else:
+diff -ru misc/Python-2.7.9/Lib/distutils/unixccompiler.py misc/build/Python-2.7.9/Lib/distutils/unixccompiler.py
+--- misc/Python-2.7.9/Lib/distutils/unixccompiler.py	2014-06-29 21:05:26.000000000 -0500
++++ misc/build/Python-2.7.9/Lib/distutils/unixccompiler.py	2016-01-01 17:49:55.176718668 -0500
+@@ -80,7 +80,7 @@
+     shared_lib_extension = ".so"
+     dylib_lib_extension = ".dylib"
+     static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s"
+-    if sys.platform == "cygwin":
++    if sys.platform == "cygwin" or sys.platform == "winmingw":
+         exe_extension = ".exe"
+ 
+     def preprocess(self, source,
+diff -ru misc/Python-2.7.9/Lib/os.py misc/build/Python-2.7.9/Lib/os.py
+--- misc/Python-2.7.9/Lib/os.py	2014-06-29 21:05:30.000000000 -0500
++++ misc/build/Python-2.7.9/Lib/os.py	2016-01-01 17:49:55.177718586 -0500
+@@ -38,7 +38,21 @@
+     except AttributeError:
+         return [n for n in dir(module) if n[0] != '_']
+ 
+-if 'posix' in _names:
++if 'winmingw32' in _names:
++    name = 'nt'
++    linesep = '\r\n'
++    from posix import *
++    try:
++        from posix import _exit
++    except ImportError:
++        pass
++    import ntpath as path
++
++    import posix
++    __all__.extend(_get_exports_list(posix))
++    del posix
++
++elif 'posix' in _names:
+     name = 'posix'
+     linesep = '\n'
+     from posix import *
+diff -ru misc/Python-2.7.9/Lib/socket.py misc/build/Python-2.7.9/Lib/socket.py
+--- misc/Python-2.7.9/Lib/socket.py	2014-06-29 21:05:30.000000000 -0500
++++ misc/build/Python-2.7.9/Lib/socket.py	2016-01-01 17:49:55.178717595 -0500
+@@ -153,7 +153,7 @@
+     'sendall', 'setblocking',
+     'settimeout', 'gettimeout', 'shutdown')
+ 
+-if os.name == "nt":
++if os.name == "nt" and sys.platform[:8] != "winmingw":
+     _socketmethods = _socketmethods + ('ioctl',)
+ 
+ if sys.platform == "riscos":
+diff -ru misc/Python-2.7.9/Makefile.pre.in misc/build/Python-2.7.9/Makefile.pre.in
+--- misc/Python-2.7.9/Makefile.pre.in	2014-06-29 21:05:39.000000000 -0500
++++ misc/build/Python-2.7.9/Makefile.pre.in	2016-01-01 17:49:55.179718421 -0500
+@@ -121,6 +121,16 @@
+ BLDSHARED=	@BLDSHARED@ $(LDFLAGS)
+ LDCXXSHARED=	@LDCXXSHARED@
+ DESTSHARED=	$(BINLIBDEST)/lib-dynload
++ifeq (@MACHDEP@,winmingw32)
++DESTSHAREDFORRULES=	$(shell cd $(DESTSHARED) && pwd || echo DESTSHARED)
++LIBPYTHONPATH=	$(shell cd $(DESTDIR)$(LIBDEST) && cmd /c cd | sed -e s:\\\\:/:g)
++DESTPYTHONPATH=	$(LIBPYTHONPATH);$(shell cd $(DESTDIR)$(DESTSHARED) && cmd /c cd | sed -e s:\\\\:/:g)
++LIBDESTPARAM=	$(shell if test -z "$(DESTDIR)" ; then cd $(LIBDEST) && cmd /c cd | sed -e s:\\\\:/:g ; else echo $(LIBDEST) ; fi)
++PREFIXPARAM=	$(shell if test -z "$(DESTDIR)" ; then cd $(prefix) && cmd /c cd | sed -e s:\\\\:/:g ; else echo $(prefix) ; fi)
++BINDIRPARAM=	$(shell if test -z "$(DESTDIR)" ; then cd $(BINDIR) && cmd /c cd | sed -e s:\\\\:/:g ; else echo $(BINDIR) ; fi)
++DESTSHAREDPARAM=	$(shell if test -z "$(DESTDIR)" ; then cd $(DESTSHARED) && cmd /c cd | sed -e s:\\\\:/:g ; else echo $(DESTSHARED) ; fi)
++DESTDIRPARAM=	$(shell if test ! -z "$(DESTDIR)" ; then cd $(DESTDIR) && cmd /c | sed -e s:\\\\:/:g ; fi)
++endif
+ 
+ # Executable suffix (.exe on Windows and Mac OS X)
+ EXE=		@EXEEXT@
+@@ -214,7 +224,7 @@
+ # Modules
+ MODULE_OBJS=	\
+ 		Modules/config.o \
+-		Modules/getpath.o \
++		@GETPATH_OBJS@ \
+ 		Modules/main.o \
+ 		Modules/gcmodule.o
+ 
+@@ -599,6 +609,10 @@
+ 		-DVPATH='"$(VPATH)"' \
+ 		-o $@ $(srcdir)/Modules/getpath.c
+ 
++PC/getpathp.o: $(srcdir)/PC/getpathp.c Makefile
++	$(CC) -c $(PY_CFLAGS) -DVERSION='"$(VERSION)"' \
++		-o $@ $(srcdir)/PC/getpathp.c
++
+ Modules/python.o: $(srcdir)/Modules/python.c
+ 	$(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
+ 
+@@ -647,6 +661,12 @@
+ Objects/unicodectype.o:	$(srcdir)/Objects/unicodectype.c \
+ 				$(srcdir)/Objects/unicodetype_db.h
+ 
++Objects/exceptions.o:	$(srcdir)/Objects/exceptions.c
++		$(CC) -c $(PY_CFLAGS) -I$(srcdir)/PC -o $@ $(srcdir)/Objects/exceptions.c
++
++PC/import_nt.o: $(srcdir)/PC/import_nt.c
++		$(CC) -c $(PY_CFLAGS) -I$(srcdir)/Python -o $@ $(srcdir)/PC/import_nt.c
++
+ STRINGLIB_HEADERS= \
+ 		$(srcdir)/Include/bytes_methods.h \
+ 		$(srcdir)/Objects/stringlib/count.h \
+@@ -861,7 +881,11 @@
+ # Install shared libraries enabled by Setup
+ DESTDIRS=	$(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
+ 
++ifeq (@MACHDEP@,winmingw32)
++oldsharedinstall: $(DESTSHAREDFORRULES) $(SHAREDMODS)
++else
+ oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
++endif
+ 		@for i in X $(SHAREDMODS); do \
+ 		  if test $$i != X; then \
+ 		    echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
+@@ -869,7 +893,11 @@
+ 		  fi; \
+ 		done
+ 
++ifeq (@MACHDEP@,winmingw32)
++$(DESTSHAREDFORRULES):
++else
+ $(DESTSHARED):
++endif
+ 		@for i in $(DESTDIRS); \
+ 		do \
+ 			if test ! -d $(DESTDIR)$$i; then \
+@@ -982,7 +1010,11 @@
+ 		unittest unittest/test \
+ 		lib-old \
+ 		curses pydoc_data $(MACHDEPS)
++ifeq (@MACHDEP@,winmingw32)
++libinstall:	build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c sharedinstall
++else
+ libinstall:	build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
++endif
+ 	@for i in $(SCRIPTDIR) $(LIBDEST); \
+ 	do \
+ 		if test ! -d $(DESTDIR)$$i; then \
+@@ -1042,6 +1074,26 @@
+ 		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ 			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ 	fi
++ifeq (@MACHDEP@,winmingw32)
++	PYTHONPATH="$(DESTPYTHONPATH)"  $(RUNSHARED) \
++		./$(BUILDPYTHON) -Wi -tt $(LIBPYTHONPATH)/compileall.py \
++		-d $(LIBDESTPARAM) -f \
++		-x 'bad_coding|badsyntax|site-packages' $(LIBPYTHONPATH)
++	PYTHONPATH="$(DESTPYTHONPATH)"  $(RUNSHARED) \
++		./$(BUILDPYTHON) -Wi -tt -O $(LIBPYTHONPATH)/compileall.py \
++		-d $(LIBDESTPARAM) -f \
++		-x 'bad_coding|badsyntax|site-packages' $(LIBPYTHONPATH)
++	-PYTHONPATH="$(DESTPYTHONPATH)"  $(RUNSHARED) \
++		./$(BUILDPYTHON) -Wi -t $(LIBPYTHONPATH)/compileall.py \
++		-d $(LIBDESTPARAM)/site-packages -f \
++		-x badsyntax $(LIBPYTHONPATH)/site-packages
++	-PYTHONPATH="$(DESTPYTHONPATH)"  $(RUNSHARED) \
++		./$(BUILDPYTHON) -Wi -t -O $(LIBPYTHONPATH)/compileall.py \
++		-d $(LIBDESTPARAM)/site-packages -f \
++		-x badsyntax $(LIBPYTHONPATH)/site-packages
++	-PYTHONPATH="$(DESTPYTHONPATH)"  $(RUNSHARED) \
++		./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
++else
+ 	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
+ 		$(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		-d $(LIBDEST) -f \
+@@ -1068,6 +1120,7 @@
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
+ 	mkdir $(srcdir)/Lib/$(PLATDIR)
++ifneq (@MACHDEP@,winmingw32)
+ 	cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
+ 	export PATH; PATH="`pwd`:$$PATH"; \
+ 	export PYTHONPATH; PYTHONPATH="$(srcdir)/Lib:$(abs_builddir)/`cat pybuilddir.txt`"; \
+@@ -1081,6 +1134,7 @@
+ 	  PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)"; \
+ 	fi; \
+ 	cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
++endif
+ 
+ python-config: $(srcdir)/Misc/python-config.in
+ 	# Substitution happens here, as the completely-expanded BINDIR
+@@ -1174,6 +1228,15 @@
+ 
+ # Install the dynamically loadable modules
+ # This goes into $(exec_prefix)
++ifeq (@MACHDEP@,winmingw32)
++sharedinstall: $(DESTSHAREDFORRULES)
++       $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
++               --prefix=$(PREFIXPARAM) \
++               --install-scripts=$(BINDIRPARAM) \
++               --install-platlib=$(DESTSHAREDPARAM) \
++               --root=$(DESTDIRPARAM)
++else
++
+ sharedinstall: sharedmods
+ 	$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
+ 	   	--prefix=$(prefix) \
+@@ -1181,6 +1244,7 @@
+ 		--install-platlib=$(DESTSHARED) \
+ 		--root=$(DESTDIR)/
+ 	-rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py*
++endif
+ 
+ # Here are a couple of targets for MacOSX again, to install a full
+ # framework-based Python. frameworkinstall installs everything, the
+diff -ru misc/Python-2.7.9/Modules/Setup.config.in misc/build/Python-2.7.9/Modules/Setup.config.in
+--- misc/Python-2.7.9/Modules/Setup.config.in	2014-06-29 21:05:40.000000000 -0500
++++ misc/build/Python-2.7.9/Modules/Setup.config.in	2016-01-01 17:49:55.179718421 -0500
+@@ -9,5 +9,9 @@
+ # The signal module
+ @USE_SIGNAL_MODULE@signal signalmodule.c
+ 
++# The password module
++@USE_PASSWORD_MODULE@pwd pwdmodule.c	# this is needed to find out the user's home dir
++					# if $HOME is not set
++
+ # The rest of the modules previously listed in this file are built
+ # by the setup.py script in Python 2.1 and later.
+diff -ru misc/Python-2.7.9/Modules/Setup.dist misc/build/Python-2.7.9/Modules/Setup.dist
+--- misc/Python-2.7.9/Modules/Setup.dist	2014-06-29 21:05:40.000000000 -0500
++++ misc/build/Python-2.7.9/Modules/Setup.dist	2016-01-01 17:49:55.180717640 -0500
+@@ -114,7 +114,7 @@
+ 
+ posix posixmodule.c		# posix (UNIX) system calls
+ errno errnomodule.c		# posix (UNIX) errno values
+-pwd pwdmodule.c			# this is needed to find out the user's home dir
++#pwd pwdmodule.c			# this is needed to find out the user's home dir
+ 				# if $HOME is not set
+ _sre _sre.c			# Fredrik Lundh's new regular expressions
+ _codecs _codecsmodule.c		# access to the builtin codecs and codec registry
+diff -ru misc/Python-2.7.9/Modules/_ctypes/libffi/configure misc/build/Python-2.7.9/Modules/_ctypes/libffi/configure
+--- misc/Python-2.7.9/Modules/_ctypes/libffi/configure	2014-06-29 21:05:40.000000000 -0500
++++ misc/build/Python-2.7.9/Modules/_ctypes/libffi/configure	2016-01-01 17:49:55.235718066 -0500
+@@ -18807,6 +18807,12 @@
+ fi
+ 
+ 
++case $host_os in
++mingw*)
++	srcdir=`cd $srcdir && cmd /c cd | sed -e 's:\\\\:/:g'`
++	;;
++esac
++
+ ac_config_commands="$ac_config_commands include"
+ 
+ ac_config_commands="$ac_config_commands src"
+diff -ru misc/Python-2.7.9/Modules/_ctypes/libffi/configure.ac misc/build/Python-2.7.9/Modules/_ctypes/libffi/configure.ac
+--- misc/Python-2.7.9/Modules/_ctypes/libffi/configure.ac	2014-06-29 21:05:40.000000000 -0500
++++ misc/build/Python-2.7.9/Modules/_ctypes/libffi/configure.ac	2016-01-01 17:49:55.236718053 -0500
+@@ -613,6 +613,12 @@
+ fi
+ AC_SUBST(toolexeclibdir)
+ 
++case $host_os in
++mingw*)
++	srcdir=`cd $srcdir && cmd /c cd | sed -e 's:\\\\:/:g'`
++	;;
++esac
++
+ AC_CONFIG_COMMANDS(include, [test -d include || mkdir include])
+ AC_CONFIG_COMMANDS(src, [
+ test -d src || mkdir src
+diff -ru misc/Python-2.7.9/Modules/_ctypes/libffi/include/ffi.h.in misc/build/Python-2.7.9/Modules/_ctypes/libffi/include/ffi.h.in
+--- misc/Python-2.7.9/Modules/_ctypes/libffi/include/ffi.h.in	2014-06-29 21:05:40.000000000 -0500
++++ misc/build/Python-2.7.9/Modules/_ctypes/libffi/include/ffi.h.in	2016-01-01 17:49:55.236718053 -0500
+@@ -433,7 +433,11 @@
+ 			    ffi_type *rtype,
+ 			    ffi_type **atypes);
+ 
++#ifdef MS_WIN32
++int ffi_call(ffi_cif *cif,
++#else
+ void ffi_call(ffi_cif *cif,
++#endif
+ 	      void (*fn)(void),
+ 	      void *rvalue,
+ 	      void **avalue);
+diff -ru misc/Python-2.7.9/Modules/config.c.in misc/build/Python-2.7.9/Modules/config.c.in
+--- misc/Python-2.7.9/Modules/config.c.in	2014-06-29 21:05:42.000000000 -0500
++++ misc/build/Python-2.7.9/Modules/config.c.in	2016-01-01 17:49:55.237718460 -0500
+@@ -48,6 +48,9 @@
+     {"__builtin__", NULL},
+     {"sys", NULL},
+     {"exceptions", NULL},
++#ifdef __MINGW32__
++	{"winmingw32", NULL},
++#endif
+ 
+     /* This lives in gcmodule.c */
+     {"gc", initgc},
+diff -ru misc/Python-2.7.9/Modules/posixmodule.c misc/build/Python-2.7.9/Modules/posixmodule.c
+--- misc/Python-2.7.9/Modules/posixmodule.c	2014-06-29 21:05:43.000000000 -0500
++++ misc/build/Python-2.7.9/Modules/posixmodule.c	2016-01-01 17:49:55.241719248 -0500
+@@ -132,6 +132,15 @@
+ #define HAVE_FSYNC      1
+ #define fsync _commit
+ #else
++#ifdef __MINGW32__
++#define HAVE_SPAWNV	1
++#define HAVE_EXECV      1
++#define HAVE_GETCWD     1
++#define HAVE_OPENDIR    1
++#define HAVE_PIPE       1
++#define HAVE_POPEN      1
++#define HAVE_SYSTEM	1
++#else
+ #if defined(PYOS_OS2) && defined(PYCC_GCC) || defined(__VMS)
+ /* Everything needed is defined in PC/os2emx/pyconfig.h or vms/pyconfig.h */
+ #else                   /* all other compilers */
+@@ -157,6 +166,7 @@
+ #define HAVE_WAIT       1
+ #define HAVE_TTYNAME    1
+ #endif  /* PYOS_OS2 && PYCC_GCC && __VMS */
++#endif  /* __MINGW32__ */
+ #endif  /* _MSC_VER */
+ #endif  /* __BORLANDC__ */
+ #endif  /* ! __WATCOMC__ || __QNX__ */
+@@ -277,6 +287,14 @@
+ #define pclose  _pclose
+ #endif /* _MSC_VER */
+ 
++#ifdef __MINGW32__
++#include "osdefs.h"
++#include <windows.h>
++#include <shellapi.h>	/* for ShellExecute() */
++#define popen	_popen
++#define pclose	_pclose
++#endif
++
+ #if defined(PYCC_VACPP) && defined(PYOS_OS2)
+ #include <io.h>
+ #endif /* OS2 */
+@@ -575,7 +593,7 @@
+ */
+ #include <crt_externs.h>
+ static char **environ;
+-#elif !defined(_MSC_VER) && ( !defined(__WATCOMC__) || defined(__QNX__) )
++#elif !defined(_MSC_VER) && !defined(__MINGW32__) && ( !defined(__WATCOMC__) || defined(__QNX__) )
+ extern char **environ;
+ #endif /* !_MSC_VER */
+ 
+@@ -994,7 +1012,7 @@
+     int st_ctime_nsec;
+ };
+ 
+-static __int64 secs_between_epochs = 11644473600; /* Seconds between 1.1.1601 and 1.1.1970 */
++static __int64 secs_between_epochs = 11644473600LL; /* Seconds between 1.1.1601 and 1.1.1970 */
+ 
+ static void
+ FILE_TIME_to_time_t_nsec(FILETIME *in_ptr, time_t *time_out, int* nsec_out)
+@@ -1514,7 +1532,7 @@
+     return v;
+ }
+ 
+-#ifdef MS_WINDOWS
++#if defined(MS_WINDOWS) && !defined(__MINGW32__)
+ 
+ /* IsUNCRoot -- test whether the supplied path is of the form \\SERVER\SHARE\,
+    where / can be used in place of \ and the trailing slash is optional.
+diff -ru misc/Python-2.7.9/Modules/socketmodule.c misc/build/Python-2.7.9/Modules/socketmodule.c
+--- misc/Python-2.7.9/Modules/socketmodule.c	2014-06-29 21:05:43.000000000 -0500
++++ misc/build/Python-2.7.9/Modules/socketmodule.c	2016-01-01 17:49:55.244718023 -0500
+@@ -317,7 +317,7 @@
+   /* Do not include addrinfo.h for MSVC7 or greater. 'addrinfo' and
+    * EAI_* constants are defined in (the already included) ws2tcpip.h.
+    */
+-#else
++#elif !defined(__MINGW32__)
+ #  include "addrinfo.h"
+ #endif
+ 
+diff -ru misc/Python-2.7.9/PC/_winreg.c misc/build/Python-2.7.9/PC/_winreg.c
+--- misc/Python-2.7.9/PC/_winreg.c	2014-06-29 21:05:46.000000000 -0500
++++ misc/build/Python-2.7.9/PC/_winreg.c	2016-01-01 17:49:55.246717928 -0500
+@@ -1792,6 +1792,9 @@
+ }
+ 
+ #define ADD_KEY(val) inskey(d, #val, val)
++#ifndef REG_LEGAL_CHANGE_FILTER
++#define REG_LEGAL_CHANGE_FILTER (REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_ATTRIBUTES|REG_NOTIFY_CHANGE_LAST_SET|REG_NOTIFY_CHANGE_SECURITY)
++#endif
+ 
+ PyMODINIT_FUNC init_winreg(void)
+ {
+diff -ru misc/Python-2.7.9/Python/dynload_win.c misc/build/Python-2.7.9/Python/dynload_win.c
+--- misc/Python-2.7.9/Python/dynload_win.c	2014-06-29 21:05:47.000000000 -0500
++++ misc/build/Python-2.7.9/Python/dynload_win.c	2016-01-01 17:49:55.246717928 -0500
+@@ -28,6 +28,7 @@
+ /* Case insensitive string compare, to avoid any dependencies on particular
+    C RTL implementations */
+ 
++#ifndef __MINGW32__
+ static int strcasecmp (char *string1, char *string2)
+ {
+     int first, second;
+@@ -41,6 +42,7 @@
+ 
+     return (first - second);
+ }
++#endif
+ 
+ 
+ /* Function to return the name of the "python" DLL that the supplied module
+diff -ru misc/Python-2.7.9/Python/frozenmain.c misc/build/Python-2.7.9/Python/frozenmain.c
+--- misc/Python-2.7.9/Python/frozenmain.c	2014-06-29 21:05:47.000000000 -0500
++++ misc/build/Python-2.7.9/Python/frozenmain.c	2016-01-01 17:49:55.247717915 -0500
+@@ -3,7 +3,7 @@
+ 
+ #include "Python.h"
+ 
+-#ifdef MS_WINDOWS
++#if defined(MS_WINDOWS) && !defined(__MINGW32__)
+ extern void PyWinFreeze_ExeInit(void);
+ extern void PyWinFreeze_ExeTerm(void);
+ extern int PyInitFrozenExtensions(void);
+@@ -32,12 +32,12 @@
+         setbuf(stderr, (char *)NULL);
+     }
+ 
+-#ifdef MS_WINDOWS
++#ifdef MS_WINDOWS && !defined(__MINGW32__)
+     PyInitFrozenExtensions();
+ #endif /* MS_WINDOWS */
+     Py_SetProgramName(argv[0]);
+     Py_Initialize();
+-#ifdef MS_WINDOWS
++#ifdef MS_WINDOWS && !defined(__MINGW32__)
+     PyWinFreeze_ExeInit();
+ #endif
+ 
+@@ -60,7 +60,7 @@
+     if (inspect && isatty((int)fileno(stdin)))
+         sts = PyRun_AnyFile(stdin, "<stdin>") != 0;
+ 
+-#ifdef MS_WINDOWS
++#ifdef MS_WINDOWS && !defined(__MINGW32__)
+     PyWinFreeze_ExeTerm();
+ #endif
+     Py_Finalize();
+diff -ru misc/Python-2.7.9/configure misc/build/Python-2.7.9/configure
+--- misc/Python-2.7.9/configure	2014-06-29 21:05:48.000000000 -0500
++++ misc/build/Python-2.7.9/configure	2016-01-01 17:49:55.307717091 -0500
+@@ -638,8 +638,10 @@
+ LIBOBJS
+ TRUE
+ MACHDEP_OBJS
++GETPATH_OBJS
+ DYNLOADFILE
+ DLINCLDIR
++USE_PASSWORD_MODULE
+ THREADOBJ
+ LDLAST
+ USE_THREAD_MODULE
+@@ -3367,6 +3369,13 @@
+         LDFLAGS="$SGI_ABI $LDFLAGS"
+         MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
+ fi
++case $MACHDEP in
++        *mingw*|*MINGW*|*MinGW*)
++		MACHDEP="winmingw32"
++		ac_sys_system=`uname -s`
++		ac_sys_release=`uname -r`
++	;;
++esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACHDEP" >&5
+ $as_echo "$MACHDEP" >&6; }
+ 
+@@ -5280,7 +5289,7 @@
+ if test -z "$enable_shared"
+ then
+   case $ac_sys_system in
+-  CYGWIN* | atheos*)
++  CYGWIN* | MINGW* | atheos*)
+     enable_shared="yes";;
+   *)
+     enable_shared="no";;
+@@ -5349,7 +5358,7 @@
+     BeOS*)
+           LDLIBRARY='libpython$(VERSION).so'
+           ;;
+-    CYGWIN*)
++    CYGWIN* | MINGW*)
+           LDLIBRARY='libpython$(VERSION).dll.a'
+           DLLLIBRARY='libpython$(VERSION).dll'
+           ;;
+@@ -5405,7 +5413,7 @@
+   esac
+ else # shared is disabled
+   case $ac_sys_system in
+-    CYGWIN*)
++    CYGWIN* | MINGW*)
+           BLDLIBRARY='$(LIBRARY)'
+           LDLIBRARY='libpython$(VERSION).dll.a'
+           ;;
+@@ -7820,6 +7829,10 @@
+ 
+ 
+ 
++ac_cv_sizeof_off_t=`echo $ac_cv_sizeof_off_t | tr -d '\015'`
++ac_cv_sizeof_long=`echo $ac_cv_sizeof_long | tr -d '\015'`
++ac_cv_sizeof_long_long=`echo $ac_cv_sizeof_long_long | tr -d '\015'`
++ac_cv_sizeof_short=`echo $ac_cv_sizeof_short | tr -d '\015'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable large file support" >&5
+ $as_echo_n "checking whether to enable large file support... " >&6; }
+ if test "$have_long_long" = yes
+@@ -8136,7 +8149,7 @@
+ 	  		*)    SO=.sl;;
+ 		esac
+ 		;;
+-	CYGWIN*)   SO=.dll;;
++	CYGWIN* | MINGW*)   SO=.dll;;
+ 	*)	   SO=.so;;
+ 	esac
+ else
+@@ -8300,7 +8313,7 @@
+ 	SCO_SV*)
+ 		LDSHARED='$(CC) -Wl,-G,-Bexport'
+ 		LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';;
+-	CYGWIN*)
++	CYGWIN* | MINGW*)
+ 		LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
+ 		LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
+ 	atheos*)
+@@ -8396,7 +8409,7 @@
+ 			LINKFORSHARED="-Xlinker --export-dynamic"
+ 		    fi;;
+ 		  esac;;
+-	CYGWIN*)
++	CYGWIN* | MINGW*)
+ 		if test $enable_shared = "no"
+ 		then
+ 			LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
+@@ -8420,7 +8433,7 @@
+ if test ! "$LIBRARY" = "$LDLIBRARY"
+ then
+ 	case $ac_sys_system in
+-	CYGWIN*)
++	CYGWIN* | MINGW*)
+ 		# Cygwin needs CCSHARED when building extension DLLs
+ 		# but not when building the interpreter DLL.
+ 		CFLAGSFORSHARED='';;
+@@ -9671,7 +9684,7 @@
+ #define HAVE_PTHREAD_SIGMASK 1
+ _ACEOF
+  case $ac_sys_system in
+-        CYGWIN*)
++        CYGWIN* | MINGW*)
+ 
+ $as_echo "#define HAVE_BROKEN_PTHREAD_SIGMASK 1" >>confdefs.h
+ 
+@@ -9694,6 +9707,17 @@
+ fi
+ 
+ 
++case $MACHDEP in
++winmingw*)
++	THREADOBJ="Python/thread.o"
++	USE_THREAD_MODULE="#"
++	USE_PASSWORD_MODULE="#"
++	;;
++*)
++	USE_PASSWORD_MODULE=""
++	;;
++esac
++
+ # Check for enable-ipv6
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if --enable-ipv6 is specified" >&5
+@@ -10128,6 +10152,11 @@
+ 	# Use dynload_next.c only on 10.2 and below, which don't have native dlopen()
+ 	Darwin/[0156]\..*) DYNLOADFILE="dynload_next.o";;
+ 	atheos*) DYNLOADFILE="dynload_atheos.o";;
++	CYGWIN* | MINGW*)
++		case $MACHDEP in
++		winmingw*) DYNLOADFILE="dynload_win.o PC/import_nt.o PC/dl_nt.o";;
++		esac
++		;;
+ 	*)
+ 	# use dynload_shlib.c and dlopen() if we have it; otherwise stub
+ 	# out any dynamic loading
+@@ -10147,6 +10176,21 @@
+ 
+ fi
+ 
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking GETPATH_OBJS" >&5
++$as_echo_n "checking GETPATH_OBJS... " >&6; }
++if test -z "$GETPATH_OBJS"
++then
++	case $MACHDEP in
++	winmingw*)
++		GETPATH_OBJS='PC/getpathp.o';;
++	*)
++		GETPATH_OBJS='Modules/getpath.o';;
++	esac
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GETPATH_OBJS" >&5
++$as_echo "$GETPATH_OBJS" >&6; }
++
+ # MACHDEP_OBJS can be set to platform-specific object files needed by Python
+ 
+ 
+@@ -11745,6 +11789,20 @@
+ 
+ fi
+ 
++case $MACHDEP in
++winmingw*)
++ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
++if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_STRUCT_STAT_ST_BLOCKS 1
++_ACEOF
++
++
++fi
++
++;;
++*)
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
+ if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
+ 
+@@ -11765,6 +11823,8 @@
+ fi
+ 
+ 
++;;
++esac
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for time.h that defines altzone" >&5
+ $as_echo_n "checking for time.h that defines altzone... " >&6; }
+@@ -13148,6 +13208,7 @@
+ 
+ 
+ 
++ac_cv_sizeof_wchar_t=`echo $ac_cv_sizeof_wchar_t | tr -d '\015'`
+ 
+ if test "$enable_unicode" = "no"
+ then
+diff -ru misc/Python-2.7.9/configure.ac misc/build/Python-2.7.9/configure.ac
+--- misc/Python-2.7.9/configure.ac	2014-06-29 21:05:48.000000000 -0500
++++ misc/build/Python-2.7.9/configure.ac	2016-01-01 17:49:55.310717403 -0500
+@@ -491,6 +491,13 @@
+         LDFLAGS="$SGI_ABI $LDFLAGS"
+         MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
+ fi
++case $MACHDEP in
++        *mingw*|*MINGW*|*MinGW*)
++		MACHDEP="winmingw32"
++		ac_sys_system=`uname -s`
++		ac_sys_release=`uname -r`
++	;;
++esac
+ AC_MSG_RESULT($MACHDEP)
+ 
+ # And add extra plat-mac for darwin
+@@ -824,7 +831,7 @@
+ if test -z "$enable_shared"
+ then 
+   case $ac_sys_system in
+-  CYGWIN* | atheos*)
++  CYGWIN* | MINGW* | atheos*)
+     enable_shared="yes";;
+   *)
+     enable_shared="no";;
+@@ -876,7 +883,7 @@
+     BeOS*)
+           LDLIBRARY='libpython$(VERSION).so'
+           ;;
+-    CYGWIN*)
++    CYGWIN* | MINGW*)
+           LDLIBRARY='libpython$(VERSION).dll.a'
+           DLLLIBRARY='libpython$(VERSION).dll'
+           ;;
+@@ -932,7 +939,7 @@
+   esac
+ else # shared is disabled
+   case $ac_sys_system in
+-    CYGWIN*)
++    CYGWIN* | MINGW*)
+           BLDLIBRARY='$(LIBRARY)'
+           LDLIBRARY='libpython$(VERSION).dll.a'
+           ;;
+@@ -1714,6 +1721,10 @@
+ #endif
+ ])
+ 
++ac_cv_sizeof_off_t=`echo $ac_cv_sizeof_off_t | tr -d '\015'`
++ac_cv_sizeof_long=`echo $ac_cv_sizeof_long | tr -d '\015'`
++ac_cv_sizeof_long_long=`echo $ac_cv_sizeof_long_long | tr -d '\015'`
++ac_cv_sizeof_short=`echo $ac_cv_sizeof_short | tr -d '\015'`
+ AC_MSG_CHECKING(whether to enable large file support)
+ if test "$have_long_long" = yes
+ then
+@@ -1919,7 +1930,7 @@
+ 	  		*)    SO=.sl;;
+ 		esac
+ 		;;
+-	CYGWIN*)   SO=.dll;;
++	CYGWIN* | MINGW*)   SO=.dll;;
+ 	*)	   SO=.so;;
+ 	esac
+ else
+@@ -2077,7 +2088,7 @@
+ 	SCO_SV*)
+ 		LDSHARED='$(CC) -Wl,-G,-Bexport'
+ 		LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';;
+-	CYGWIN*)
++	CYGWIN* | MINGW*)
+ 		LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
+ 		LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
+ 	atheos*)
+@@ -2169,7 +2120,7 @@
+ 			LINKFORSHARED="-Xlinker --export-dynamic"
+ 		    fi;;
+ 		  esac;;
+-	CYGWIN*)
++	CYGWIN* | MINGW*)
+ 		if test $enable_shared = "no"
+ 		then
+ 			LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
+@@ -2191,7 +2202,7 @@
+ if test ! "$LIBRARY" = "$LDLIBRARY"
+ then
+ 	case $ac_sys_system in
+-	CYGWIN*)
++	CYGWIN* | MINGW*)
+ 		# Cygwin needs CCSHARED when building extension DLLs
+ 		# but not when building the interpreter DLL.
+ 		CFLAGSFORSHARED='';;
+@@ -2601,7 +2612,7 @@
+       fi
+       AC_CHECK_FUNCS(pthread_sigmask,
+         [case $ac_sys_system in
+-        CYGWIN*)
++        CYGWIN* | MINGW*)
+           AC_DEFINE(HAVE_BROKEN_PTHREAD_SIGMASK, 1,
+             [Define if pthread_sigmask() does not work on your system.])
+             ;;
+@@ -2609,6 +2620,17 @@
+       AC_CHECK_FUNCS(pthread_atfork)
+ fi
+ 
++AC_SUBST(USE_PASSWORD_MODULE)
++case $MACHDEP in
++winmingw*)
++	THREADOBJ="Python/thread.o"
++	USE_THREAD_MODULE="#"
++	USE_PASSWORD_MODULE="#"
++	;;
++*)
++	USE_PASSWORD_MODULE=""
++	;;
++esac
+ 
+ # Check for enable-ipv6
+ AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
+@@ -2880,6 +2902,11 @@
+ 	# Use dynload_next.c only on 10.2 and below, which don't have native dlopen()
+ 	Darwin/@<:@0156@:>@\..*) DYNLOADFILE="dynload_next.o";;
+ 	atheos*) DYNLOADFILE="dynload_atheos.o";;
++	CYGWIN* | MINGW*)
++		case $MACHDEP in
++		winmingw*) DYNLOADFILE="dynload_win.o PC/import_nt.o PC/dl_nt.o";;
++		esac
++		;;
+ 	*)
+ 	# use dynload_shlib.c and dlopen() if we have it; otherwise stub
+ 	# out any dynamic loading
+@@ -2897,6 +2924,19 @@
+         [Defined when any dynamic module loading is enabled.])
+ fi
+ 
++AC_SUBST(GETPATH_OBJS)
++AC_MSG_CHECKING(GETPATH_OBJS)
++if test -z "$GETPATH_OBJS"
++then
++	case $MACHDEP in
++	winmingw*)
++		GETPATH_OBJS='PC/getpathp.o';;
++	*)
++		GETPATH_OBJS='Modules/getpath.o';;
++	esac
++fi
++AC_MSG_RESULT($GETPATH_OBJS)
++
+ # MACHDEP_OBJS can be set to platform-specific object files needed by Python
+ 
+ AC_SUBST(MACHDEP_OBJS)
+@@ -3358,7 +3398,14 @@
+ AC_CHECK_MEMBERS([struct stat.st_flags])
+ AC_CHECK_MEMBERS([struct stat.st_gen])
+ AC_CHECK_MEMBERS([struct stat.st_birthtime])
++case $MACHDEP in
++winmingw*)
++AC_CHECK_MEMBERS([struct stat.st_blocks])
++;;
++*)
+ AC_STRUCT_ST_BLOCKS
++;;
++esac
+ 
+ AC_MSG_CHECKING(for time.h that defines altzone)
+ AC_CACHE_VAL(ac_cv_header_time_altzone,[
+@@ -3979,6 +4026,7 @@
+ AH_TEMPLATE(PY_UNICODE_TYPE,
+   [Define as the integral type used for Unicode representation.])
+ 
++ac_cv_sizeof_wchar_t=`echo $ac_cv_sizeof_wchar_t | tr -d '\015'`
+ AC_SUBST(UNICODE_OBJS)
+ if test "$enable_unicode" = "no"
+ then
+diff -ru misc/Python-2.7.9/setup.py misc/build/Python-2.7.9/setup.py
+--- misc/Python-2.7.9/setup.py	2014-06-29 21:05:48.000000000 -0500
++++ misc/build/Python-2.7.9/setup.py	2016-01-01 17:49:55.312719892 -0500
+@@ -287,6 +287,18 @@
+             if not self.configure_ctypes(ext):
+                 return
+ 
++        if self.get_platform() == "winmingw":
++            if ext.name == '_ctypes_test':
++                ext.libraries.append('oleaut32')
++            elif ext.name == 'select':
++                ext.libraries.append('ws2_32')
++            elif ext.name == '_socket':
++                ext.libraries.append('ws2_32')
++            if ext.name == '_ctypes':
++                ext.libraries.append('uuid')
++                ext.libraries.append('oleaut32')
++                ext.libraries.append('ole32')
++
+         try:
+             build_ext.build_extension(self, ext)
+         except (CCompilerError, DistutilsError), why:
+@@ -316,7 +328,7 @@
+ 
+         # Workaround for Cygwin: Cygwin currently has fork issues when many
+         # modules have been imported
+-        if host_platform == 'cygwin':
++        if host_platform in ['cygwin', 'winmingw']:
+             self.announce('WARNING: skipping import check for Cygwin-based "%s"'
+                 % ext.name)
+             return
+@@ -1235,7 +1247,7 @@
+ 
+         dbm_order = ['gdbm']
+         # The standard Unix dbm module:
+-        if host_platform not in ['cygwin']:
++        if host_platform not in ['cygwin', 'winmingw']:
+             config_args = [arg.strip("'")
+                            for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
+             dbm_args = [arg for arg in config_args
+@@ -1327,7 +1339,7 @@
+                 missing.append('resource')
+ 
+             # Sun yellow pages. Some systems have the functions in libc.
+-            if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and
++            if (host_platform not in ['cygwin', 'winmingw', 'atheos', 'qnx6'] and
+                 find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
+                 if (self.compiler.find_library_file(lib_dirs, 'nsl')):
+                     libs = ['nsl']
+@@ -1549,7 +1561,7 @@
+             macros = dict()
+             libraries = []
+ 
+-        elif host_platform == 'cygwin':          # Cygwin
++        elif host_platform == 'cygwin', 'winmingw':          # Cygwin
+             macros = dict()
+             libraries = []
+ 
+@@ -1571,7 +1583,7 @@
+             macros = dict()
+             libraries = ['rt']
+ 
+-        if host_platform == 'win32':
++        if host_platform in ['win32', 'winmingw']:
+             multiprocessing_srcs = [ '_multiprocessing/multiprocessing.c',
+                                      '_multiprocessing/semaphore.c',
+                                      '_multiprocessing/pipe_connection.c',
+@@ -1590,6 +1602,7 @@
+         if sysconfig.get_config_var('WITH_THREAD'):
+             exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
+                                     define_macros=macros.items(),
++                                    libraries=libraries,
+                                     include_dirs=["Modules/_multiprocessing"]))
+         else:
+             missing.append('_multiprocessing')
+@@ -1723,6 +1736,10 @@
+                                      '-framework', 'Carbon']) )
+ 
+ 
++        if platform == 'winmingw':
++            exts.append( Extension('_winreg', ['../PC/_winreg.c']) )
++            exts.append( Extension('winsound', ['../PC/winsound.c'], libraries = ['winmm']) )
++
+         self.extensions.extend(exts)
+ 
+         # Call the method for detecting whether _tkinter can be compiled
+@@ -1932,7 +1949,7 @@
+             added_lib_dirs.append('/usr/X11/lib')
+ 
+         # If Cygwin, then verify that X is installed before proceeding
+-        if host_platform == 'cygwin':
++        if host_platform in ['cygwin', 'winmingw']:
+             x11_inc = find_file('X11/Xlib.h', [], include_dirs)
+             if x11_inc is None:
+                 return
+@@ -1955,7 +1972,7 @@
+             libs.append('ld')
+ 
+         # Finally, link with the X11 libraries (not appropriate on cygwin)
+-        if host_platform != "cygwin":
++        if not host_platform in ["cygwin", "winmingw"]:
+             libs.append('X11')
+ 
+         ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
+@@ -2025,6 +2042,8 @@
+                                if (('--host=' in arg) or ('--build=' in arg))]
+                 if not self.verbose:
+                     config_args.append("-q")
++                if self.get_platform() == "winmingw":
++                    config_args.append(" --build=mingw32")
+ 
+                 # Pass empty CFLAGS because we'll just append the resulting
+                 # CFLAGS to Python's; -g or -O2 is to be avoided.

Added: openoffice/trunk/main/python/python-2.7.9-nohardlink.patch
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/python/python-2.7.9-nohardlink.patch?rev=1758877&view=auto
==============================================================================
--- openoffice/trunk/main/python/python-2.7.9-nohardlink.patch (added)
+++ openoffice/trunk/main/python/python-2.7.9-nohardlink.patch Fri Sep  2 04:43:14 2016
@@ -0,0 +1,11 @@
+--- misc/Python-2.7.9/Makefile.pre.in	2012-04-09 18:07:33.000000000 -0500
++++ misc/build/Python-2.7.9/Makefile.pre.in	2012-07-22 14:54:26.000000000 -0500
+@@ -491,7 +491,7 @@
+ libpython$(VERSION).so: $(LIBRARY_OBJS)
+ 	if test $(INSTSONAME) != $(LDLIBRARY); then \
+ 		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+-		$(LN) -f $(INSTSONAME) $@; \
++		$(LN) -fs $(INSTSONAME) $@; \
+ 	else \
+ 		$(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ 	fi