Lines 19-27
Link Here
|
19 |
from distutils.errors import DistutilsPlatformError |
19 |
from distutils.errors import DistutilsPlatformError |
20 |
|
20 |
|
21 |
# These are needed in a couple of spots, so just compute them once. |
21 |
# These are needed in a couple of spots, so just compute them once. |
|
|
22 |
SYSROOT = os.getenv('SYSROOT') |
22 |
PREFIX = os.path.normpath(sys.prefix) |
23 |
PREFIX = os.path.normpath(sys.prefix) |
23 |
EXEC_PREFIX = os.path.normpath(sys.exec_prefix) |
24 |
EXEC_PREFIX = os.path.normpath(sys.exec_prefix) |
24 |
|
25 |
|
|
|
26 |
# Make sure we respect the user specified SYSROOT environment variable |
27 |
# This is the first step to get distutils to crosscompile stuff |
28 |
if SYSROOT is not None: |
29 |
PREFIX = os.path.normpath(SYSROOT+os.path.sep+PREFIX) |
30 |
EXEC_PREFIX = os.path.normpath(SYSROOT+os.path.sep+EXEC_PREFIX) |
31 |
|
25 |
# Path to the base directory of the project. On Windows the binary may |
32 |
# Path to the base directory of the project. On Windows the binary may |
26 |
# live in project/PCBuild9. If we're dealing with an x64 Windows build, |
33 |
# live in project/PCBuild9. If we're dealing with an x64 Windows build, |
27 |
# it'll live in project/PCbuild/amd64. |
34 |
# it'll live in project/PCbuild/amd64. |
Lines 110-115
Link Here
|
110 |
|
117 |
|
111 |
If 'prefix' is supplied, use it instead of sys.prefix or |
118 |
If 'prefix' is supplied, use it instead of sys.prefix or |
112 |
sys.exec_prefix -- i.e., ignore 'plat_specific'. |
119 |
sys.exec_prefix -- i.e., ignore 'plat_specific'. |
|
|
120 |
|
121 |
For the posix system we can not always assume to have a lib64 directory |
122 |
e.g. for cross-compile between 32 & 64 bit systems. So we test if the |
123 |
'lib64' directory exists and use the normal 'lib' dir as fallback. |
113 |
""" |
124 |
""" |
114 |
if prefix is None: |
125 |
if prefix is None: |
115 |
prefix = plat_specific and EXEC_PREFIX or PREFIX |
126 |
prefix = plat_specific and EXEC_PREFIX or PREFIX |
Lines 118-123
Link Here
|
118 |
libpython = os.path.join(prefix, |
129 |
libpython = os.path.join(prefix, |
119 |
"@@GENTOO_LIBDIR@@", |
130 |
"@@GENTOO_LIBDIR@@", |
120 |
"python" + get_python_version()) |
131 |
"python" + get_python_version()) |
|
|
132 |
|
133 |
if not os.path.exists(libpython): |
134 |
libpython = os.path.join(prefix, |
135 |
"lib", |
136 |
"python" + get_python_version()) |
137 |
|
121 |
if standard_lib: |
138 |
if standard_lib: |
122 |
return libpython |
139 |
return libpython |
123 |
else: |
140 |
else: |