# HG changeset patch # Parent 758a9023d836e2fc5e9f776541c7d9c5b73d9ebe diff -r 758a9023d836 Lib/distutils/command/build_ext.py --- a/Lib/distutils/command/build_ext.py Sun Jul 15 10:57:38 2012 -0700 +++ b/Lib/distutils/command/build_ext.py Mon Jul 16 16:19:25 2012 +0100 @@ -8,6 +8,7 @@ from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler, get_python_version +from distutils.sysconfig import get_config_h_filename from distutils.dep_util import newer_group from distutils.extension import Extension from distutils.util import get_platform @@ -196,7 +197,10 @@ # Append the source distribution include and library directories, # this allows distutils on windows to work in the source tree - self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC')) + self.include_dirs.append(os.path.dirname(get_config_h_filename())) + _sys_home = getattr(sys, '_home', None) + if _sys_home: + self.library_dirs.append(_sys_home) if MSVC_VERSION >= 9: # Use the .lib files for the correct architecture if self.plat_name == 'win32':