if os.name == "posix":
if python_build:
-@@ -116,7 +119,10 @@ def get_python_lib(plat_specific=0, stan
+@@ -115,12 +118,16 @@ def get_python_lib(plat_specific=0, stan
+ If 'prefix' is supplied, use it instead of sys.prefix or
sys.exec_prefix -- i.e., ignore 'plat_specific'.
"""
++ lib_basename = os.getenv("libdir").split('/')[-1]
if prefix is None:
- prefix = plat_specific and EXEC_PREFIX or PREFIX
+ if plat_specific:
-+ prefix = plat_specific and os.environ['STAGING_LIBDIR'].rstrip('lib')
++ prefix = plat_specific and os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
+ else:
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
if os.name == "posix":
libpython = os.path.join(prefix,
-@@ -216,7 +222,7 @@ def get_config_h_filename():
+- "lib", "python" + get_python_version())
++ lib_basename, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+@@ -216,7 +223,7 @@ def get_config_h_filename():
else:
# The name of the config.h file changed in 2.2
config_h = 'pyconfig.h'
def get_makefile_filename():
-@@ -225,7 +231,7 @@ def get_makefile_filename():
+@@ -225,7 +232,7 @@ def get_makefile_filename():
return os.path.join(os.path.dirname(os.path.realpath(sys.executable)),
"Makefile")
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)