xref: /AOO41X/main/python/python-solver-before-std.patch (revision 0eaf9826d6e1f7e3920ed41ccb389ba68f457674)
1*0eaf9826Spfgdiff -ur misc/Python-2.7.12/setup.py misc/build/Python-2.7.12/setup.py
2*0eaf9826Spfg--- misc/Python-2.7.12/setup.py	2016-06-25 16:49:32.000000000 -0500
3*0eaf9826Spfg+++ misc/build/Python-2.7.12/setup.py	2016-09-02 17:09:20.687419000 -0500
4*0eaf9826Spfg@@ -80,39 +80,41 @@
559dd616dSHerbert Dürr         # system, but with only header files and libraries.
659dd616dSHerbert Dürr         sysroot = macosx_sdk_root()
759dd616dSHerbert Dürr
859dd616dSHerbert Dürr-    # Check the standard locations
959dd616dSHerbert Dürr-    for dir in std_dirs:
10*0eaf9826Spfg+    # Check the standard directories
1159dd616dSHerbert Dürr+    for dir in paths:
1259dd616dSHerbert Dürr         f = os.path.join(dir, filename)
1359dd616dSHerbert Dürr
1459dd616dSHerbert Dürr         if host_platform == 'darwin' and is_macosx_sdk_path(dir):
1559dd616dSHerbert Dürr             f = os.path.join(sysroot, dir[1:], filename)
1659dd616dSHerbert Dürr
1759dd616dSHerbert Dürr-        if os.path.exists(f): return []
1859dd616dSHerbert Dürr+        if os.path.exists(f):
1959dd616dSHerbert Dürr+	    return [dir]
2059dd616dSHerbert Dürr
2159dd616dSHerbert Dürr-    # Check the additional directories
2259dd616dSHerbert Dürr-    for dir in paths:
2359dd616dSHerbert Dürr+    # Check the standard locations
2459dd616dSHerbert Dürr+    for dir in std_dirs:
2559dd616dSHerbert Dürr         f = os.path.join(dir, filename)
2659dd616dSHerbert Dürr
2759dd616dSHerbert Dürr         if host_platform == 'darwin' and is_macosx_sdk_path(dir):
2859dd616dSHerbert Dürr             f = os.path.join(sysroot, dir[1:], filename)
2959dd616dSHerbert Dürr
3059dd616dSHerbert Dürr         if os.path.exists(f):
3159dd616dSHerbert Dürr-            return [dir]
3259dd616dSHerbert Dürr+            return []
3359dd616dSHerbert Dürr
3459dd616dSHerbert Dürr     # Not found anywhere
3559dd616dSHerbert Dürr     return None
3659dd616dSHerbert Dürr
3759dd616dSHerbert Dürr def find_library_file(compiler, libname, std_dirs, paths):
3859dd616dSHerbert Dürr-    result = compiler.find_library_file(std_dirs + paths, libname)
3959dd616dSHerbert Dürr+    result = compiler.find_library_file(paths+std_dirs, libname)
4059dd616dSHerbert Dürr     if result is None:
4159dd616dSHerbert Dürr         return None
4259dd616dSHerbert Dürr
4359dd616dSHerbert Dürr     if host_platform == 'darwin':
4459dd616dSHerbert Dürr         sysroot = macosx_sdk_root()
4559dd616dSHerbert Dürr
4659dd616dSHerbert Dürr-    # Check whether the found file is in one of the standard directories
4759dd616dSHerbert Dürr     dirname = os.path.dirname(result)
4859dd616dSHerbert Dürr-    for p in std_dirs:
4959dd616dSHerbert Dürr+    # Otherwise, it must have been in one of the additional directories,
5059dd616dSHerbert Dürr+    # so we have to figure out which one.
5159dd616dSHerbert Dürr+    for p in paths:
5259dd616dSHerbert Dürr         # Ensure path doesn't end with path separator
5359dd616dSHerbert Dürr         p = p.rstrip(os.sep)
5459dd616dSHerbert Dürr
55*0eaf9826Spfg@@ -134,23 +136,22 @@
56*0eaf9826Spfg             # vs
57*0eaf9826Spfg             #   /usr/lib/libedit.dylib
5859dd616dSHerbert Dürr             if os.path.join(sysroot, p[1:]) == dirname:
5959dd616dSHerbert Dürr-                return [ ]
6059dd616dSHerbert Dürr+                return [ p ]
6159dd616dSHerbert Dürr
6259dd616dSHerbert Dürr         if p == dirname:
6359dd616dSHerbert Dürr-            return [ ]
6459dd616dSHerbert Dürr+            return [ p ]
6559dd616dSHerbert Dürr
6659dd616dSHerbert Dürr-    # Otherwise, it must have been in one of the additional directories,
6759dd616dSHerbert Dürr-    # so we have to figure out which one.
6859dd616dSHerbert Dürr-    for p in paths:
6959dd616dSHerbert Dürr+    # Check whether the found file is in one of the standard directories
7059dd616dSHerbert Dürr+    for p in std_dirs:
7159dd616dSHerbert Dürr         # Ensure path doesn't end with path separator
7259dd616dSHerbert Dürr         p = p.rstrip(os.sep)
7359dd616dSHerbert Dürr
7459dd616dSHerbert Dürr         if host_platform == 'darwin' and is_macosx_sdk_path(p):
7559dd616dSHerbert Dürr             if os.path.join(sysroot, p[1:]) == dirname:
7659dd616dSHerbert Dürr-                return [ p ]
7759dd616dSHerbert Dürr+                return [ ]
7859dd616dSHerbert Dürr
7959dd616dSHerbert Dürr         if p == dirname:
8059dd616dSHerbert Dürr-            return [p]
8159dd616dSHerbert Dürr+            return [ ]
8259dd616dSHerbert Dürr     else:
8359dd616dSHerbert Dürr         assert False, "Internal error: Path not found in std_dirs or paths"
8459dd616dSHerbert Dürr
85*0eaf9826Spfg@@ -830,6 +831,7 @@
86d3c32b8cSHerbert Dürr             exts.append( Extension('_ssl', ['_ssl.c'],
87d3c32b8cSHerbert Dürr                                    include_dirs = ssl_incs,
88d3c32b8cSHerbert Dürr                                    library_dirs = ssl_libs,
89d3c32b8cSHerbert Dürr+                                   extra_link_args = ['-Wl,--exclude-libs,ALL'],
90d3c32b8cSHerbert Dürr                                    libraries = ['ssl', 'crypto'],
91d3c32b8cSHerbert Dürr                                    depends = ['socketmodule.h']), )
92d3c32b8cSHerbert Dürr         else:
93*0eaf9826Spfg@@ -869,6 +871,7 @@
94d3c32b8cSHerbert Dürr                 exts.append( Extension('_hashlib', ['_hashopenssl.c'],
95d3c32b8cSHerbert Dürr                                        include_dirs = ssl_incs,
96d3c32b8cSHerbert Dürr                                        library_dirs = ssl_libs,
97d3c32b8cSHerbert Dürr+                                       extra_link_args = ['-Wl,--exclude-libs,ALL'],
98d3c32b8cSHerbert Dürr                                        libraries = ['ssl', 'crypto']) )
99d3c32b8cSHerbert Dürr             else:
100d3c32b8cSHerbert Dürr                 print ("warning: openssl 0x%08x is too old for _hashlib" %
101