Brandon Rhodes committed 56e56b2

Broke 0MQ out into a standalone shared object that can be imported specially.

Comments (0)

Files changed (3)

 #define HAVE_STDLIB_H\
 #define HAVE_SYS_FILE_H/' src_uuid/gen_uuid.c
+# Patch pyzmq to load an extra library.
+sed -i '/import initthreads/s/^/import ctypes\
+import os\
+p = os.path.join(os.path.dirname(__file__), "")\
+_zeromq = ctypes.CDLL(p, mode=ctypes.RTLD_GLOBAL)\
+del ctypes, os, p\
+/' zmq/
 # Generate platform.hpp from so that I can compare it
 # against the cached versions.
 for submod, packages in submodules.items():
     for pkg in sorted(packages):
         sources = [pjoin('zmq', submod, pkg+'.c')]
-        sources.extend(static_sources)
         ext = Extension(
             'zmq.%s.%s'%(submod, pkg),
             sources = sources,
+                            sources=static_sources,
+                            include_dirs=include_dirs))
 package_data = {'zmq':['*.pxd'],
 # Imports
+import ctypes
+import os
+p = os.path.join(os.path.dirname(__file__), "")
+_zeromq = ctypes.CDLL(p, mode=ctypes.RTLD_GLOBAL)
+del ctypes, os, p
 from zmq.utils import initthreads # initialize threads