diff -r 2e1335245f8f Lib/distutils/command/build_ext.py --- a/Lib/distutils/command/build_ext.py Sun Sep 22 22:46:49 2013 +1000 +++ b/Lib/distutils/command/build_ext.py Sun Sep 22 23:36:48 2013 +1000 @@ -242,11 +242,10 @@ # building python standard extensions self.library_dirs.append('.') - # for extensions under Linux or Solaris with a shared Python library, + # For building extensions with a shared Python library, # Python's library directory must be appended to library_dirs - sysconfig.get_config_var('Py_ENABLE_SHARED') - if (sys.platform.startswith(('linux', 'gnu', 'sunos')) - and sysconfig.get_config_var('Py_ENABLE_SHARED')): + # See Issues: #1600860, #4366 + if (sysconfig.get_config_var('Py_ENABLE_SHARED')): if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): # building third party extensions self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))