diff -Naur pyzmq-17.1.2.orig/setup.py pyzmq-17.1.2/setup.py --- pyzmq-17.1.2.orig/setup.py 2018-08-29 09:08:08.164677400 -0400 +++ pyzmq-17.1.2/setup.py 2018-08-29 09:14:31.101402300 -0400 @@ -25,6 +25,7 @@ import errno import platform from traceback import print_exc +from sysconfig import _POSIX_BUILD # whether any kind of bdist is happening # do this before importing anything from distutils @@ -131,7 +132,7 @@ # is this necessary? if sys.platform.startswith('freebsd'): settings['libraries'].append('pthread') - elif sys.platform.startswith('win'): + elif sys.platform.startswith('win') and not _POSIX_BUILD: # link against libzmq in build dir: plat = distutils.util.get_platform() temp = 'temp.%s-%i.%i' % (plat, sys.version_info[0], sys.version_info[1]) @@ -386,7 +387,7 @@ def create_tempdir(self): self.erase_tempdir() os.makedirs(self.tempdir) - if sys.platform.startswith('win'): + if sys.platform.startswith('win') and not _POSIX_BUILD: # fetch libzmq.dll into local dir local_dll = pjoin(self.tempdir, libzmq_name + '.dll') if not self.config['zmq_prefix'] and not os.path.exists(local_dll): @@ -429,7 +430,7 @@ """ if 'bundle_libzmq_dylib' in self.config: return self.config['bundle_libzmq_dylib'] - elif (sys.platform.startswith('win') or self.cross_compiling) \ + elif ((sys.platform.startswith('win') and not _POSIX_BUILD) or self.cross_compiling) \ and not self.config['libzmq_extension']: # always bundle libzmq on Windows and cross-compilation return True @@ -478,7 +479,7 @@ warn("Detected ZMQ version: %s. Some new features in libzmq may not be exposed by pyzmq." % vs) line() - if sys.platform.startswith('win'): + if sys.platform.startswith('win') and not _POSIX_BUILD: # fetch libzmq.dll into local dir local_dll = localpath('zmq', libzmq_name + '.dll') if not zmq_prefix and not os.path.exists(local_dll): @@ -558,7 +559,7 @@ # this may not be sufficiently precise libzmq.define_macros.append(('ZMQ_USE_POLL', 1)) - if sys.platform.startswith('win'): + if sys.platform.startswith('win') and not _POSIX_BUILD: # include defines from zeromq msvc project: libzmq.define_macros.append(('FD_SETSIZE', 16384)) libzmq.define_macros.append(('DLL_EXPORT', 1))