diff --git a/Misc/NEWS b/Misc/NEWS index 3ff641c6c92..f25664a67c8 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -434,6 +434,8 @@ Build the "bin" directory inside the framework is on the shell's search path. This feature now also supports the ZSH shell. +- Issue #7473: avoid link errors when building a framework with a different + set of architectures than the one that is currently installed. Tests ----- diff --git a/setup.py b/setup.py index 4f895595ce4..cc5358fff76 100644 --- a/setup.py +++ b/setup.py @@ -384,7 +384,12 @@ class PyBuildExt(build_ext): for directory in reversed(options.dirs): add_dir_to_list(dir_list, directory) - if os.path.normpath(sys.prefix) != '/usr': + if os.path.normpath(sys.prefix) != '/usr' \ + and not sysconfig.get_config_var('PYTHONFRAMEWORK'): + # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework + # (PYTHONFRAMEWORK is set) to avoid # linking problems when + # building a framework with different architectures than + # the one that is currently installed (issue #7473) add_dir_to_list(self.compiler.library_dirs, sysconfig.get_config_var("LIBDIR")) add_dir_to_list(self.compiler.include_dirs,