summaryrefslogtreecommitdiff
path: root/buildutils
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2014-08-11 16:33:29 -0400
committerMicah Anderson <micah@riseup.net>2014-08-11 16:33:29 -0400
commitcce638a8adf4e045ca5505afea4bda57753c31dd (patch)
treeb5e139d3359ac5b8c7b1afa8acbb1b5b6051c626 /buildutils
initial import of debian package
Diffstat (limited to 'buildutils')
-rw-r--r--buildutils/__init__.py10
-rw-r--r--buildutils/bundle.py197
-rw-r--r--buildutils/check_sys_un.c8
-rw-r--r--buildutils/config.py157
-rw-r--r--buildutils/constants.py83
-rw-r--r--buildutils/detect.py145
-rw-r--r--buildutils/dummy.c5
-rw-r--r--buildutils/include_darwin/platform.hpp271
-rw-r--r--buildutils/include_freebsd/platform.hpp271
-rw-r--r--buildutils/include_linux-armv/platform.hpp265
-rw-r--r--buildutils/include_linux/platform.hpp271
-rw-r--r--buildutils/include_sodium/crypto_scalarmult_curve25519.h44
-rw-r--r--buildutils/include_sodium/crypto_stream_salsa20.h54
-rw-r--r--buildutils/include_sodium/version.h29
-rw-r--r--buildutils/initlibsodium.c45
-rw-r--r--buildutils/initlibzmq.c45
-rw-r--r--buildutils/misc.py15
-rw-r--r--buildutils/msg.py43
-rw-r--r--buildutils/templates/constant_enums.pxi3
-rw-r--r--buildutils/templates/constants.pxi12
-rw-r--r--buildutils/templates/zmq_constants.h6
-rw-r--r--buildutils/vers.c11
22 files changed, 1990 insertions, 0 deletions
diff --git a/buildutils/__init__.py b/buildutils/__init__.py
new file mode 100644
index 0000000..91097f7
--- /dev/null
+++ b/buildutils/__init__.py
@@ -0,0 +1,10 @@
+"""utilities for building pyzmq.
+
+Largely adapted from h5py
+"""
+
+from .msg import *
+from .config import *
+from .detect import *
+from .bundle import *
+from .misc import *
diff --git a/buildutils/bundle.py b/buildutils/bundle.py
new file mode 100644
index 0000000..eb61160
--- /dev/null
+++ b/buildutils/bundle.py
@@ -0,0 +1,197 @@
+"""utilities for fetching build dependencies."""
+
+#-----------------------------------------------------------------------------
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+#
+# This bundling code is largely adapted from pyzmq-static's get.sh by
+# Brandon Craig-Rhodes, which is itself BSD licensed.
+#-----------------------------------------------------------------------------
+
+
+import os
+import shutil
+import stat
+import sys
+import tarfile
+from glob import glob
+from subprocess import Popen, PIPE
+
+try:
+ # py2
+ from urllib2 import urlopen
+except ImportError:
+ # py3
+ from urllib.request import urlopen
+
+from .msg import fatal, debug, info, warn
+
+pjoin = os.path.join
+
+#-----------------------------------------------------------------------------
+# Constants
+#-----------------------------------------------------------------------------
+
+bundled_version = (4,0,4)
+libzmq = "zeromq-%i.%i.%i.tar.gz" % (bundled_version)
+libzmq_url = "http://download.zeromq.org/" + libzmq
+
+libsodium_version = (0,4,5)
+libsodium = "libsodium-%i.%i.%i.tar.gz" % (libsodium_version)
+libsodium_url = "https://github.com/jedisct1/libsodium/releases/download/%i.%i.%i/" % libsodium_version + libsodium
+
+HERE = os.path.dirname(__file__)
+ROOT = os.path.dirname(HERE)
+
+#-----------------------------------------------------------------------------
+# Utilities
+#-----------------------------------------------------------------------------
+
+
+def untgz(archive):
+ return archive.replace('.tar.gz', '')
+
+def localpath(*args):
+ """construct an absolute path from a list relative to the root pyzmq directory"""
+ plist = [ROOT] + list(args)
+ return os.path.abspath(pjoin(*plist))
+
+def fetch_archive(savedir, url, fname, force=False):
+ """download an archive to a specific location"""
+ dest = pjoin(savedir, fname)
+ if os.path.exists(dest) and not force:
+ info("already have %s" % fname)
+ return dest
+ info("fetching %s into %s" % (url, savedir))
+ if not os.path.exists(savedir):
+ os.makedirs(savedir)
+ req = urlopen(url)
+ with open(dest, 'wb') as f:
+ f.write(req.read())
+ return dest
+
+#-----------------------------------------------------------------------------
+# libsodium
+#-----------------------------------------------------------------------------
+
+def fetch_libsodium(savedir):
+ """download and extract libsodium"""
+ dest = pjoin(savedir, 'libsodium')
+ if os.path.exists(dest):
+ info("already have %s" % dest)
+ return
+ fname = fetch_archive(savedir, libsodium_url, libsodium)
+ tf = tarfile.open(fname)
+ with_version = pjoin(savedir, tf.firstmember.path)
+ tf.extractall(savedir)
+ tf.close()
+ # remove version suffix:
+ shutil.move(with_version, dest)
+
+def stage_libsodium_headers(libsodium_root):
+ """stage configure headers for libsodium"""
+ src_dir = pjoin(HERE, 'include_sodium')
+ dest_dir = pjoin(libsodium_root, 'src', 'libsodium', 'include', 'sodium')
+ for src in glob(pjoin(src_dir, '*.h')):
+ base = os.path.basename(src)
+ dest = pjoin(dest_dir, base)
+ if os.path.exists(dest):
+ info("already have %s" % base)
+ continue
+ info("staging %s to %s" % (src, dest))
+ shutil.copy(src, dest)
+
+#-----------------------------------------------------------------------------
+# libzmq
+#-----------------------------------------------------------------------------
+
+def fetch_libzmq(savedir):
+ """download and extract libzmq"""
+ dest = pjoin(savedir, 'zeromq')
+ if os.path.exists(dest):
+ info("already have %s" % dest)
+ return
+ fname = fetch_archive(savedir, libzmq_url, libzmq)
+ tf = tarfile.open(fname)
+ with_version = pjoin(savedir, tf.firstmember.path)
+ tf.extractall(savedir)
+ tf.close()
+ # remove version suffix:
+ shutil.move(with_version, dest)
+
+def stage_platform_hpp(zmqroot):
+ """stage platform.hpp into libzmq sources
+
+ Tries ./configure first (except on Windows),
+ then falls back on included platform.hpp previously generated.
+ """
+
+ platform_hpp = pjoin(zmqroot, 'src', 'platform.hpp')
+ if os.path.exists(platform_hpp):
+ info("already have platform.hpp")
+ return
+ if os.name == 'nt':
+ # stage msvc platform header
+ platform_dir = pjoin(zmqroot, 'builds', 'msvc')
+ else:
+ info("attempting ./configure to generate platform.hpp")
+
+ p = Popen('./configure', cwd=zmqroot, shell=True,
+ stdout=PIPE, stderr=PIPE,
+ )
+ o,e = p.communicate()
+ if p.returncode:
+ warn("failed to configure libzmq:\n%s" % e)
+ if sys.platform == 'darwin':
+ platform_dir = pjoin(HERE, 'include_darwin')
+ elif sys.platform.startswith('freebsd'):
+ platform_dir = pjoin(HERE, 'include_freebsd')
+ elif sys.platform.startswith('linux-armv'):
+ platform_dir = pjoin(HERE, 'include_linux-armv')
+ else:
+ platform_dir = pjoin(HERE, 'include_linux')
+ else:
+ return
+
+ info("staging platform.hpp from: %s" % platform_dir)
+ shutil.copy(pjoin(platform_dir, 'platform.hpp'), platform_hpp)
+
+
+def copy_and_patch_libzmq(ZMQ, libzmq):
+ """copy libzmq into source dir, and patch it if necessary.
+
+ This command is necessary prior to running a bdist on Linux or OS X.
+ """
+ if sys.platform.startswith('win'):
+ return
+ # copy libzmq into zmq for bdist
+ local = localpath('zmq',libzmq)
+ if not ZMQ and not os.path.exists(local):
+ fatal("Please specify zmq prefix via `setup.py configure --zmq=/path/to/zmq` "
+ "or copy libzmq into zmq/ manually prior to running bdist.")
+ try:
+ # resolve real file through symlinks
+ lib = os.path.realpath(pjoin(ZMQ, 'lib', libzmq))
+ print ("copying %s -> %s"%(lib, local))
+ shutil.copy(lib, local)
+ except Exception:
+ if not os.path.exists(local):
+ fatal("Could not copy libzmq into zmq/, which is necessary for bdist. "
+ "Please specify zmq prefix via `setup.py configure --zmq=/path/to/zmq` "
+ "or copy libzmq into zmq/ manually.")
+
+ if sys.platform == 'darwin':
+ # chmod u+w on the lib,
+ # which can be user-read-only for some reason
+ mode = os.stat(local).st_mode
+ os.chmod(local, mode | stat.S_IWUSR)
+ # patch install_name on darwin, instead of using rpath
+ cmd = ['install_name_tool', '-id', '@loader_path/../%s'%libzmq, local]
+ try:
+ p = Popen(cmd, stdout=PIPE,stderr=PIPE)
+ except OSError:
+ fatal("install_name_tool not found, cannot patch libzmq for bundling.")
+ out,err = p.communicate()
+ if p.returncode:
+ fatal("Could not patch bundled libzmq install_name: %s"%err, p.returncode)
+
diff --git a/buildutils/check_sys_un.c b/buildutils/check_sys_un.c
new file mode 100644
index 0000000..8c013c4
--- /dev/null
+++ b/buildutils/check_sys_un.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+#include "sys/un.h"
+
+int main(int argc, char **argv) {
+ struct sockaddr_un *dummy;
+ printf("%lu\n", sizeof(dummy->sun_path) - 1);
+ return 0;
+}
diff --git a/buildutils/config.py b/buildutils/config.py
new file mode 100644
index 0000000..c674655
--- /dev/null
+++ b/buildutils/config.py
@@ -0,0 +1,157 @@
+"""Config functions"""
+#-----------------------------------------------------------------------------
+# Copyright (C) PyZMQ Developers
+#
+# This file is part of pyzmq, copied and adapted from h5py.
+# h5py source used under the New BSD license
+#
+# h5py: <http://code.google.com/p/h5py/>
+#
+# Distributed under the terms of the New BSD License. The full license is in
+# the file COPYING.BSD, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+import sys
+import os
+import json
+
+try:
+ from configparser import ConfigParser
+except:
+ from ConfigParser import ConfigParser
+
+pjoin = os.path.join
+from .msg import debug, fatal, warn
+
+#-----------------------------------------------------------------------------
+# Utility functions (adapted from h5py: http://h5py.googlecode.com)
+#-----------------------------------------------------------------------------
+
+
+def load_config(name, base='conf'):
+ """Load config dict from JSON"""
+ fname = pjoin(base, name + '.json')
+ if not os.path.exists(fname):
+ return {}
+ try:
+ with open(fname) as f:
+ cfg = json.load(f)
+ except Exception as e:
+ warn("Couldn't load %s: %s" % (fname, e))
+ cfg = {}
+ return cfg
+
+
+def save_config(name, data, base='conf'):
+ """Save config dict to JSON"""
+ if not os.path.exists(base):
+ os.mkdir(base)
+ fname = pjoin(base, name+'.json')
+ with open(fname, 'w') as f:
+ json.dump(data, f, indent=2)
+
+
+def v_str(v_tuple):
+ """turn (2,0,1) into '2.0.1'."""
+ return ".".join(str(x) for x in v_tuple)
+
+def get_eargs():
+ """ Look for options in environment vars """
+
+ settings = {}
+
+ zmq = os.environ.get("ZMQ_PREFIX", None)
+ if zmq is not None:
+ debug("Found environ var ZMQ_PREFIX=%s" % zmq)
+ settings['zmq_prefix'] = zmq
+
+ return settings
+
+def cfg2dict(cfg):
+ """turn a ConfigParser into a nested dict
+
+ because ConfigParser objects are dumb.
+ """
+ d = {}
+ for section in cfg.sections():
+ d[section] = dict(cfg.items(section))
+ return d
+
+def get_cfg_args():
+ """ Look for options in setup.cfg """
+
+ if not os.path.exists('setup.cfg'):
+ return {}
+ cfg = ConfigParser()
+ cfg.read('setup.cfg')
+ cfg = cfg2dict(cfg)
+
+ g = cfg.setdefault('global', {})
+ # boolean keys:
+ for key in ['libzmq_extension',
+ 'bundle_libzmq_dylib',
+ 'no_libzmq_extension',
+ 'have_sys_un_h',
+ 'skip_check_zmq',
+ ]:
+ if key in g:
+ g[key] = eval(g[key])
+
+ # globals go to top level
+ cfg.update(cfg.pop('global'))
+ return cfg
+
+def config_from_prefix(prefix):
+ """Get config from zmq prefix"""
+ settings = {}
+ if prefix.lower() in ('default', 'auto', ''):
+ settings['zmq_prefix'] = ''
+ settings['libzmq_extension'] = False
+ settings['no_libzmq_extension'] = False
+ elif prefix.lower() in ('bundled', 'extension'):
+ settings['zmq_prefix'] = ''
+ settings['libzmq_extension'] = True
+ settings['no_libzmq_extension'] = False
+ else:
+ settings['zmq_prefix'] = prefix
+ settings['libzmq_extension'] = False
+ settings['no_libzmq_extension'] = True
+ return settings
+
+def merge(into, d):
+ """merge two containers
+
+ into is updated, d has priority
+ """
+ if isinstance(into, dict):
+ for key in d.keys():
+ if key not in into:
+ into[key] = d[key]
+ else:
+ into[key] = merge(into[key], d[key])
+ return into
+ elif isinstance(into, list):
+ return into + d
+ else:
+ return d
+
+def discover_settings(conf_base=None):
+ """ Discover custom settings for ZMQ path"""
+ settings = {
+ 'zmq_prefix': '',
+ 'libzmq_extension': False,
+ 'no_libzmq_extension': False,
+ 'skip_check_zmq': False,
+ 'build_ext': {},
+ 'bdist_egg': {},
+ }
+ if sys.platform.startswith('win'):
+ settings['have_sys_un_h'] = False
+
+ if conf_base:
+ # lowest priority
+ merge(settings, load_config('config', conf_base))
+ merge(settings, get_cfg_args())
+ merge(settings, get_eargs())
+
+ return settings
diff --git a/buildutils/constants.py b/buildutils/constants.py
new file mode 100644
index 0000000..ad8a499
--- /dev/null
+++ b/buildutils/constants.py
@@ -0,0 +1,83 @@
+"""
+script for generating files that involve repetitive updates for zmq constants.
+
+Run this after updating utils/constant_names
+
+Currently generates the following files from templates:
+
+- constant_enums.pxi
+- constants.pxi
+- zmq_constants.h
+
+"""
+
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+import os
+import sys
+
+from . import info
+pjoin = os.path.join
+
+root = os.path.abspath(pjoin(os.path.dirname(__file__), os.path.pardir))
+
+sys.path.insert(0, pjoin(root, 'zmq', 'utils'))
+from constant_names import all_names, no_prefix
+
+ifndef_t = """#ifndef {0}
+ #define {0} (-1)
+#endif
+"""
+
+def cython_enums():
+ """generate `enum: ZMQ_CONST` block for constant_enums.pxi"""
+ lines = []
+ for name in all_names:
+ if no_prefix(name):
+ lines.append('enum: ZMQ_{0} "{0}"'.format(name))
+ else:
+ lines.append('enum: ZMQ_{0}'.format(name))
+
+ return dict(ZMQ_ENUMS='\n '.join(lines))
+
+def ifndefs():
+ """generate `#ifndef ZMQ_CONST` block for zmq_constants.h"""
+ lines = []
+ for name in all_names:
+ if not no_prefix(name):
+ name = 'ZMQ_%s' % name
+ lines.append(ifndef_t.format(name))
+ return dict(ZMQ_IFNDEFS='\n'.join(lines))
+
+def constants_pyx():
+ """generate CONST = ZMQ_CONST and __all__ for constants.pxi"""
+ all_lines = []
+ assign_lines = []
+ for name in all_names:
+ if name == "NULL":
+ # avoid conflict with NULL in Cython
+ assign_lines.append("globals()['NULL'] = ZMQ_NULL")
+ else:
+ assign_lines.append('{0} = ZMQ_{0}'.format(name))
+ all_lines.append(' "{0}",'.format(name))
+ return dict(ASSIGNMENTS='\n'.join(assign_lines), ALL='\n'.join(all_lines))
+
+def generate_file(fname, ns_func, dest_dir="."):
+ """generate a constants file from its template"""
+ with open(pjoin(root, 'buildutils', 'templates', '%s' % fname), 'r') as f:
+ tpl = f.read()
+ out = tpl.format(**ns_func())
+ dest = pjoin(dest_dir, fname)
+ info("generating %s from template" % dest)
+ with open(dest, 'w') as f:
+ f.write(out)
+
+def render_constants():
+ """render generated constant files from templates"""
+ generate_file("constant_enums.pxi", cython_enums, pjoin(root, 'zmq', 'backend', 'cython'))
+ generate_file("constants.pxi", constants_pyx, pjoin(root, 'zmq', 'backend', 'cython'))
+ generate_file("zmq_constants.h", ifndefs, pjoin(root, 'zmq', 'utils'))
+
+if __name__ == '__main__':
+ render_constants()
diff --git a/buildutils/detect.py b/buildutils/detect.py
new file mode 100644
index 0000000..04dd17a
--- /dev/null
+++ b/buildutils/detect.py
@@ -0,0 +1,145 @@
+"""Detect zmq version"""
+#-----------------------------------------------------------------------------
+# Copyright (C) PyZMQ Developers
+#
+# This file is part of pyzmq, copied and adapted from h5py.
+# h5py source used under the New BSD license
+#
+# h5py: <http://code.google.com/p/h5py/>
+#
+# Distributed under the terms of the New BSD License. The full license is in
+# the file COPYING.BSD, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+import shutil
+import sys
+import os
+import logging
+import platform
+from distutils import ccompiler
+from distutils.sysconfig import customize_compiler
+from subprocess import Popen, PIPE
+
+from .misc import customize_mingw
+
+pjoin = os.path.join
+
+#-----------------------------------------------------------------------------
+# Utility functions (adapted from h5py: http://h5py.googlecode.com)
+#-----------------------------------------------------------------------------
+
+def test_compilation(cfile, compiler=None, **compiler_attrs):
+ """Test simple compilation with given settings"""
+ if compiler is None or isinstance(compiler, str):
+ cc = ccompiler.new_compiler(compiler=compiler)
+ customize_compiler(cc)
+ if cc.compiler_type == 'mingw32':
+ customize_mingw(cc)
+ else:
+ cc = compiler
+
+ for name, val in compiler_attrs.items():
+ setattr(cc, name, val)
+
+ efile, ext = os.path.splitext(cfile)
+
+ cpreargs = lpreargs = None
+ if sys.platform == 'darwin':
+ # use appropriate arch for compiler
+ if platform.architecture()[0]=='32bit':
+ if platform.processor() == 'powerpc':
+ cpu = 'ppc'
+ else:
+ cpu = 'i386'
+ cpreargs = ['-arch', cpu]
+ lpreargs = ['-arch', cpu, '-undefined', 'dynamic_lookup']
+ else:
+ # allow for missing UB arch, since it will still work:
+ lpreargs = ['-undefined', 'dynamic_lookup']
+ if sys.platform == 'sunos5':
+ if platform.architecture()[0]=='32bit':
+ lpreargs = ['-m32']
+ else:
+ lpreargs = ['-m64']
+ extra = compiler_attrs.get('extra_compile_args', None)
+
+ objs = cc.compile([cfile],extra_preargs=cpreargs, extra_postargs=extra)
+ cc.link_executable(objs, efile, extra_preargs=lpreargs)
+ return efile
+
+def compile_and_run(basedir, src, compiler=None, **compiler_attrs):
+ if not os.path.exists(basedir):
+ os.makedirs(basedir)
+ cfile = pjoin(basedir, os.path.basename(src))
+ shutil.copy(src, cfile)
+ try:
+ efile = test_compilation(cfile, compiler=compiler, **compiler_attrs)
+ result = Popen(efile, stdout=PIPE, stderr=PIPE)
+ so, se = result.communicate()
+ # for py3k:
+ so = so.decode()
+ se = se.decode()
+ finally:
+ shutil.rmtree(basedir)
+
+ return result.returncode, so, se
+
+
+def detect_zmq(basedir, compiler=None, **compiler_attrs):
+ """Compile, link & execute a test program, in empty directory `basedir`.
+
+ The C compiler will be updated with any keywords given via setattr.
+
+ Parameters
+ ----------
+
+ basedir : path
+ The location where the test program will be compiled and run
+ compiler : str
+ The distutils compiler key (e.g. 'unix', 'msvc', or 'mingw32')
+ **compiler_attrs : dict
+ Any extra compiler attributes, which will be set via ``setattr(cc)``.
+
+ Returns
+ -------
+
+ A dict of properties for zmq compilation, with the following two keys:
+
+ vers : tuple
+ The ZMQ version as a tuple of ints, e.g. (2,2,0)
+ settings : dict
+ The compiler options used to compile the test function, e.g. `include_dirs`,
+ `library_dirs`, `libs`, etc.
+ """
+
+ cfile = pjoin(basedir, 'vers.c')
+ shutil.copy(pjoin(os.path.dirname(__file__), 'vers.c'), cfile)
+
+ # check if we need to link against Realtime Extensions library
+ if sys.platform.startswith('linux'):
+ cc = ccompiler.new_compiler(compiler=compiler)
+ cc.output_dir = basedir
+ if not cc.has_function('timer_create'):
+ compiler_attrs['libraries'].append('rt')
+
+ efile = test_compilation(cfile, compiler=compiler, **compiler_attrs)
+
+ result = Popen(efile, stdout=PIPE, stderr=PIPE)
+ so, se = result.communicate()
+ # for py3k:
+ so = so.decode()
+ se = se.decode()
+ if result.returncode:
+ msg = "Error running version detection script:\n%s\n%s" % (so,se)
+ logging.error(msg)
+ raise IOError(msg)
+
+ handlers = {'vers': lambda val: tuple(int(v) for v in val.split('.'))}
+
+ props = {}
+ for line in (x for x in so.split('\n') if x):
+ key, val = line.split(':')
+ props[key] = handlers[key](val)
+
+ return props
+
diff --git a/buildutils/dummy.c b/buildutils/dummy.c
new file mode 100644
index 0000000..4dbdc60
--- /dev/null
+++ b/buildutils/dummy.c
@@ -0,0 +1,5 @@
+// empty file, just to test compilation
+
+int main(int argc, char **argv){
+ return 0;
+}
diff --git a/buildutils/include_darwin/platform.hpp b/buildutils/include_darwin/platform.hpp
new file mode 100644
index 0000000..0a18e82
--- /dev/null
+++ b/buildutils/include_darwin/platform.hpp
@@ -0,0 +1,271 @@
+/* src/platform.hpp. Generated from platform.hpp.in by configure. */
+/* src/platform.hpp.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <alloca.h> header file. */
+#define HAVE_ALLOCA_H 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the `clock_gettime' function. */
+/* #undef HAVE_CLOCK_GETTIME */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if you have the `freeifaddrs' function. */
+#define HAVE_FREEIFADDRS 1
+
+/* Define to 1 if you have the `gethrtime' function. */
+/* #undef HAVE_GETHRTIME */
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#define HAVE_GETIFADDRS 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the <ifaddrs.h> header file. */
+#define HAVE_IFADDRS_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */
+/* #undef HAVE_LIBIPHLPAPI */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#define HAVE_LIBPTHREAD 1
+
+/* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */
+/* #undef HAVE_LIBRPCRT4 */
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+/* #undef HAVE_LIBRT */
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the `sodium' library (-lsodium). */
+/* #undef HAVE_LIBSODIUM */
+
+/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
+/* #undef HAVE_LIBWS2_32 */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#define HAVE_NETINET_TCP_H 1
+
+/* Define to 1 if you have the `perror' function. */
+#define HAVE_PERROR 1
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+/* #undef HAVE_SYS_EVENTFD_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define HAVE_SYS_UIO_H 1
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+/* #undef HAVE_WINDOWS_H */
+
+/* Define to 1 if the system has the type `_Bool'. */
+/* #undef HAVE__BOOL */
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "zeromq"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "zeromq-dev@lists.zeromq.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "zeromq"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "zeromq 4.0.4"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "zeromq"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "4.0.4"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define VERSION "4.0.4"
+
+/* Force to use mutexes */
+/* #undef ZMQ_FORCE_MUTEXES */
+
+/* Have AIX OS */
+/* #undef ZMQ_HAVE_AIX */
+
+/* Have Android OS */
+/* #undef ZMQ_HAVE_ANDROID */
+
+/* Have Cygwin */
+/* #undef ZMQ_HAVE_CYGWIN */
+
+/* Have eventfd extension. */
+/* #undef ZMQ_HAVE_EVENTFD */
+
+/* Have FreeBSD OS */
+/* #undef ZMQ_HAVE_FREEBSD */
+
+/* Have HPUX OS */
+/* #undef ZMQ_HAVE_HPUX */
+
+/* Have ifaddrs.h header. */
+#define ZMQ_HAVE_IFADDRS 1
+
+/* Have Linux OS */
+/* #undef ZMQ_HAVE_LINUX */
+
+/* Have MinGW32 */
+/* #undef ZMQ_HAVE_MINGW32 */
+
+/* Have NetBSD OS */
+/* #undef ZMQ_HAVE_NETBSD */
+
+/* Have OpenBSD OS */
+/* #undef ZMQ_HAVE_OPENBSD */
+
+/* Have OpenPGM extension */
+/* #undef ZMQ_HAVE_OPENPGM */
+
+/* Have DarwinOSX OS */
+#define ZMQ_HAVE_OSX 1
+
+/* Have QNX Neutrino OS */
+/* #undef ZMQ_HAVE_QNXNTO */
+
+/* Whether SOCK_CLOEXEC is defined and functioning. */
+/* #undef ZMQ_HAVE_SOCK_CLOEXEC */
+
+/* Have Solaris OS */
+/* #undef ZMQ_HAVE_SOLARIS */
+
+/* Whether SO_KEEPALIVE is supported. */
+#define ZMQ_HAVE_SO_KEEPALIVE 1
+
+/* Whether TCP_KEEPALIVE is supported. */
+#define ZMQ_HAVE_TCP_KEEPALIVE 1
+
+/* Whether TCP_KEEPCNT is supported. */
+/* #undef ZMQ_HAVE_TCP_KEEPCNT */
+
+/* Whether TCP_KEEPIDLE is supported. */
+/* #undef ZMQ_HAVE_TCP_KEEPIDLE */
+
+/* Whether TCP_KEEPINTVL is supported. */
+/* #undef ZMQ_HAVE_TCP_KEEPINTVL */
+
+/* Have uio.h header. */
+#define ZMQ_HAVE_UIO 1
+
+/* Have Windows OS */
+/* #undef ZMQ_HAVE_WINDOWS */
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef ssize_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
diff --git a/buildutils/include_freebsd/platform.hpp b/buildutils/include_freebsd/platform.hpp
new file mode 100644
index 0000000..6fce15b
--- /dev/null
+++ b/buildutils/include_freebsd/platform.hpp
@@ -0,0 +1,271 @@
+/* src/platform.hpp. Generated from platform.hpp.in by configure. */
+/* src/platform.hpp.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <alloca.h> header file. */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if you have the `freeifaddrs' function. */
+#define HAVE_FREEIFADDRS 1
+
+/* Define to 1 if you have the `gethrtime' function. */
+/* #undef HAVE_GETHRTIME */
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#define HAVE_GETIFADDRS 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the <ifaddrs.h> header file. */
+#define HAVE_IFADDRS_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */
+/* #undef HAVE_LIBIPHLPAPI */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#define HAVE_LIBPTHREAD 1
+
+/* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */
+/* #undef HAVE_LIBRPCRT4 */
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+#define HAVE_LIBRT 1
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the `sodium' library (-lsodium). */
+/* #undef HAVE_LIBSODIUM */
+
+/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
+/* #undef HAVE_LIBWS2_32 */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#define HAVE_NETINET_TCP_H 1
+
+/* Define to 1 if you have the `perror' function. */
+#define HAVE_PERROR 1
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if stdbool.h conforms to C99. */
+/* #undef HAVE_STDBOOL_H */
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+/* #undef HAVE_SYS_EVENTFD_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define HAVE_SYS_UIO_H 1
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+/* #undef HAVE_WINDOWS_H */
+
+/* Define to 1 if the system has the type `_Bool'. */
+/* #undef HAVE__BOOL */
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "zeromq"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "zeromq-dev@lists.zeromq.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "zeromq"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "zeromq 4.0.4"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "zeromq"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "4.0.4"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define VERSION "4.0.4"
+
+/* Force to use mutexes */
+/* #undef ZMQ_FORCE_MUTEXES */
+
+/* Have AIX OS */
+/* #undef ZMQ_HAVE_AIX */
+
+/* Have Android OS */
+/* #undef ZMQ_HAVE_ANDROID */
+
+/* Have Cygwin */
+/* #undef ZMQ_HAVE_CYGWIN */
+
+/* Have eventfd extension. */
+/* #undef ZMQ_HAVE_EVENTFD */
+
+/* Have FreeBSD OS */
+#define ZMQ_HAVE_FREEBSD 1
+
+/* Have HPUX OS */
+/* #undef ZMQ_HAVE_HPUX */
+
+/* Have ifaddrs.h header. */
+#define ZMQ_HAVE_IFADDRS 1
+
+/* Have Linux OS */
+/* #undef ZMQ_HAVE_LINUX */
+
+/* Have MinGW32 */
+/* #undef ZMQ_HAVE_MINGW32 */
+
+/* Have NetBSD OS */
+/* #undef ZMQ_HAVE_NETBSD */
+
+/* Have OpenBSD OS */
+/* #undef ZMQ_HAVE_OPENBSD */
+
+/* Have OpenPGM extension */
+/* #undef ZMQ_HAVE_OPENPGM */
+
+/* Have DarwinOSX OS */
+/* #undef ZMQ_HAVE_OSX */
+
+/* Have QNX Neutrino OS */
+/* #undef ZMQ_HAVE_QNXNTO */
+
+/* Whether SOCK_CLOEXEC is defined and functioning. */
+#define ZMQ_HAVE_SOCK_CLOEXEC 1
+
+/* Have Solaris OS */
+/* #undef ZMQ_HAVE_SOLARIS */
+
+/* Whether SO_KEEPALIVE is supported. */
+#define ZMQ_HAVE_SO_KEEPALIVE 1
+
+/* Whether TCP_KEEPALIVE is supported. */
+/* #undef ZMQ_HAVE_TCP_KEEPALIVE */
+
+/* Whether TCP_KEEPCNT is supported. */
+#define ZMQ_HAVE_TCP_KEEPCNT 1
+
+/* Whether TCP_KEEPIDLE is supported. */
+#define ZMQ_HAVE_TCP_KEEPIDLE 1
+
+/* Whether TCP_KEEPINTVL is supported. */
+#define ZMQ_HAVE_TCP_KEEPINTVL 1
+
+/* Have uio.h header. */
+#define ZMQ_HAVE_UIO 1
+
+/* Have Windows OS */
+/* #undef ZMQ_HAVE_WINDOWS */
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef ssize_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
diff --git a/buildutils/include_linux-armv/platform.hpp b/buildutils/include_linux-armv/platform.hpp
new file mode 100644
index 0000000..39c7368
--- /dev/null
+++ b/buildutils/include_linux-armv/platform.hpp
@@ -0,0 +1,265 @@
+/* src/platform.hpp. Generated from platform.hpp.in by configure. */
+/* src/platform.hpp.in. Generated from configure.in by autoheader. */
+
+/* Define to 1 if you have the <alloca.h> header file. */
+#define HAVE_ALLOCA_H 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the `freeifaddrs' function. */
+/* #undef HAVE_FREEIFADDRS */
+
+/* Define to 1 if you have the `gethrtime' function. */
+/* #undef HAVE_GETHRTIME */
+
+/* Define to 1 if you have the `getifaddrs' function. */
+/* #undef HAVE_GETIFADDRS */
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the <ifaddrs.h> header file. */
+/* #undef HAVE_IFADDRS_H */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */
+/* #undef HAVE_LIBIPHLPAPI */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+/* #undef HAVE_LIBPTHREAD */
+
+/* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */
+/* #undef HAVE_LIBRPCRT4 */
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+/* #undef HAVE_LIBRT */
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
+/* #undef HAVE_LIBWS2_32 */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#define HAVE_NETINET_TCP_H 1
+
+/* Define to 1 if you have the `perror' function. */
+#define HAVE_PERROR 1
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+/* #undef HAVE_SYS_EVENTFD_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define HAVE_SYS_UIO_H 1
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+/* #undef HAVE_WINDOWS_H */
+
+/* Define to 1 if the system has the type `_Bool'. */
+/* #undef HAVE__BOOL */
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "zeromq"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "zeromq-dev@lists.zeromq.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "zeromq"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "zeromq 3.2.1"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "zeromq"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "3.2.1"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define VERSION "3.2.1"
+
+/* Force to use mutexes */
+/* #undef ZMQ_FORCE_MUTEXES */
+
+/* Have AIX OS */
+/* #undef ZMQ_HAVE_AIX */
+
+/* Have Android OS */
+#define ZMQ_HAVE_ANDROID 1
+
+/* Have Cygwin */
+/* #undef ZMQ_HAVE_CYGWIN */
+
+/* Have eventfd extension. */
+/* #undef ZMQ_HAVE_EVENTFD */
+
+/* Have FreeBSD OS */
+/* #undef ZMQ_HAVE_FREEBSD */
+
+/* Have HPUX OS */
+/* #undef ZMQ_HAVE_HPUX */
+
+/* Have ifaddrs.h header. */
+/* #undef ZMQ_HAVE_IFADDRS */
+
+/* Have Linux OS */
+#define ZMQ_HAVE_LINUX 1
+
+/* Have MinGW32 */
+/* #undef ZMQ_HAVE_MINGW32 */
+
+/* Have NetBSD OS */
+/* #undef ZMQ_HAVE_NETBSD */
+
+/* Have OpenBSD OS */
+/* #undef ZMQ_HAVE_OPENBSD */
+
+/* Have OpenPGM extension */
+/* #undef ZMQ_HAVE_OPENPGM */
+
+/* Have DarwinOSX OS */
+/* #undef ZMQ_HAVE_OSX */
+
+/* Have QNX Neutrino OS */
+/* #undef ZMQ_HAVE_QNXNTO */
+
+/* Whether SOCK_CLOEXEC is defined and functioning. */
+/* #undef ZMQ_HAVE_SOCK_CLOEXEC */
+
+/* Have Solaris OS */
+/* #undef ZMQ_HAVE_SOLARIS */
+
+/* Whether SO_KEEPALIVE is supported. */
+/* #undef ZMQ_HAVE_SO_KEEPALIVE */
+
+/* Whether TCP_KEEPALIVE is supported. */
+/* #undef ZMQ_HAVE_TCP_KEEPALIVE */
+
+/* Whether TCP_KEEPCNT is supported. */
+/* #undef ZMQ_HAVE_TCP_KEEPCNT */
+
+/* Whether TCP_KEEPIDLE is supported. */
+/* #undef ZMQ_HAVE_TCP_KEEPIDLE */
+
+/* Whether TCP_KEEPINTVL is supported. */
+/* #undef ZMQ_HAVE_TCP_KEEPINTVL */
+
+/* Have uio.h header. */
+#define ZMQ_HAVE_UIO 1
+
+/* Have Windows OS */
+/* #undef ZMQ_HAVE_WINDOWS */
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef ssize_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
diff --git a/buildutils/include_linux/platform.hpp b/buildutils/include_linux/platform.hpp
new file mode 100644
index 0000000..da4c816
--- /dev/null
+++ b/buildutils/include_linux/platform.hpp
@@ -0,0 +1,271 @@
+/* src/platform.hpp. Generated from platform.hpp.in by configure. */
+/* src/platform.hpp.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <alloca.h> header file. */
+#define HAVE_ALLOCA_H 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if you have the `freeifaddrs' function. */
+#define HAVE_FREEIFADDRS 1
+
+/* Define to 1 if you have the `gethrtime' function. */
+/* #undef HAVE_GETHRTIME */
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#define HAVE_GETIFADDRS 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the <ifaddrs.h> header file. */
+#define HAVE_IFADDRS_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */
+/* #undef HAVE_LIBIPHLPAPI */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#define HAVE_LIBPTHREAD 1
+
+/* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */
+/* #undef HAVE_LIBRPCRT4 */
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+#define HAVE_LIBRT 1
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the `sodium' library (-lsodium). */
+/* #undef HAVE_LIBSODIUM */
+
+/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
+/* #undef HAVE_LIBWS2_32 */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#define HAVE_NETINET_TCP_H 1
+
+/* Define to 1 if you have the `perror' function. */
+#define HAVE_PERROR 1
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+#define HAVE_SYS_EVENTFD_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define HAVE_SYS_UIO_H 1
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+/* #undef HAVE_WINDOWS_H */
+
+/* Define to 1 if the system has the type `_Bool'. */
+/* #undef HAVE__BOOL */
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "zeromq"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "zeromq-dev@lists.zeromq.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "zeromq"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "zeromq 4.0.4"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "zeromq"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "4.0.4"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define VERSION "4.0.4"
+
+/* Force to use mutexes */
+/* #undef ZMQ_FORCE_MUTEXES */
+
+/* Have AIX OS */
+/* #undef ZMQ_HAVE_AIX */
+
+/* Have Android OS */
+/* #undef ZMQ_HAVE_ANDROID */
+
+/* Have Cygwin */
+/* #undef ZMQ_HAVE_CYGWIN */
+
+/* Have eventfd extension. */
+#define ZMQ_HAVE_EVENTFD 1
+
+/* Have FreeBSD OS */
+/* #undef ZMQ_HAVE_FREEBSD */
+
+/* Have HPUX OS */
+/* #undef ZMQ_HAVE_HPUX */
+
+/* Have ifaddrs.h header. */
+#define ZMQ_HAVE_IFADDRS 1
+
+/* Have Linux OS */
+#define ZMQ_HAVE_LINUX 1
+
+/* Have MinGW32 */
+/* #undef ZMQ_HAVE_MINGW32 */
+
+/* Have NetBSD OS */
+/* #undef ZMQ_HAVE_NETBSD */
+
+/* Have OpenBSD OS */
+/* #undef ZMQ_HAVE_OPENBSD */
+
+/* Have OpenPGM extension */
+/* #undef ZMQ_HAVE_OPENPGM */
+
+/* Have DarwinOSX OS */
+/* #undef ZMQ_HAVE_OSX */
+
+/* Have QNX Neutrino OS */
+/* #undef ZMQ_HAVE_QNXNTO */
+
+/* Whether SOCK_CLOEXEC is defined and functioning. */
+#define ZMQ_HAVE_SOCK_CLOEXEC 1
+
+/* Have Solaris OS */
+/* #undef ZMQ_HAVE_SOLARIS */
+
+/* Whether SO_KEEPALIVE is supported. */
+#define ZMQ_HAVE_SO_KEEPALIVE 1
+
+/* Whether TCP_KEEPALIVE is supported. */
+/* #undef ZMQ_HAVE_TCP_KEEPALIVE */
+
+/* Whether TCP_KEEPCNT is supported. */
+#define ZMQ_HAVE_TCP_KEEPCNT 1
+
+/* Whether TCP_KEEPIDLE is supported. */
+#define ZMQ_HAVE_TCP_KEEPIDLE 1
+
+/* Whether TCP_KEEPINTVL is supported. */
+#define ZMQ_HAVE_TCP_KEEPINTVL 1
+
+/* Have uio.h header. */
+#define ZMQ_HAVE_UIO 1
+
+/* Have Windows OS */
+/* #undef ZMQ_HAVE_WINDOWS */
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef ssize_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
diff --git a/buildutils/include_sodium/crypto_scalarmult_curve25519.h b/buildutils/include_sodium/crypto_scalarmult_curve25519.h
new file mode 100644
index 0000000..a4b4dd1
--- /dev/null
+++ b/buildutils/include_sodium/crypto_scalarmult_curve25519.h
@@ -0,0 +1,44 @@
+#ifndef crypto_scalarmult_curve25519_H
+#define crypto_scalarmult_curve25519_H
+
+#if 0
+# ifndef SODIUM_HAVE_TI_MODE
+# define SODIUM_HAVE_TI_MODE
+# endif
+#endif
+
+#include <stddef.h>
+
+#include "export.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define crypto_scalarmult_curve25519_BYTES 32
+SODIUM_EXPORT
+size_t crypto_scalarmult_curve25519_bytes(void);
+
+#define crypto_scalarmult_curve25519_SCALARBYTES 32
+SODIUM_EXPORT
+size_t crypto_scalarmult_curve25519_scalarbytes(void);
+
+SODIUM_EXPORT
+int crypto_scalarmult_curve25519(unsigned char *,const unsigned char *,const unsigned char *);
+
+SODIUM_EXPORT
+int crypto_scalarmult_curve25519_base(unsigned char *,const unsigned char *);
+
+#ifdef SODIUM_HAVE_TI_MODE
+# define crypto_scalarmult_curve25519_donna_c64 crypto_scalarmult_curve25519
+# define crypto_scalarmult_curve25519_donna_c64_base crypto_scalarmult_curve25519_base
+#else
+# define crypto_scalarmult_curve25519_ref crypto_scalarmult_curve25519
+# define crypto_scalarmult_curve25519_ref_base crypto_scalarmult_curve25519_base
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/buildutils/include_sodium/crypto_stream_salsa20.h b/buildutils/include_sodium/crypto_stream_salsa20.h
new file mode 100644
index 0000000..8ce595e
--- /dev/null
+++ b/buildutils/include_sodium/crypto_stream_salsa20.h
@@ -0,0 +1,54 @@
+#ifndef crypto_stream_salsa20_H
+#define crypto_stream_salsa20_H
+
+/*
+ * WARNING: This is just a stream cipher. It is NOT authenticated encryption.
+ * While it provides some protection against eavesdropping, it does NOT
+ * provide any security against active attacks.
+ * Unless you know what you're doing, what you are looking for is probably
+ * the crypto_box functions.
+ */
+
+#if 0
+# ifndef SODIUM_HAVE_AMD64_ASM
+# define SODIUM_HAVE_AMD64_ASM
+# endif
+#endif
+
+#include <stddef.h>
+#include "export.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define crypto_stream_salsa20_KEYBYTES 32U
+SODIUM_EXPORT
+size_t crypto_stream_salsa20_keybytes(void);
+
+#define crypto_stream_salsa20_NONCEBYTES 8U
+SODIUM_EXPORT
+size_t crypto_stream_salsa20_noncebytes(void);
+
+SODIUM_EXPORT
+const char * crypto_stream_salsa20_primitive(void);
+
+SODIUM_EXPORT
+int crypto_stream_salsa20(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
+
+SODIUM_EXPORT
+int crypto_stream_salsa20_xor(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
+
+#ifdef SODIUM_HAVE_AMD64_ASM
+# define crypto_stream_salsa20_amd64_xmm6 crypto_stream_salsa20
+# define crypto_stream_salsa20_amd64_xmm6_xor crypto_stream_salsa20_xor
+#else
+# define crypto_stream_salsa20_ref crypto_stream_salsa20
+# define crypto_stream_salsa20_ref_xor crypto_stream_salsa20_xor
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/buildutils/include_sodium/version.h b/buildutils/include_sodium/version.h
new file mode 100644
index 0000000..56b03e2
--- /dev/null
+++ b/buildutils/include_sodium/version.h
@@ -0,0 +1,29 @@
+
+#ifndef __SODIUM_VERSION_H__
+#define __SODIUM_VERSION_H__
+
+#include "export.h"
+
+#define SODIUM_VERSION_STRING "0.4.5"
+
+#define SODIUM_LIBRARY_VERSION_MAJOR 4
+#define SODIUM_LIBRARY_VERSION_MINOR 4
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SODIUM_EXPORT
+const char *sodium_version_string(void);
+
+SODIUM_EXPORT
+int sodium_library_version_major(void);
+
+SODIUM_EXPORT
+int sodium_library_version_minor(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/buildutils/initlibsodium.c b/buildutils/initlibsodium.c
new file mode 100644
index 0000000..f0de774
--- /dev/null
+++ b/buildutils/initlibsodium.c
@@ -0,0 +1,45 @@
+/*
+This file is from pyzmq-static by Brandon Craig-Rhodes,
+and used under the BSD license
+
+py3compat from http://wiki.python.org/moin/PortingExtensionModulesToPy3k
+
+Provide the init function that Python expects
+when we compile libzmq by pretending it is a Python extension.
+*/
+#include "Python.h"
+
+static PyMethodDef Methods[] = {
+ {NULL, NULL, 0, NULL}
+};
+
+#if PY_MAJOR_VERSION >= 3
+
+static struct PyModuleDef moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "libsodium",
+ NULL,
+ -1,
+ Methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit_libzmq(void)
+{
+ PyObject *module = PyModule_Create(&moduledef);
+ return module;
+}
+
+#else // py2
+
+PyMODINIT_FUNC
+initlibzmq(void)
+{
+ (void) Py_InitModule("libsodium", Methods);
+}
+
+#endif
diff --git a/buildutils/initlibzmq.c b/buildutils/initlibzmq.c
new file mode 100644
index 0000000..ec299f0
--- /dev/null
+++ b/buildutils/initlibzmq.c
@@ -0,0 +1,45 @@
+/*
+This file is from pyzmq-static by Brandon Craig-Rhodes,
+and used under the BSD license
+
+py3compat from http://wiki.python.org/moin/PortingExtensionModulesToPy3k
+
+Provide the init function that Python expects
+when we compile libzmq by pretending it is a Python extension.
+*/
+#include "Python.h"
+
+static PyMethodDef Methods[] = {
+ {NULL, NULL, 0, NULL}
+};
+
+#if PY_MAJOR_VERSION >= 3
+
+static struct PyModuleDef moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "libzmq",
+ NULL,
+ -1,
+ Methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit_libzmq(void)
+{
+ PyObject *module = PyModule_Create(&moduledef);
+ return module;
+}
+
+#else // py2
+
+PyMODINIT_FUNC
+initlibzmq(void)
+{
+ (void) Py_InitModule("libzmq", Methods);
+}
+
+#endif
diff --git a/buildutils/misc.py b/buildutils/misc.py
new file mode 100644
index 0000000..77f843b
--- /dev/null
+++ b/buildutils/misc.py
@@ -0,0 +1,15 @@
+"""misc build utility functions"""
+# Copyright (C) PyZMQ Developers
+# Distributed under the terms of the Modified BSD License.
+
+def customize_mingw(cc):
+ # strip -mno-cygwin from mingw32 (Python Issue #12641)
+ for cmd in [cc.compiler, cc.compiler_cxx, cc.compiler_so, cc.linker_exe, cc.linker_so]:
+ if '-mno-cygwin' in cmd:
+ cmd.remove('-mno-cygwin')
+
+ # remove problematic msvcr90
+ if 'msvcr90' in cc.dll_libraries:
+ cc.dll_libraries.remove('msvcr90')
+
+__all__ = ['customize_mingw']
diff --git a/buildutils/msg.py b/buildutils/msg.py
new file mode 100644
index 0000000..3b4a337
--- /dev/null
+++ b/buildutils/msg.py
@@ -0,0 +1,43 @@
+"""logging"""
+#-----------------------------------------------------------------------------
+# Copyright (C) PyZMQ Developers
+#
+# This file is part of pyzmq, copied and adapted from h5py.
+# h5py source used under the New BSD license
+#
+# h5py: <http://code.google.com/p/h5py/>
+#
+# Distributed under the terms of the New BSD License. The full license is in
+# the file COPYING.BSD, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+from __future__ import division
+
+import sys
+import logging
+
+#-----------------------------------------------------------------------------
+# Logging (adapted from h5py: http://h5py.googlecode.com)
+#-----------------------------------------------------------------------------
+
+
+logger = logging.getLogger()
+logger.setLevel(logging.INFO)
+logger.addHandler(logging.StreamHandler(sys.stderr))
+
+def debug(msg):
+ logger.debug(msg)
+
+def info(msg):
+ logger.info(msg)
+
+def fatal(msg, code=1):
+ logger.error("Fatal: " + msg)
+ exit(code)
+
+def warn(msg):
+ logger.error("Warning: " + msg)
+
+def line(c='*', width=48):
+ print(c * (width // len(c)))
+
diff --git a/buildutils/templates/constant_enums.pxi b/buildutils/templates/constant_enums.pxi
new file mode 100644
index 0000000..6039548
--- /dev/null
+++ b/buildutils/templates/constant_enums.pxi
@@ -0,0 +1,3 @@
+cdef extern from "zmq.h" nogil:
+
+ {ZMQ_ENUMS}
diff --git a/buildutils/templates/constants.pxi b/buildutils/templates/constants.pxi
new file mode 100644
index 0000000..042a6e8
--- /dev/null
+++ b/buildutils/templates/constants.pxi
@@ -0,0 +1,12 @@
+#-----------------------------------------------------------------------------
+# Python module level constants
+#-----------------------------------------------------------------------------
+
+{ASSIGNMENTS}
+
+#-----------------------------------------------------------------------------
+# Symbols to export
+#-----------------------------------------------------------------------------
+__all__ = [
+{ALL}
+]
diff --git a/buildutils/templates/zmq_constants.h b/buildutils/templates/zmq_constants.h
new file mode 100644
index 0000000..6855331
--- /dev/null
+++ b/buildutils/templates/zmq_constants.h
@@ -0,0 +1,6 @@
+#ifndef _PYZMQ_CONSTANT_DEFS
+#define _PYZMQ_CONSTANT_DEFS
+
+{ZMQ_IFNDEFS}
+
+#endif // ifndef _PYZMQ_CONSTANT_DEFS
diff --git a/buildutils/vers.c b/buildutils/vers.c
new file mode 100644
index 0000000..362564f
--- /dev/null
+++ b/buildutils/vers.c
@@ -0,0 +1,11 @@
+// check libzmq version
+
+#include <stdio.h>
+#include "zmq.h"
+
+int main(int argc, char **argv){
+ int major, minor, patch;
+ zmq_version(&major, &minor, &patch);
+ fprintf(stdout, "vers: %d.%d.%d\n", major, minor, patch);
+ return 0;
+}