From 38077ca0d1cd87414f800b6bfeadc00d36de8fc1 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 11 Oct 2023 13:00:03 +0200 Subject: [PATCH 01/16] bundle libzmq 4.3.5 libzmq no longer supports binaries for Windows, and has removed support for tweetnacl. This may mean that Windows wheels will lose CURVE. --- buildutils/bundle.py | 8 +++--- buildutils/include_darwin/platform.hpp | 38 ++++++++++++++++---------- pyproject.toml | 10 +++---- tools/install_libzmq.sh | 24 ++-------------- 4 files changed, 35 insertions(+), 45 deletions(-) diff --git a/buildutils/bundle.py b/buildutils/bundle.py index 6ee4d9694..346db604b 100644 --- a/buildutils/bundle.py +++ b/buildutils/bundle.py @@ -28,22 +28,22 @@ # Constants # ----------------------------------------------------------------------------- -bundled_version = (4, 3, 4) +bundled_version = (4, 3, 5) vs = '%i.%i.%i' % bundled_version x, y, z = bundled_version libzmq = "zeromq-%s.zip" % vs download_url = f"https://github.com/zeromq/libzmq/releases/download/v{vs}" libzmq_url = f"{download_url}/{libzmq}" -libzmq_checksum = ( - "sha256:622bf650f7dab6de098c84d491052ad5a6d3e57550cd09cc259e0ab24ec83ec3" -) +libzmq_checksum = "sha1:a8a8b800cbb3e13db0246473362d4d1f17813879" HERE = os.path.dirname(__file__) ROOT = os.path.dirname(HERE) +# libzmq has stopped building binaries with 4.3.5 +# so this is all dead code: # msvc 142 builds have a problem: # on _some_ (unclear which!) systems due to the implementation of runtime detection of AF_UNIX # in 4.3.4 diff --git a/buildutils/include_darwin/platform.hpp b/buildutils/include_darwin/platform.hpp index 7a6ec7d29..6fe3afea7 100644 --- a/buildutils/include_darwin/platform.hpp +++ b/buildutils/include_darwin/platform.hpp @@ -33,7 +33,7 @@ /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 -/* Define to 1 if you have the `fork' function. */ +/* fork is available */ #define HAVE_FORK 1 /* Define to 1 if you have the `freeifaddrs' function. */ @@ -93,9 +93,6 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 @@ -118,7 +115,7 @@ #define HAVE_SOCKET 1 /* Define to 1 if stdbool.h conforms to C99. */ -/* #undef HAVE_STDBOOL_H */ +#define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDDEF_H 1 @@ -126,6 +123,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 @@ -181,7 +181,7 @@ #define PACKAGE_NAME "zeromq" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "zeromq 4.3.4" +#define PACKAGE_STRING "zeromq 4.3.5" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "zeromq" @@ -190,19 +190,22 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.3.4" +#define PACKAGE_VERSION "4.3.5" /* 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 to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #define STDC_HEADERS 1 -/* Define to 1 if you can safely include both and . */ +/* Define to 1 if you can safely include both and . This + macro is obsolete. */ #define TIME_WITH_SYS_TIME 1 /* Version number of package */ -#define VERSION "4.3.4" +#define VERSION "4.3.5" /* Enable militant API assertions */ /* #undef ZMQ_ACT_MILITANT */ @@ -227,7 +230,7 @@ #define ZMQ_HAVE_ATOMIC_INTRINSICS 1 /* Using curve encryption */ -#define ZMQ_HAVE_CURVE 1 +/* #undef ZMQ_HAVE_CURVE */ /* Have Cygwin */ /* #undef ZMQ_HAVE_CYGWIN */ @@ -292,6 +295,9 @@ /* Whether O_CLOEXEC is defined and functioning. */ #define ZMQ_HAVE_O_CLOEXEC 1 +/* Build with zmq_ppoll */ +#define ZMQ_HAVE_PPOLL 1 + /* Whether pthread_setname_np() has 1 argument */ #define ZMQ_HAVE_PTHREAD_SETNAME_1 1 @@ -382,6 +388,13 @@ /* Use 'select' I/O thread polling system */ /* #undef ZMQ_IOTHREAD_POLLER_USE_SELECT */ +/* Automatically close libsodium randombytes. Not threadsafe without + getrandom() */ +/* #undef ZMQ_LIBSODIUM_RANDOMBYTES_CLOSE */ + +/* kevent udata type is intptr_t */ +/* #undef ZMQ_NETBSD_KEVENT_UDATA_INTPTR_T */ + /* Use 'poll' zmq_poll(er)_* API polling system */ #define ZMQ_POLL_BASED_ON_POLL 1 @@ -418,9 +431,6 @@ /* Use radix tree implementation to manage subscriptions */ /* #undef ZMQ_USE_RADIX_TREE */ -/* Using tweetnacl for curve encryption */ -#define ZMQ_USE_TWEETNACL 1 - /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ diff --git a/pyproject.toml b/pyproject.toml index 9e465d905..388ab5a19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,17 +129,17 @@ ZMQ_PREFIX = "/usr/local" MACOSX_DEPLOYMENT_TARGET = "10.9" [tool.cibuildwheel.windows] -before-all = [ - "python setup.py fetch_libzmq --dll", - "xcopy /i libzmq-dll C:\\libzmq-dll", -] +# before-all = [ +# "python setup.py fetch_libzmq --dll", +# "xcopy /i libzmq-dll C:\\libzmq-dll", +# ] repair-wheel-command = """ delvewheel repair \ -v \ - --add-path=C:/libzmq-dll \ --wheel-dir={dest_dir} \ {wheel} """ + # --add-path=C:/libzmq-dll \ [tool.cibuildwheel.windows.environment] ZMQ_PREFIX = "libzmq-dll" diff --git a/tools/install_libzmq.sh b/tools/install_libzmq.sh index cdf36a0c8..e4dd2c5e4 100644 --- a/tools/install_libzmq.sh +++ b/tools/install_libzmq.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # script to install libzmq/libsodium for use in wheels set -ex -LIBSODIUM_VERSION="1.0.18" +LIBSODIUM_VERSION="1.0.19" LIBZMQ_VERSION="$(python3 -m buildutils.bundle)" @@ -50,30 +50,10 @@ which ldconfig && ldconfig || true tar -xzf zeromq-${LIBZMQ_VERSION}.tar.gz cd zeromq-${LIBZMQ_VERSION} -# patch CURVE crash bug https://github.com/zeromq/libzmq/issues/4241 -# FIXME: switch to `--disable-libsodium_randombytes_close` -# when we bump bundle libzmq to 4.3.5 - -patch -p1 < Date: Wed, 11 Oct 2023 13:11:01 +0200 Subject: [PATCH 02/16] debug: skip non-windows --- .github/workflows/test.yml | 78 ++++++++++++++++++------------------ .github/workflows/wheels.yml | 74 +++++++++++++++++----------------- 2 files changed, 76 insertions(+), 76 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c67ccf14..7a0c66cd9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,45 +33,45 @@ jobs: fail-fast: true matrix: include: - - os: macos-13 - python: 3.7 - - - os: macos-13 - python: 3.11 - zmq: bundled - - - os: macos-13 - python: pypy-3.9 - zmq: bundled - - - os: ubuntu-20.04 - python: 3.7 - zmq: bundled - tornado: none - - - os: ubuntu-22.04 - python: pypy-3.9 - zmq: bundled - - - os: ubuntu-22.04 - python: pypy-3.7 - - - os: ubuntu-22.04 - python: 3.9 - tornado: head - - - os: ubuntu-22.04 - python: "3.10" - - - os: ubuntu-22.04 - python: "3.11" - - - os: ubuntu-22.04 - python: "3.8" - zmq: head - - - os: ubuntu-22.04 - python: "3.12" +# - os: macos-13 +# python: 3.7 +# +# - os: macos-13 +# python: 3.11 +# zmq: bundled +# +# - os: macos-13 +# python: pypy-3.9 +# zmq: bundled +# +# - os: ubuntu-20.04 +# python: 3.7 +# zmq: bundled +# tornado: none +# +# - os: ubuntu-22.04 +# python: pypy-3.9 +# zmq: bundled +# +# - os: ubuntu-22.04 +# python: pypy-3.7 +# +# - os: ubuntu-22.04 +# python: 3.9 +# tornado: head +# +# - os: ubuntu-22.04 +# python: "3.10" +# +# - os: ubuntu-22.04 +# python: "3.11" +# +# - os: ubuntu-22.04 +# python: "3.8" +# zmq: head +# +# - os: ubuntu-22.04 +# python: "3.12" - os: windows-2022 python: "3.7" diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 31fa51df8..c3cb33b3f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -95,43 +95,43 @@ jobs: fail-fast: false matrix: include: - - os: macos-11 - name: mac-cpython - cibw: - build: "cp*" - - - os: macos-11 - name: mac-pypy - cibw: - build: "pp*" - - - os: macos-11 - name: mac-arm - cibw: - arch: universal2 - build: "cp*" - - - name: manylinux-x86_64 - cibw: - arch: x86_64 - build: "*manylinux*" - - - name: manylinux-i686 - cibw: - arch: i686 - build: "*manylinux*" - - # additional manylinux variants, not specified in pyproject.toml: - # build with newer 2_28 for cpython >= 3.10, pypy 3.9 - - name: manylinux-x86_64-2_28 - cibw: - arch: x86_64 - build: "cp31*-manylinux* pp39-manylinux*" - manylinux_x86_64_image: manylinux_2_28 - - - name: musllinux - cibw: - build: "*musllinux*" +# - os: macos-11 +# name: mac-cpython +# cibw: +# build: "cp*" +# +# - os: macos-11 +# name: mac-pypy +# cibw: +# build: "pp*" +# +# - os: macos-11 +# name: mac-arm +# cibw: +# arch: universal2 +# build: "cp*" +# +# - name: manylinux-x86_64 +# cibw: +# arch: x86_64 +# build: "*manylinux*" +# +# - name: manylinux-i686 +# cibw: +# arch: i686 +# build: "*manylinux*" +# +# # additional manylinux variants, not specified in pyproject.toml: +# # build with newer 2_28 for cpython >= 3.10, pypy 3.9 +# - name: manylinux-x86_64-2_28 +# cibw: +# arch: x86_64 +# build: "cp31*-manylinux* pp39-manylinux*" +# manylinux_x86_64_image: manylinux_2_28 +# +# - name: musllinux +# cibw: +# build: "*musllinux*" - name: win32 os: windows-2019 From abd40eab8eafdc32d6759eceb4167d6ef3b948e0 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 13 Oct 2023 11:00:29 +0200 Subject: [PATCH 03/16] remove unused windows dlls --- buildutils/bundle.py | 60 -------------------------------------------- 1 file changed, 60 deletions(-) diff --git a/buildutils/bundle.py b/buildutils/bundle.py index 346db604b..3a53996e2 100644 --- a/buildutils/bundle.py +++ b/buildutils/bundle.py @@ -11,7 +11,6 @@ import hashlib import os -import platform import shutil import sys import zipfile @@ -41,36 +40,6 @@ HERE = os.path.dirname(__file__) ROOT = os.path.dirname(HERE) - -# libzmq has stopped building binaries with 4.3.5 -# so this is all dead code: -# msvc 142 builds have a problem: -# on _some_ (unclear which!) systems due to the implementation of runtime detection of AF_UNIX -# in 4.3.4 -vcversion = 141 -# until that's fixed, we shouldn't ship 142 builds, -# which in turn means we can't support IPC in wheels - -if platform.architecture()[0] == '64bit': - msarch = '-x64' - # vcversion = 142 -else: - msarch = '' - # vcversion = 141 - -libzmq_dll = f"libzmq-v{vcversion}{msarch}-{x}_{y}_{z}.zip" -libzmq_dll_url = f"{download_url}/{libzmq_dll}" - -libzmq_dll_checksums = { - "libzmq-v140-4_3_4.zip": "sha256:05b7c42fe8d5feb2795d32f71f7d900083530ee6fdd15575bfc8d1b3fb8643f7", - "libzmq-v140-x64-4_3_4.zip": "sha256:d5d75bd502d7935af3cf80734f81069be78420331c54814d0aab6d64adf450ae", - "libzmq-v141-4_3_4.zip": "sha256:acfc997f036018b8dc8ab5b3a1d1444bba6ba5621e91c756d07cd9447db19672", - "libzmq-v141-x64-4_3_4.zip": "sha256:4bb29d6fed20bd175a82317676c7e940356cd358b624efae8569c7ee11c45636", - "libzmq-v142-x64-4_3_4.zip": "sha256:61ae77d70bd55ffb85c3b30b6a4aeb40b0c69aaf492a9e691404d7f0192969e2", -} - -libzmq_dll_checksum = libzmq_dll_checksums.get(libzmq_dll) - # ----------------------------------------------------------------------------- # Utilities # ----------------------------------------------------------------------------- @@ -217,28 +186,6 @@ def stage_platform_hpp(zmqroot): shutil.copy(pjoin(platform_dir, 'platform.hpp'), platform_hpp) -def fetch_libzmq_dll(savedir): - """Download binary release of libzmq for windows - - vcversion specifies the MSVC runtime version to use - """ - - dest = pjoin(savedir, 'zmq.h') - if os.path.exists(dest): - info("already have %s" % dest) - return - path = fetch_archive( - savedir, libzmq_dll_url, fname=libzmq_dll, checksum=libzmq_dll_checksum - ) - archive = zipfile.ZipFile(path) - to_extract = [] - for name in archive.namelist(): - if not name.endswith(".exe"): - to_extract.append(name) - archive.extractall(savedir, members=to_extract) - archive.close() - - def check_checksums(): """Check all the checksums!""" _failed = False @@ -260,13 +207,6 @@ def less_fatal(msg): fname=libzmq, checksum=libzmq_checksum, ) - for dll, checksum in libzmq_dll_checksums.items(): - fetch_archive( - savedir, - f"{download_url}/{dll}", - fname=dll, - checksum=checksum, - ) if not _failed: print("All ok!") return _failed From 5ed8903f9bfec172417b2264ed697771b2e2080b Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 13 Oct 2023 11:02:25 +0200 Subject: [PATCH 04/16] update zeromq bundled files --- tools/test_sdist.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/test_sdist.py b/tools/test_sdist.py index 391ef077c..dbc048c57 100644 --- a/tools/test_sdist.py +++ b/tools/test_sdist.py @@ -46,8 +46,7 @@ def test_git_files(sdist_files, git_files): "path", [ # bundled zeromq - "bundled/zeromq/COPYING", - "bundled/zeromq/COPYING.LESSER", + "bundled/zeromq/LICENSE", "bundled/zeromq/include/zmq.h", "bundled/zeromq/src/zmq.cpp", "bundled/zeromq/external/wepoll/license.txt", From 5cf4ad7ab74585f2359c665cf6e30f4e9434aab8 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 13 Oct 2023 11:05:57 +0200 Subject: [PATCH 05/16] libsodium unpack name has changed --- tools/install_libzmq.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install_libzmq.sh b/tools/install_libzmq.sh index e4dd2c5e4..fdf7c716d 100644 --- a/tools/install_libzmq.sh +++ b/tools/install_libzmq.sh @@ -39,7 +39,7 @@ curl -L -O "https://download.libsodium.org/libsodium/releases/libsodium-${LIBSOD curl -L -O "https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz" tar -xzf libsodium-${LIBSODIUM_VERSION}.tar.gz -cd libsodium-${LIBSODIUM_VERSION} +cd libsodium-*/ ./configure --prefix="$PREFIX" make -j4 make install From 3349a5a062767dc7990738b06cbc73fc2f008832 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 9 Jun 2023 16:12:12 +0200 Subject: [PATCH 06/16] checkpoint --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 388ab5a19..4409b3f28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ requires = [ "cffi; implementation_name == 'pypy'", "cython>=3.0.0; implementation_name == 'cpython'", "packaging", - "setuptools>=61", - "setuptools_scm[toml]", + "meson-python", ] -build-backend = "setuptools.build_meta" +build-backend = "mesonpy" +# build-backend = "setuptools.build_meta" # Project metadata # ref: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html From e79ead4ef538023c797fc87cb17fd87f8d6ada07 Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 4 Jan 2024 11:19:32 +0100 Subject: [PATCH 07/16] checkpoint --- meson.build | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..3d83e4099 --- /dev/null +++ b/meson.build @@ -0,0 +1,31 @@ +project( + 'pyzmq', 'c', 'cython', + version: '26.0.0.dev0', + meson_version: '>= 1.0.0', + default_options: [ + ] +) + +libzmq = dependency('libzmq', static: false) + +py = import('python').find_installation(pure: false) + +cc = meson.get_compiler('c') +cython = meson.get_compiler('cython') + +libzmq = dependency('libzmq', static: false) +# cython = find_program('cython') +# cython_gen_cpp = generator(cython_cli, +# arguments : ['@INPUT@', '@OUTPUT@', '--cplus'], +# output : '@BASENAME@.cpp') + +libzmq_pyx = 'zmq/backend/cython/_zmq.py' + +py.extension_module( + 'zmq.backend.cython._zmq', + libzmq_pyx, + dependencies: libzmq, + # TODO: link_with for bundled libzmq + install: true, + compiler: cython, +) From 80b9989729dff7f52d8eda7ca977cf9ab5fd1eaf Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 4 Jan 2024 14:40:48 +0100 Subject: [PATCH 08/16] basic setup with meson Cython works with existing libzmq --- meson.build | 33 ++++++++++----------- pyproject.toml | 4 +-- subprojects/.gitignore | 2 ++ subprojects/libsodium.wrap | 6 ++++ subprojects/packagefiles/zeromq/meson.build | 26 ++++++++++++++++ subprojects/zeromq.wrap | 11 +++++++ zmq/backend/cython/meson.build | 18 +++++++++++ zmq/backend/meson.build | 1 + zmq/meson.build | 1 + 9 files changed, 82 insertions(+), 20 deletions(-) create mode 100644 subprojects/.gitignore create mode 100644 subprojects/libsodium.wrap create mode 100644 subprojects/packagefiles/zeromq/meson.build create mode 100644 subprojects/zeromq.wrap create mode 100644 zmq/backend/cython/meson.build create mode 100644 zmq/backend/meson.build create mode 100644 zmq/meson.build diff --git a/meson.build b/meson.build index 3d83e4099..e7be65b24 100644 --- a/meson.build +++ b/meson.build @@ -1,31 +1,28 @@ project( - 'pyzmq', 'c', 'cython', + 'pyzmq', 'c', version: '26.0.0.dev0', meson_version: '>= 1.0.0', default_options: [ ] ) +# subproject('zmq-static') + + +# libzmq = dependency('libzmq', static: false) -libzmq = dependency('libzmq', static: false) py = import('python').find_installation(pure: false) cc = meson.get_compiler('c') -cython = meson.get_compiler('cython') -libzmq = dependency('libzmq', static: false) -# cython = find_program('cython') -# cython_gen_cpp = generator(cython_cli, -# arguments : ['@INPUT@', '@OUTPUT@', '--cplus'], -# output : '@BASENAME@.cpp') +libzmq = dependency('libzmq', static: false, required: false) +if not libzmq.found() + libzmq = cc.find_library('zmq', has_headers: 'zmq.h', required: false) + if not libzmq.found() + # This will use the fallback + libzmq = dependency('zmq_static', required: true, static: true) + endif +endif +# libzmq = dependency('libzmqxyz', static: false, fallback: ['libzmq', 'libzmq_dep']) -libzmq_pyx = 'zmq/backend/cython/_zmq.py' - -py.extension_module( - 'zmq.backend.cython._zmq', - libzmq_pyx, - dependencies: libzmq, - # TODO: link_with for bundled libzmq - install: true, - compiler: cython, -) +subdir('zmq') diff --git a/pyproject.toml b/pyproject.toml index 4409b3f28..99af16d8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ authors = [ { name = "Brian E. Granger" }, { name = "Min Ragan-Kelley" }, ] -license = { text = "BSD-3-Clause" } +license = { file = "LICENSE.md" } requires-python = ">=3.7" classifiers = [ "Development Status :: 5 - Production/Stable", @@ -42,7 +42,7 @@ classifiers = [ ] dependencies = ["cffi; implementation_name == 'pypy'"] description = "Python bindings for 0MQ" -dynamic = ["readme"] +readme = "README.md" [project.urls] Homepage = "https://pyzmq.readthedocs.org" diff --git a/subprojects/.gitignore b/subprojects/.gitignore new file mode 100644 index 000000000..8d8d1c5ec --- /dev/null +++ b/subprojects/.gitignore @@ -0,0 +1,2 @@ +packagecache +zeromq-* diff --git a/subprojects/libsodium.wrap b/subprojects/libsodium.wrap new file mode 100644 index 000000000..b0fe1bea0 --- /dev/null +++ b/subprojects/libsodium.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = libsodium + +source_url = https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz +source_filename = libsodium.tar.gz +source_hash = fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2 diff --git a/subprojects/packagefiles/zeromq/meson.build b/subprojects/packagefiles/zeromq/meson.build new file mode 100644 index 000000000..55c4afda7 --- /dev/null +++ b/subprojects/packagefiles/zeromq/meson.build @@ -0,0 +1,26 @@ +project('zeromq', 'c', 'cpp', + version: '4.3.5', + meson_version: '>= 0.65.0', + license: ['MPL'], + default_options: [ + 'default_library=static', +] +) + +mod = import('unstable-external_project') + +p = mod.add_project('configure', + configure_options: [ + '--prefix=@PREFIX@', + '--libdir=@PREFIX@/@LIBDIR@', + '--includedir=@PREFIX@/@INCLUDEDIR@', + '--disable-drafts', + '--disable-shared', + '--enable-static', + ], + verbose: true, +) + +zmq_static = p.dependency('zmq') +meson.override_dependency('zmq_static', zmq_static) +# meson.override_dependency('zmq', zmq_static) diff --git a/subprojects/zeromq.wrap b/subprojects/zeromq.wrap new file mode 100644 index 000000000..f159ae993 --- /dev/null +++ b/subprojects/zeromq.wrap @@ -0,0 +1,11 @@ +[wrap-file] +directory = zeromq-4.3.5 + +source_url = https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz +source_filename = libzmq.tar.gz +source_hash = 6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43 +# patch_directory relative to packagefiles/ +patch_directory = zeromq + +[provide] +dependency_names = zmq_static diff --git a/zmq/backend/cython/meson.build b/zmq/backend/cython/meson.build new file mode 100644 index 000000000..cc5384eb9 --- /dev/null +++ b/zmq/backend/cython/meson.build @@ -0,0 +1,18 @@ +cython_cli = find_program('cython') +cython_gen = generator(cython_cli, + arguments : ['--3str', '@INPUT@', '--output-file', '@OUTPUT@'], + output : '@BASENAME@.c') + +_zmq_pyx = '_zmq.py' +# _zmq_c = cython_gen.process(_zmq_pyx) + +incdir = include_directories('../../utils') + +py.extension_module( + '_zmq', + cython_gen.process('_zmq.py'), + dependencies: libzmq, + include_directories: incdir, + # TODO: link_with for bundled libzmq + install: true, +) diff --git a/zmq/backend/meson.build b/zmq/backend/meson.build new file mode 100644 index 000000000..b19a00d26 --- /dev/null +++ b/zmq/backend/meson.build @@ -0,0 +1 @@ +subdir('cython') diff --git a/zmq/meson.build b/zmq/meson.build new file mode 100644 index 000000000..e384697fc --- /dev/null +++ b/zmq/meson.build @@ -0,0 +1 @@ +subdir('backend') From 0d315e20ba9980b93cb816a0437a9b50a15005df Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 4 Jan 2024 15:09:19 +0100 Subject: [PATCH 09/16] fix cffi default paths --- buildutils/build_cffi.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/buildutils/build_cffi.py b/buildutils/build_cffi.py index b432ce00e..936785c71 100644 --- a/buildutils/build_cffi.py +++ b/buildutils/build_cffi.py @@ -4,6 +4,7 @@ import cffi here = os.path.dirname(os.path.abspath(__file__)) +repo_root = os.path.dirname(here) zmq_dir = os.path.join(os.path.dirname(here), 'zmq') backend_dir = os.path.join(zmq_dir, 'backend', 'cffi') @@ -19,7 +20,7 @@ def load_compiler_config(): else: cfg = {} - cfg.setdefault("include_dirs", []) + cfg.setdefault("include_dirs", [os.path.join(zmq_dir, 'utils')]) cfg.setdefault("library_dirs", []) cfg.setdefault("runtime_library_dirs", []) cfg.setdefault("libraries", ["zmq"]) @@ -33,7 +34,7 @@ def load_compiler_config(): abs_paths = [] for p in cfg[key]: if p.startswith('zmq'): - p = os.path.join(zmq_dir, p) + p = os.path.join(repo_root, p) abs_paths.append(str(p)) cfg[key] = abs_paths return cfg @@ -57,4 +58,4 @@ def load_compiler_config(): ) if __name__ == "__main__": - ffi.compile() + ffi.compile(verbose=True) From 559cdca80e5f38742fd978e6e6bcc901afdeedf4 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 5 Jan 2024 12:52:30 +0100 Subject: [PATCH 10/16] bundle libsodium, too --- meson.build | 59 +++++++++++++++---- pyproject.toml | 5 ++ setup.py | 1 - subprojects/.gitignore | 1 + subprojects/libsodium.wrap | 8 ++- subprojects/packagefiles/libsodium/built.c | 5 ++ .../packagefiles/libsodium/meson.build | 27 +++++++++ subprojects/packagefiles/zeromq/meson.build | 10 +++- subprojects/zeromq.wrap | 2 + zmq/backend/cython/meson.build | 3 - 10 files changed, 101 insertions(+), 20 deletions(-) create mode 100644 subprojects/packagefiles/libsodium/built.c create mode 100644 subprojects/packagefiles/libsodium/meson.build diff --git a/meson.build b/meson.build index e7be65b24..5d61c2eed 100644 --- a/meson.build +++ b/meson.build @@ -1,28 +1,65 @@ project( 'pyzmq', 'c', version: '26.0.0.dev0', - meson_version: '>= 1.0.0', + meson_version: '>= 1.3.0', default_options: [ ] ) -# subproject('zmq-static') +fs = import('fs') +py = import('python').find_installation(pure: false) -# libzmq = dependency('libzmq', static: false) +python3 = py.full_path() +cfg = configuration_data() -py = import('python').find_installation(pure: false) +foreach key : ['zmq_prefix', 'zmq_draft_api'] + env_key = key.to_upper() + res = run_command(python3, '-c', 'import os; print(os.environ.get("@0@", ""))'.format(env_key), check: true) + str_value = res.stdout().strip() + if str_value == '0' + cfg.set(key, false) + elif str_value == '1' + cfg.set(key, true) + elif str_value != '' + cfg.set(key, str_value) + endif +endforeach +foreach key: cfg.keys() + message('@0@: @1@'.format(key, cfg.get(key))) +endforeach +# persist configuration (not sure why, but I used to do this in setup.py) +configure_file(output: 'configure.json', configuration: cfg, output_format: 'json') cc = meson.get_compiler('c') -libzmq = dependency('libzmq', static: false, required: false) -if not libzmq.found() - libzmq = cc.find_library('zmq', has_headers: 'zmq.h', required: false) - if not libzmq.found() - # This will use the fallback + +# locate libzmq +zmq_prefix = cfg.get('zmq_prefix', false) +if [false, 'default', 'auto'].contains(zmq_prefix) + # default search for libzmq (pkg-config, etc.) + libzmq = dependency('libzmq', static: false, required: false) + if not libzmq.found() + # look for libzmq, zmq.h directly + libzmq = cc.find_library('zmq', has_headers: 'zmq.h', required: false) + if not libzmq.found() + # fallback on bundled + if cfg.get('no_libzmq_extension', false) + error('bundled libzmq is disabled, but libzmq was not found') + endif + # subproject('libsodium') + # subproject('zeromq') + libzmq = dependency('zmq_static', required: true, static: true) + endif + endif +elif zmq_prefix == 'bundled' + # bundle requested, no search libzmq = dependency('zmq_static', required: true, static: true) - endif +else + # lookup by explicit prefix + libzmq = cc.find_library('zmq', dirs: [zmq_prefix / 'lib'], header_include_directories: include_directories(zmq_prefix / 'include'), has_headers: 'zmq.h', required: true) endif -# libzmq = dependency('libzmqxyz', static: false, fallback: ['libzmq', 'libzmq_dep']) + subdir('zmq') +install_subdir('zmq', install_dir: py.get_install_dir(), exclude_directories: ['__pycache__'], install_tag: 'runtime') diff --git a/pyproject.toml b/pyproject.toml index 99af16d8b..b57ee9a37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,9 +50,14 @@ Documentation = "https://pyzmq.readthedocs.org" Source = "https://github.com/zeromq/pyzmq" Tracker = "https://github.com/zeromq/pyzmq/issues" +[tool.meson-python.args] +# avoid installing static libzmq +install = ['--tags=runtime,python-runtime'] + [tool.setuptools] zip-safe = false license-files = ["LICENSE.md", "bundled/zeromq/COPYING", "bundled/zeromq/COPYING.LESSER"] +packages = ["zmq"] [tool.setuptools.dynamic] readme = { file = "README.md" } diff --git a/setup.py b/setup.py index d5c77a23e..a6a61a3d0 100755 --- a/setup.py +++ b/setup.py @@ -52,7 +52,6 @@ discover_settings, fatal, fetch_libzmq, - fetch_libzmq_dll, info, line, localpath, diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 8d8d1c5ec..01956a57d 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -1,2 +1,3 @@ packagecache zeromq-* +libsodium-stable diff --git a/subprojects/libsodium.wrap b/subprojects/libsodium.wrap index b0fe1bea0..a1b4082ba 100644 --- a/subprojects/libsodium.wrap +++ b/subprojects/libsodium.wrap @@ -1,6 +1,10 @@ [wrap-file] -directory = libsodium +directory = libsodium-stable source_url = https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz source_filename = libsodium.tar.gz -source_hash = fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2 +source_hash = 018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea +patch_directory = libsodium + +[provide] +dependency_names = sodium_static diff --git a/subprojects/packagefiles/libsodium/built.c b/subprojects/packagefiles/libsodium/built.c new file mode 100644 index 000000000..cb008cb6f --- /dev/null +++ b/subprojects/packagefiles/libsodium/built.c @@ -0,0 +1,5 @@ +#include "sodium.h" + +void _ignore_me() { + return; +} diff --git a/subprojects/packagefiles/libsodium/meson.build b/subprojects/packagefiles/libsodium/meson.build new file mode 100644 index 000000000..6ab3eea18 --- /dev/null +++ b/subprojects/packagefiles/libsodium/meson.build @@ -0,0 +1,27 @@ +project('libsodium', 'c', 'cpp', + version: '1.0.19', + meson_version: '>= 1.0.0', + license: ['ISC'], + default_options: [ + 'default_library=static', +] +) + +mod = import('unstable-external_project') + +p = mod.add_project('configure', + configure_options: [ + '--prefix=@PREFIX@', + '--libdir=@PREFIX@/@LIBDIR@', + '--includedir=@PREFIX@/@INCLUDEDIR@', + '--disable-shared', + '--enable-static', + ], + verbose: true, +) + +sodium_static = p.dependency('sodium') +# sodium_target = custom_target('sodium_target', depends: sodium_static) +meson.override_dependency('sodium_static', sodium_static) +# empty library target so we can depend on this from zeromq +sodium_built = static_library('sodium_built', 'built.c', dependencies: sodium_static.as_link_whole(), install: false) diff --git a/subprojects/packagefiles/zeromq/meson.build b/subprojects/packagefiles/zeromq/meson.build index 55c4afda7..a6f122008 100644 --- a/subprojects/packagefiles/zeromq/meson.build +++ b/subprojects/packagefiles/zeromq/meson.build @@ -1,26 +1,30 @@ project('zeromq', 'c', 'cpp', version: '4.3.5', - meson_version: '>= 0.65.0', + meson_version: '>= 1.3.0', license: ['MPL'], default_options: [ 'default_library=static', -] + ], ) mod = import('unstable-external_project') +# get sodium p = mod.add_project('configure', configure_options: [ '--prefix=@PREFIX@', '--libdir=@PREFIX@/@LIBDIR@', '--includedir=@PREFIX@/@INCLUDEDIR@', + '--with-libsodium', + '--disable-libsodium_randombytes_close', + '--disable-Werror', '--disable-drafts', '--disable-shared', '--enable-static', ], + depends: subproject('libsodium').get_variable('sodium_built'), verbose: true, ) zmq_static = p.dependency('zmq') meson.override_dependency('zmq_static', zmq_static) -# meson.override_dependency('zmq', zmq_static) diff --git a/subprojects/zeromq.wrap b/subprojects/zeromq.wrap index f159ae993..0a99f50b7 100644 --- a/subprojects/zeromq.wrap +++ b/subprojects/zeromq.wrap @@ -1,4 +1,6 @@ [wrap-file] +# must specify what is unpacked out of the tarball, +# not something we control directory = zeromq-4.3.5 source_url = https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz diff --git a/zmq/backend/cython/meson.build b/zmq/backend/cython/meson.build index cc5384eb9..d4ec1c204 100644 --- a/zmq/backend/cython/meson.build +++ b/zmq/backend/cython/meson.build @@ -3,9 +3,6 @@ cython_gen = generator(cython_cli, arguments : ['--3str', '@INPUT@', '--output-file', '@OUTPUT@'], output : '@BASENAME@.c') -_zmq_pyx = '_zmq.py' -# _zmq_c = cython_gen.process(_zmq_pyx) - incdir = include_directories('../../utils') py.extension_module( From ce694e1d16174cae2fed6e476adcf1133090a383 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 5 Jan 2024 13:04:34 +0100 Subject: [PATCH 11/16] avoid flakes on unused symbol in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a6a61a3d0..7c6f685d0 100755 --- a/setup.py +++ b/setup.py @@ -834,7 +834,7 @@ def fetch_libzmq_dll(self): shutil.rmtree(libdir) if not os.path.exists(libdir): os.makedirs(libdir) - fetch_libzmq_dll(libdir) + # fetch_libzmq_dll(libdir) for archive in glob(pjoin(libdir, '*.zip')): os.remove(archive) From e70a63e72d6cd1d203a76f0fa767a244c7155599 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 5 Jan 2024 13:05:15 +0100 Subject: [PATCH 12/16] fix subdir for cython extension --- zmq/backend/cython/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/zmq/backend/cython/meson.build b/zmq/backend/cython/meson.build index d4ec1c204..d9cf960a1 100644 --- a/zmq/backend/cython/meson.build +++ b/zmq/backend/cython/meson.build @@ -8,6 +8,7 @@ incdir = include_directories('../../utils') py.extension_module( '_zmq', cython_gen.process('_zmq.py'), + subdir: 'zmq/backend/cython', dependencies: libzmq, include_directories: incdir, # TODO: link_with for bundled libzmq From ddd79a69099929e7f476b5cf8fb39eb74d54fa51 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 5 Jan 2024 13:05:41 +0100 Subject: [PATCH 13/16] pyzmq needs to link libsodium directly --- meson.build | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 5d61c2eed..0abf33885 100644 --- a/meson.build +++ b/meson.build @@ -47,14 +47,18 @@ if [false, 'default', 'auto'].contains(zmq_prefix) if cfg.get('no_libzmq_extension', false) error('bundled libzmq is disabled, but libzmq was not found') endif - # subproject('libsodium') - # subproject('zeromq') - libzmq = dependency('zmq_static', required: true, static: true) + libzmq = [ + dependency('zmq_static', required: true, static: true), + dependency('sodium_static', required: true, static: true), + ] endif endif elif zmq_prefix == 'bundled' # bundle requested, no search - libzmq = dependency('zmq_static', required: true, static: true) + libzmq = [ + dependency('zmq_static', required: true, static: true), + dependency('sodium_static', required: true, static: true), + ] else # lookup by explicit prefix libzmq = cc.find_library('zmq', dirs: [zmq_prefix / 'lib'], header_include_directories: include_directories(zmq_prefix / 'include'), has_headers: 'zmq.h', required: true) From 96f7489c7fb564933f2e9d20d353f5250dab0825 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 5 Jan 2024 13:19:44 +0100 Subject: [PATCH 14/16] remove no longer used build code --- buildutils/__init__.py | 11 - buildutils/bundle.py | 220 ---- buildutils/check_sys_un.c | 12 - buildutils/config.py | 181 --- buildutils/constants.py | 4 +- buildutils/detect.py | 143 --- buildutils/dummy.c | 5 - buildutils/include_darwin/platform.hpp | 460 ------- buildutils/include_freebsd/platform.hpp | 450 ------- buildutils/include_linux-armv/platform.hpp | 441 ------- buildutils/include_linux-musl/platform.hpp | 450 ------- buildutils/include_linux/platform.hpp | 450 ------- buildutils/include_sunos/platform.hpp | 450 ------- buildutils/include_win32/platform.hpp | 26 - buildutils/include_win32/stdint.h | 11 - buildutils/initlibzmq.cpp | 45 - buildutils/misc.py | 85 -- buildutils/msg.py | 42 - buildutils/patch.py | 69 - buildutils/vers.c | 11 - setup.cfg.android | 16 - setup.cfg.template | 12 - setup.py | 1338 -------------------- 23 files changed, 1 insertion(+), 4931 deletions(-) delete mode 100644 buildutils/__init__.py delete mode 100644 buildutils/bundle.py delete mode 100644 buildutils/check_sys_un.c delete mode 100644 buildutils/config.py delete mode 100644 buildutils/detect.py delete mode 100644 buildutils/dummy.c delete mode 100644 buildutils/include_darwin/platform.hpp delete mode 100644 buildutils/include_freebsd/platform.hpp delete mode 100644 buildutils/include_linux-armv/platform.hpp delete mode 100644 buildutils/include_linux-musl/platform.hpp delete mode 100644 buildutils/include_linux/platform.hpp delete mode 100644 buildutils/include_sunos/platform.hpp delete mode 100644 buildutils/include_win32/platform.hpp delete mode 100644 buildutils/include_win32/stdint.h delete mode 100644 buildutils/initlibzmq.cpp delete mode 100644 buildutils/misc.py delete mode 100644 buildutils/msg.py delete mode 100644 buildutils/patch.py delete mode 100644 buildutils/vers.c delete mode 100644 setup.cfg.android delete mode 100644 setup.cfg.template delete mode 100755 setup.py diff --git a/buildutils/__init__.py b/buildutils/__init__.py deleted file mode 100644 index dadf66120..000000000 --- a/buildutils/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -"""utilities for building pyzmq. - -Largely adapted from h5py -""" - -from .bundle import * -from .config import * -from .detect import * -from .misc import * -from .msg import * -from .patch import * diff --git a/buildutils/bundle.py b/buildutils/bundle.py deleted file mode 100644 index 3a53996e2..000000000 --- a/buildutils/bundle.py +++ /dev/null @@ -1,220 +0,0 @@ -"""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 hashlib -import os -import shutil -import sys -import zipfile -from subprocess import PIPE, Popen -from tempfile import TemporaryDirectory -from unittest import mock -from urllib.request import urlopen - -from .msg import fatal, info, warn - -pjoin = os.path.join - -# ----------------------------------------------------------------------------- -# Constants -# ----------------------------------------------------------------------------- - -bundled_version = (4, 3, 5) -vs = '%i.%i.%i' % bundled_version -x, y, z = bundled_version -libzmq = "zeromq-%s.zip" % vs -download_url = f"https://github.com/zeromq/libzmq/releases/download/v{vs}" - -libzmq_url = f"{download_url}/{libzmq}" -libzmq_checksum = "sha1:a8a8b800cbb3e13db0246473362d4d1f17813879" - - -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 checksum_file(scheme, path): - """Return the checksum (hex digest) of a file""" - h = getattr(hashlib, scheme)() - - with open(path, 'rb') as f: - chunk = f.read(65535) - while chunk: - h.update(chunk) - chunk = f.read(65535) - return h.hexdigest() - - -def fetch_archive(savedir, url, fname, checksum, force=False): - """download an archive to a specific location""" - dest = pjoin(savedir, fname) - if checksum: - scheme, digest_ref = checksum.split(':') - else: - scheme = "sha256" - digest_ref = None - - if os.path.exists(dest) and not force: - info("already have %s" % dest) - digest = checksum_file(scheme, fname) - if digest == digest_ref or not digest_ref: - return dest - else: - warn(f"but checksum {digest} != {digest_ref}, redownloading.") - os.remove(fname) - - info(f"fetching {url} into {savedir}") - if not os.path.exists(savedir): - os.makedirs(savedir) - req = urlopen(url) - with open(dest, 'wb') as f: - f.write(req.read()) - digest = checksum_file(scheme, dest) - if digest_ref and digest != digest_ref: - fatal( - "%s %s mismatch:\nExpected: %s\nActual : %s" - % (dest, scheme, digest_ref, digest) - ) - elif not digest_ref: - warn(f"No digest to check, got: {scheme}:{digest}") - return dest - - -# ----------------------------------------------------------------------------- -# libzmq -# ----------------------------------------------------------------------------- - - -def fetch_and_extract(savedir, extract_to, url, fname, checksum): - """Download and extract an archive""" - dest = pjoin(savedir, extract_to) - if os.path.exists(dest): - info("already have %s" % dest) - return - archive = fetch_archive(savedir, url, fname=fname, checksum=checksum) - with zipfile.ZipFile(archive) as zf: - zf.extractall(savedir) - with_version = pjoin(savedir, zf.namelist()[0]) - # remove version suffix: - shutil.move(with_version, dest) - # remove archive when we are done - os.remove(archive) - - -def fetch_libzmq(savedir): - """download and extract libzmq""" - fetch_and_extract( - savedir, 'zeromq', url=libzmq_url, fname=libzmq, checksum=libzmq_checksum - ) - - -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': - platform_dir = pjoin(HERE, 'include_win32') - else: - info("attempting ./configure to generate platform.hpp") - failed = False - try: - p = Popen( - ["./configure", "--disable-drafts"], - cwd=zmqroot, - stdout=PIPE, - stderr=PIPE, - ) - except OSError as err: - failed = True - e = str(err) - else: - o, e = p.communicate() - e = e.decode("utf8", "replace") - failed = bool(p.returncode) - if failed: - 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') - elif sys.platform.startswith('sunos'): - platform_dir = pjoin(HERE, 'include_sunos') - else: - # check for musl (alpine) - from packaging import tags - - if any('musllinux' in tag.platform for tag in tags.sys_tags()): - info("Detected musllinux (likely alpine)") - platform_dir = pjoin(HERE, 'include_linux-musl') - 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 check_checksums(): - """Check all the checksums!""" - _failed = False - - def less_fatal(msg): - """Mock fatal log message to set failed flag instead of exiting - - So we can see multiple failures in one run, - e.g. when updating the bundled libzmq version. - """ - warn(msg) - nonlocal _failed - _failed = True - - with TemporaryDirectory() as savedir, mock.patch.dict(globals(), fatal=less_fatal): - fetch_archive( - savedir, - libzmq_url, - fname=libzmq, - checksum=libzmq_checksum, - ) - if not _failed: - print("All ok!") - return _failed - - -if __name__ == "__main__": - # allow python -m buildutils.bundle to get bundled version - if len(sys.argv) > 1 and sys.argv[1] == "checksums": - sys.exit(check_checksums()) - else: - print(vs) diff --git a/buildutils/check_sys_un.c b/buildutils/check_sys_un.c deleted file mode 100644 index 180621931..000000000 --- a/buildutils/check_sys_un.c +++ /dev/null @@ -1,12 +0,0 @@ -#include -#if defined _MSC_VER -#include -#else -#include -#endif - -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 deleted file mode 100644 index 6718bddff..000000000 --- a/buildutils/config.py +++ /dev/null @@ -1,181 +0,0 @@ -"""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: -# -# Distributed under the terms of the New BSD License. The full license is in -# the file LICENSE.BSD, distributed as part of this software. -# ----------------------------------------------------------------------------- - -import json -import os -import sys -from configparser import ConfigParser - -pjoin = os.path.join -from .msg import debug, warn - -# ----------------------------------------------------------------------------- -# Utility functions (adapted from h5py: https://www.h5py.org/) -# ----------------------------------------------------------------------------- - - -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(f"Couldn't load {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_env_args(): - """Look for options in environment vars""" - - settings = {} - - zmq = os.environ.get("ZMQ_PREFIX") - if zmq: - debug("Found environ var ZMQ_PREFIX=%s" % zmq) - settings['zmq_prefix'] = zmq - draft_api = os.environ.get("ZMQ_DRAFT_API") - if draft_api: - debug("Found environ var ZMQ_DRAFT_API=%s" % draft_api) - settings['zmq_draft_api'] = int(draft_api) - - 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', - 'bundle_msvcp', - ]: - 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'] = os.path.abspath(prefix) - settings['libzmq_extension'] = False - settings['no_libzmq_extension'] = True - settings['allow_legacy_libzmq'] = True # explicit zmq prefix allows legacy - 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': '', - 'zmq_draft_api': False, - 'libzmq_extension': False, - 'no_libzmq_extension': False, - 'skip_check_zmq': False, - 'allow_legacy_libzmq': False, - 'bundle_msvcp': None, - 'build_ext': {}, - 'bdist_egg': {}, - 'win_ver': None, - } - if sys.platform.startswith('win'): - settings['have_sys_un_h'] = False - # target Windows version, sets WINVER, _WIN32_WINNT macros - # see https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt for reference - # see https://github.com/python/cpython/blob/v3.9.1/PC/pyconfig.h#L137-L159 - # for CPython's own values - if sys.version_info >= (3, 9): - # CPython 3.9 targets Windows 8 (0x0602) - settings["win_ver"] = "0x0602" - else: - # older Python, target Windows 7 (0x0601) - # CPython itself targets Vista (0x0600) - settings["win_ver"] = "0x0601" - - if conf_base: - # lowest priority - merge(settings, load_config('config', conf_base)) - merge(settings, get_cfg_args()) - merge(settings, get_env_args()) - - return settings diff --git a/buildutils/constants.py b/buildutils/constants.py index fcfe5735f..78bcd9ceb 100644 --- a/buildutils/constants.py +++ b/buildutils/constants.py @@ -19,8 +19,6 @@ import sys from subprocess import run -from . import info - pjoin = os.path.join buildutils = os.path.abspath(os.path.dirname(__file__)) @@ -110,7 +108,7 @@ def generate_file(fname, ns_func, dest_dir="."): tpl = f.read() out = tpl.format(**ns_func()) dest = pjoin(dest_dir, fname) - info("generating %s from template" % dest) + print("generating %s from template" % dest) with open(dest, 'w') as f: f.write(out) if fname.endswith(".py"): diff --git a/buildutils/detect.py b/buildutils/detect.py deleted file mode 100644 index 52a3417e4..000000000 --- a/buildutils/detect.py +++ /dev/null @@ -1,143 +0,0 @@ -"""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: -# -# Distributed under the terms of the New BSD License. The full license is in -# the file LICENSE.BSD, distributed as part of this software. -# ----------------------------------------------------------------------------- - -import logging -import os -import platform -import shutil -import sys - -from .misc import get_compiler, get_output_error -from .msg import info -from .patch import patch_lib_paths - -pjoin = os.path.join - -# ----------------------------------------------------------------------------- -# Utility functions (adapted from h5py: https://www.h5py.org/) -# ----------------------------------------------------------------------------- - - -def test_compilation(cfile, compiler, **compiler_attrs): - """Test simple compilation with given settings""" - - efile, ext = os.path.splitext(cfile) - - cpreargs = lpreargs = [] - 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) - extra_link = compiler_attrs.get('extra_link_args', []) - lpreargs.extend(extra_link) - - objs = compiler.compile([cfile], extra_preargs=cpreargs, extra_postargs=extra) - compiler.link_executable(objs, efile, extra_preargs=lpreargs) - return efile - - -def compile_and_forget(basedir, src, compiler, **compiler_attrs): - """Make sure src compiles and links successfully. - - The resulting binary is deleted without being run. - """ - if not os.path.exists(basedir): - os.makedirs(basedir) - cfile = pjoin(basedir, os.path.basename(src)) - shutil.copy(src, cfile) - try: - test_compilation(cfile, compiler=compiler, **compiler_attrs) - finally: - shutil.rmtree(basedir) - - -def detect_zmq(basedir, compiler, **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'): - info("Checking for timer_create") - info( - "** Errors about missing timer_create are a normal part of this process **" - ) - if not compiler.has_function('timer_create'): - compiler_attrs['libraries'].append('rt') - info( - "** The above error about timer_create is normal and not a problem! **" - ) - info("no timer_create, linking librt") - - cc = get_compiler(compiler=compiler, **compiler_attrs) - efile = test_compilation(cfile, compiler=cc, **compiler_attrs) - patch_lib_paths(efile, cc.library_dirs) - - # add library dirs to %PATH% for windows - env = os.environ.copy() - if sys.platform.startswith("win"): - env["PATH"] = os.pathsep.join([env["PATH"]] + cc.library_dirs) - - rc, so, se = get_output_error([efile], env=env) - if rc: - msg = f"Error running version detection script:\n{so}\n{se}" - logging.error(msg) - raise OSError(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 deleted file mode 100644 index 4dbdc60f0..000000000 --- a/buildutils/dummy.c +++ /dev/null @@ -1,5 +0,0 @@ -// 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 deleted file mode 100644 index 6fe3afea7..000000000 --- a/buildutils/include_darwin/platform.hpp +++ /dev/null @@ -1,460 +0,0 @@ -/* 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 `accept4' function. */ -/* #undef HAVE_ACCEPT4 */ - -/* Define to 1 if you have the header file. */ -#define HAVE_ALLOCA_H 1 - -/* Define to 1 if you have the 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 header file. */ -#define HAVE_CONDITION_VARIABLE 1 - -/* define if the compiler supports basic C++11 syntax */ -#define HAVE_CXX11 1 - -/* Define to 1 if you have the declaration of `LOCAL_PEERCRED', and to 0 if - you don't. */ -#define HAVE_DECL_LOCAL_PEERCRED 0 - -/* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you - don't. */ -#define HAVE_DECL_SO_PEERCRED 0 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* fork is available */ -#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 header file. */ -/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_IFADDRS_H 1 - -/* if_nametoindex is available */ -#define HAVE_IF_NAMETOINDEX 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Enabled GSSAPI security */ -/* #undef HAVE_LIBGSSAPI_KRB5 */ - -/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ -/* #undef HAVE_LIBIPHLPAPI */ - -/* Define to 1 if you have the `network' library (-lnetwork). */ -/* #undef HAVE_LIBNETWORK */ - -/* 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 */ - -/* The libunwind library is to be used */ -/* #undef HAVE_LIBUNWIND */ - -/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ -/* #undef HAVE_LIBWS2_32 */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 - -/* Define to 1 if you have the `mkdtemp' function. */ -#define HAVE_MKDTEMP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the 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 `posix_memalign' works. */ -#define HAVE_POSIX_MEMALIGN 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 header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* strnlen is available */ -#define HAVE_STRNLEN 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_EVENTFD_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_UIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_WINDOWS_H */ - -/* Define to 1 if the system has the type `_Bool'. */ -/* #undef HAVE__BOOL */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* 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.3.5" - -/* 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.3.5" - -/* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE void - -/* Define to 1 if all of the C90 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . This - macro is obsolete. */ -#define TIME_WITH_SYS_TIME 1 - -/* Version number of package */ -#define VERSION "4.3.5" - -/* Enable militant API assertions */ -/* #undef ZMQ_ACT_MILITANT */ - -/* Provide draft classes and methods */ -/* #undef ZMQ_BUILD_DRAFT_API */ - -/* Using "$zmq_cacheline_size" bytes alignment for lock-free data structures - */ -#define ZMQ_CACHELINE_SIZE 64 - -/* Force to use mutexes */ -/* #undef ZMQ_FORCE_MUTEXES */ - -/* Have AIX OS */ -/* #undef ZMQ_HAVE_AIX */ - -/* Have Android OS */ -/* #undef ZMQ_HAVE_ANDROID */ - -/* Whether compiler has __atomic_Xxx intrinsics. */ -#define ZMQ_HAVE_ATOMIC_INTRINSICS 1 - -/* Using curve encryption */ -/* #undef ZMQ_HAVE_CURVE */ - -/* Have Cygwin */ -/* #undef ZMQ_HAVE_CYGWIN */ - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_DRAGONFLY */ - -/* Have eventfd extension */ -/* #undef ZMQ_HAVE_EVENTFD */ - -/* Whether EFD_CLOEXEC is defined and functioning. */ -/* #undef ZMQ_HAVE_EVENTFD_CLOEXEC */ - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_FREEBSD */ - -/* Whether getrandom is supported. */ -/* #undef ZMQ_HAVE_GETRANDOM */ - -/* Have GNU/Hurd OS */ -/* #undef ZMQ_HAVE_GNU */ - -/* Have Haiku OS */ -/* #undef ZMQ_HAVE_HAIKU */ - -/* Have HPUX OS */ -/* #undef ZMQ_HAVE_HPUX */ - -/* Have ifaddrs.h header. */ -#define ZMQ_HAVE_IFADDRS 1 - -/* Have AF_UNIX sockets for ipc transport */ -#define ZMQ_HAVE_IPC 1 - -/* The libbsd library is to be used */ -/* #undef ZMQ_HAVE_LIBBSD */ - -/* Have Linux OS */ -/* #undef ZMQ_HAVE_LINUX */ - -/* Have LOCAL_PEERCRED socket option */ -/* #undef ZMQ_HAVE_LOCAL_PEERCRED */ - -/* Have MinGW */ -/* #undef ZMQ_HAVE_MINGW */ - -/* Have NetBSD OS */ -/* #undef ZMQ_HAVE_NETBSD */ - -/* Have NORM protocol extension */ -/* #undef ZMQ_HAVE_NORM */ - -/* Have OpenBSD OS */ -/* #undef ZMQ_HAVE_OPENBSD */ - -/* Have OpenPGM extension */ -/* #undef ZMQ_HAVE_OPENPGM */ - -/* Have DarwinOSX OS */ -#define ZMQ_HAVE_OSX 1 - -/* Whether O_CLOEXEC is defined and functioning. */ -#define ZMQ_HAVE_O_CLOEXEC 1 - -/* Build with zmq_ppoll */ -#define ZMQ_HAVE_PPOLL 1 - -/* Whether pthread_setname_np() has 1 argument */ -#define ZMQ_HAVE_PTHREAD_SETNAME_1 1 - -/* Whether pthread_setname_np() has 2 arguments */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_2 */ - -/* Whether pthread_setname_np() has 3 arguments */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_3 */ - -/* Whether pthread_setaffinity_np() exists */ -/* #undef ZMQ_HAVE_PTHREAD_SET_AFFINITY */ - -/* Whether pthread_set_name_np() exists */ -/* #undef ZMQ_HAVE_PTHREAD_SET_NAME */ - -/* 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_BINDTODEVICE is supported. */ -/* #undef ZMQ_HAVE_SO_BINDTODEVICE */ - -/* Whether SO_KEEPALIVE is supported. */ -#define ZMQ_HAVE_SO_KEEPALIVE 1 - -/* Have SO_PEERCRED socket option */ -/* #undef ZMQ_HAVE_SO_PEERCRED */ - -/* Whether SO_PRIORITY is supported. */ -/* #undef ZMQ_HAVE_SO_PRIORITY */ - -/* strlcpy is available */ -#define ZMQ_HAVE_STRLCPY 1 - -/* Whether TCP_KEEPALIVE is supported. */ -#define ZMQ_HAVE_TCP_KEEPALIVE 1 - -/* Whether TCP_KEEPCNT is supported. */ -#define ZMQ_HAVE_TCP_KEEPCNT 1 - -/* Whether TCP_KEEPIDLE is supported. */ -/* #undef ZMQ_HAVE_TCP_KEEPIDLE */ - -/* Whether TCP_KEEPINTVL is supported. */ -#define ZMQ_HAVE_TCP_KEEPINTVL 1 - -/* Have TIPC support */ -/* #undef ZMQ_HAVE_TIPC */ - -/* Have uio.h header. */ -#define ZMQ_HAVE_UIO 1 - -/* Have VMCI transport */ -/* #undef ZMQ_HAVE_VMCI */ - -/* Have Windows OS */ -/* #undef ZMQ_HAVE_WINDOWS */ - -/* Using websocket */ -/* #undef ZMQ_HAVE_WS */ - -/* WSS enabled */ -/* #undef ZMQ_HAVE_WSS */ - -/* Use 'devpoll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_DEVPOLL */ - -/* Use 'epoll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_EPOLL */ - -/* Use 'epoll' I/O thread polling system with CLOEXEC */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_EPOLL_CLOEXEC */ - -/* Use 'kqueue' I/O thread polling system */ -#define ZMQ_IOTHREAD_POLLER_USE_KQUEUE 1 - -/* Use 'poll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLL */ - -/* Use 'pollset' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLLSET */ - -/* Use 'select' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_SELECT */ - -/* Automatically close libsodium randombytes. Not threadsafe without - getrandom() */ -/* #undef ZMQ_LIBSODIUM_RANDOMBYTES_CLOSE */ - -/* kevent udata type is intptr_t */ -/* #undef ZMQ_NETBSD_KEVENT_UDATA_INTPTR_T */ - -/* Use 'poll' zmq_poll(er)_* API polling system */ -#define ZMQ_POLL_BASED_ON_POLL 1 - -/* Use 'select' zmq_poll(er)_* API polling system */ -/* #undef ZMQ_POLL_BASED_ON_SELECT */ - -/* Using built-in sha1 */ -/* #undef ZMQ_USE_BUILTIN_SHA1 */ - -/* Use no condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_NONE */ - -/* Use pthread condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_PTHREADS */ - -/* Use stl11 condition variable implementation. */ -#define ZMQ_USE_CV_IMPL_STL11 1 - -/* Use vxworks condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_VXWORKS */ - -/* fuzz tests will be built with fuzzing engine */ -/* #undef ZMQ_USE_FUZZING_ENGINE */ - -/* Use GNUTLS for TLS */ -/* #undef ZMQ_USE_GNUTLS */ - -/* Using libsodium for curve encryption */ -/* #undef ZMQ_USE_LIBSODIUM */ - -/* Using NSS */ -/* #undef ZMQ_USE_NSS */ - -/* Use radix tree implementation to manage subscriptions */ -/* #undef ZMQ_USE_RADIX_TREE */ - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or 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 does not define. */ -/* #undef size_t */ - -/* Define to `int' if 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 deleted file mode 100644 index 96a5f5ad7..000000000 --- a/buildutils/include_freebsd/platform.hpp +++ /dev/null @@ -1,450 +0,0 @@ -/* 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 `accept4' function. */ -#define HAVE_ACCEPT4 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ALLOCA_H */ - -/* Define to 1 if you have the 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 header file. */ -#define HAVE_CONDITION_VARIABLE 1 - -/* define if the compiler supports basic C++11 syntax */ -#define HAVE_CXX11 1 - -/* Define to 1 if you have the declaration of `LOCAL_PEERCRED', and to 0 if - you don't. */ -#define HAVE_DECL_LOCAL_PEERCRED 0 - -/* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you - don't. */ -#define HAVE_DECL_SO_PEERCRED 0 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the 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 header file. */ -/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_IFADDRS_H 1 - -/* if_nametoindex is available */ -#define HAVE_IF_NAMETOINDEX 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Enabled GSSAPI security */ -/* #undef HAVE_LIBGSSAPI_KRB5 */ - -/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ -/* #undef HAVE_LIBIPHLPAPI */ - -/* Define to 1 if you have the `network' library (-lnetwork). */ -/* #undef HAVE_LIBNETWORK */ - -/* 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 */ - -/* The libunwind library is to be used */ -#define HAVE_LIBUNWIND 1 - -/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ -/* #undef HAVE_LIBWS2_32 */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the 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 `mkdtemp' function. */ -#define HAVE_MKDTEMP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the 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 `posix_memalign' works. */ -#define HAVE_POSIX_MEMALIGN 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 header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* strnlen is available */ -#define HAVE_STRNLEN 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_EVENTFD_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_UIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_WINDOWS_H */ - -/* Define to 1 if the system has the type `_Bool'. */ -/* #undef HAVE__BOOL */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* 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.3.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.3.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 and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Version number of package */ -#define VERSION "4.3.4" - -/* Enable militant API assertions */ -/* #undef ZMQ_ACT_MILITANT */ - -/* Provide draft classes and methods */ -/* #undef ZMQ_BUILD_DRAFT_API */ - -/* Using "$zmq_cacheline_size" bytes alignment for lock-free data structures - */ -#define ZMQ_CACHELINE_SIZE 64 - -/* Force to use mutexes */ -/* #undef ZMQ_FORCE_MUTEXES */ - -/* Have AIX OS */ -/* #undef ZMQ_HAVE_AIX */ - -/* Have Android OS */ -/* #undef ZMQ_HAVE_ANDROID */ - -/* Whether compiler has __atomic_Xxx intrinsics. */ -#define ZMQ_HAVE_ATOMIC_INTRINSICS 1 - -/* Using curve encryption */ -#define ZMQ_HAVE_CURVE 1 - -/* Have Cygwin */ -/* #undef ZMQ_HAVE_CYGWIN */ - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_DRAGONFLY */ - -/* Have eventfd extension */ -/* #undef ZMQ_HAVE_EVENTFD */ - -/* Whether EFD_CLOEXEC is defined and functioning. */ -/* #undef ZMQ_HAVE_EVENTFD_CLOEXEC */ - -/* Have DragonFly OS */ -#define ZMQ_HAVE_FREEBSD 1 - -/* Whether getrandom is supported. */ -#define ZMQ_HAVE_GETRANDOM 1 - -/* Have GNU/Hurd OS */ -/* #undef ZMQ_HAVE_GNU */ - -/* Have Haiku OS */ -/* #undef ZMQ_HAVE_HAIKU */ - -/* Have HPUX OS */ -/* #undef ZMQ_HAVE_HPUX */ - -/* Have ifaddrs.h header. */ -#define ZMQ_HAVE_IFADDRS 1 - -/* Have AF_UNIX sockets for ipc transport */ -#define ZMQ_HAVE_IPC 1 - -/* The libbsd library is to be used */ -/* #undef ZMQ_HAVE_LIBBSD */ - -/* Have Linux OS */ -/* #undef ZMQ_HAVE_LINUX */ - -/* Have LOCAL_PEERCRED socket option */ -/* #undef ZMQ_HAVE_LOCAL_PEERCRED */ - -/* Have MinGW */ -/* #undef ZMQ_HAVE_MINGW */ - -/* Have NetBSD OS */ -/* #undef ZMQ_HAVE_NETBSD */ - -/* Have NORM protocol extension */ -/* #undef ZMQ_HAVE_NORM */ - -/* Have OpenBSD OS */ -/* #undef ZMQ_HAVE_OPENBSD */ - -/* Have OpenPGM extension */ -/* #undef ZMQ_HAVE_OPENPGM */ - -/* Have DarwinOSX OS */ -/* #undef ZMQ_HAVE_OSX */ - -/* Whether O_CLOEXEC is defined and functioning. */ -#define ZMQ_HAVE_O_CLOEXEC 1 - -/* Whether pthread_setname_np() has 1 argument */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_1 */ - -/* Whether pthread_setname_np() has 2 arguments */ -#define ZMQ_HAVE_PTHREAD_SETNAME_2 1 - -/* Whether pthread_setname_np() has 3 arguments */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_3 */ - -/* Whether pthread_setaffinity_np() exists */ -/* #undef ZMQ_HAVE_PTHREAD_SET_AFFINITY */ - -/* Whether pthread_set_name_np() exists */ -/* #undef ZMQ_HAVE_PTHREAD_SET_NAME */ - -/* 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_BINDTODEVICE is supported. */ -/* #undef ZMQ_HAVE_SO_BINDTODEVICE */ - -/* Whether SO_KEEPALIVE is supported. */ -#define ZMQ_HAVE_SO_KEEPALIVE 1 - -/* Have SO_PEERCRED socket option */ -/* #undef ZMQ_HAVE_SO_PEERCRED */ - -/* Whether SO_PRIORITY is supported. */ -/* #undef ZMQ_HAVE_SO_PRIORITY */ - -/* strlcpy is available */ -#define ZMQ_HAVE_STRLCPY 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 TIPC support */ -/* #undef ZMQ_HAVE_TIPC */ - -/* Have uio.h header. */ -#define ZMQ_HAVE_UIO 1 - -/* Have VMCI transport */ -/* #undef ZMQ_HAVE_VMCI */ - -/* Have Windows OS */ -/* #undef ZMQ_HAVE_WINDOWS */ - -/* Using websocket */ -/* #undef ZMQ_HAVE_WS */ - -/* WSS enabled */ -/* #undef ZMQ_HAVE_WSS */ - -/* Use 'devpoll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_DEVPOLL */ - -/* Use 'epoll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_EPOLL */ - -/* Use 'epoll' I/O thread polling system with CLOEXEC */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_EPOLL_CLOEXEC */ - -/* Use 'kqueue' I/O thread polling system */ -#define ZMQ_IOTHREAD_POLLER_USE_KQUEUE 1 - -/* Use 'poll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLL */ - -/* Use 'pollset' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLLSET */ - -/* Use 'select' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_SELECT */ - -/* Use 'poll' zmq_poll(er)_* API polling system */ -#define ZMQ_POLL_BASED_ON_POLL 1 - -/* Use 'select' zmq_poll(er)_* API polling system */ -/* #undef ZMQ_POLL_BASED_ON_SELECT */ - -/* Using built-in sha1 */ -/* #undef ZMQ_USE_BUILTIN_SHA1 */ - -/* Use no condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_NONE */ - -/* Use pthread condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_PTHREADS */ - -/* Use stl11 condition variable implementation. */ -#define ZMQ_USE_CV_IMPL_STL11 1 - -/* Use vxworks condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_VXWORKS */ - -/* fuzz tests will be built with fuzzing engine */ -/* #undef ZMQ_USE_FUZZING_ENGINE */ - -/* Use GNUTLS for TLS */ -/* #undef ZMQ_USE_GNUTLS */ - -/* Using libsodium for curve encryption */ -/* #undef ZMQ_USE_LIBSODIUM */ - -/* Using NSS */ -/* #undef ZMQ_USE_NSS */ - -/* Use radix tree implementation to manage subscriptions */ -/* #undef ZMQ_USE_RADIX_TREE */ - -/* Using tweetnacl for curve encryption */ -/* #define ZMQ_USE_TWEETNACL 1 */ - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or 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 does not define. */ -/* #undef size_t */ - -/* Define to `int' if 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 deleted file mode 100644 index e661c42ed..000000000 --- a/buildutils/include_linux-armv/platform.hpp +++ /dev/null @@ -1,441 +0,0 @@ -/* 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 `accept4' function. */ -/* #undef HAVE_ACCEPT4 */ - -/* Define to 1 if you have the header file. */ -#define HAVE_ALLOCA_H 1 - -/* Define to 1 if you have the 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 header file. */ -#define HAVE_CONDITION_VARIABLE 1 - -/* define if the compiler supports basic C++11 syntax */ -#define HAVE_CXX11 1 - -/* Define to 1 if you have the declaration of `LOCAL_PEERCRED', and to 0 if - you don't. */ -#define HAVE_DECL_LOCAL_PEERCRED 0 - -/* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you - don't. */ -#define HAVE_DECL_SO_PEERCRED 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the 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. */ -/* #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 header file. */ -/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_IFADDRS_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Enabled GSSAPI security */ -/* #undef HAVE_LIBGSSAPI_KRB5 */ - -/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ -/* #undef HAVE_LIBIPHLPAPI */ - -/* Define to 1 if you have the `network' library (-lnetwork). */ -/* #undef HAVE_LIBNETWORK */ - -/* 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 */ - -/* The libunwind library is to be used */ -/* #undef HAVE_LIBUNWIND */ - -/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ -/* #undef HAVE_LIBWS2_32 */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the 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 `mkdtemp' function. */ -#define HAVE_MKDTEMP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the 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 `posix_memalign' works. */ -#define HAVE_POSIX_MEMALIGN 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 header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* strnlen is available */ -#define HAVE_STRNLEN 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_EVENTFD_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_UIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_WINDOWS_H */ - -/* Define to 1 if the system has the type `_Bool'. */ -/* #undef HAVE__BOOL */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* 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.3.3" - -/* 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.3.3" - -/* 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 and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Version number of package */ -#define VERSION "4.3.3" - -/* Enable militant API assertions */ -/* #undef ZMQ_ACT_MILITANT */ - -/* Provide draft classes and methods */ -/* #undef ZMQ_BUILD_DRAFT_API */ - -/* Using "$zmq_cacheline_size" bytes alignment for lock-free data structures - */ -#define ZMQ_CACHELINE_SIZE 64 - -/* Force to use mutexes */ -/* #undef ZMQ_FORCE_MUTEXES */ - -/* Have AIX OS */ -/* #undef ZMQ_HAVE_AIX */ - -/* Have Android OS */ -#define ZMQ_HAVE_ANDROID 1 - -/* Whether compiler has __atomic_Xxx intrinsics. */ -#define ZMQ_HAVE_ATOMIC_INTRINSICS 1 - -/* Using curve encryption */ -#define ZMQ_HAVE_CURVE 1 - -/* Have Cygwin */ -/* #undef ZMQ_HAVE_CYGWIN */ - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_DRAGONFLY */ - -/* Have eventfd extension */ -/* #undef ZMQ_HAVE_EVENTFD */ - -/* Whether EFD_CLOEXEC is defined and functioning. */ -/* #undef ZMQ_HAVE_EVENTFD_CLOEXEC */ - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_FREEBSD */ - -/* Whether getrandom is supported. */ -/* #undef ZMQ_HAVE_GETRANDOM */ - -/* Have GNU/Hurd OS */ -/* #undef ZMQ_HAVE_GNU */ - -/* Have Haiku OS */ -/* #undef ZMQ_HAVE_HAIKU */ - -/* Have HPUX OS */ -/* #undef ZMQ_HAVE_HPUX */ - -/* Have ifaddrs.h header. */ -#define ZMQ_HAVE_IFADDRS 1 - -/* Have AF_UNIX sockets for ipc transport */ -#define ZMQ_HAVE_IPC 1 - -/* The libbsd library is to be used */ -/* #undef ZMQ_HAVE_LIBBSD */ - -/* Have Linux OS */ -#define ZMQ_HAVE_LINUX 1 - -/* Have LOCAL_PEERCRED socket option */ -/* #undef ZMQ_HAVE_LOCAL_PEERCRED */ - -/* Have MinGW */ -/* #undef ZMQ_HAVE_MINGW */ - -/* Have NetBSD OS */ -/* #undef ZMQ_HAVE_NETBSD */ - -/* Have NORM protocol extension */ -/* #undef ZMQ_HAVE_NORM */ - -/* Have OpenBSD OS */ -/* #undef ZMQ_HAVE_OPENBSD */ - -/* Have OpenPGM extension */ -/* #undef ZMQ_HAVE_OPENPGM */ - -/* Have DarwinOSX OS */ -/* #undef ZMQ_HAVE_OSX */ - -/* Whether O_CLOEXEC is defined and functioning. */ -/* #undef ZMQ_HAVE_O_CLOEXEC */ - -/* Whether pthread_setname_np() has 1 argument */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_1 */ - -/* Whether pthread_setname_np() has 2 arguments */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_2 */ - -/* Whether pthread_setname_np() has 3 arguments */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_3 */ - -/* Whether pthread_setaffinity_np() exists */ -#define ZMQ_HAVE_PTHREAD_SET_AFFINITY 1 - -/* Whether pthread_set_name_np() exists */ -/* #undef ZMQ_HAVE_PTHREAD_SET_NAME */ - -/* 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_BINDTODEVICE is supported. */ -#define ZMQ_HAVE_SO_BINDTODEVICE 1 - -/* Whether SO_KEEPALIVE is supported. */ -#define ZMQ_HAVE_SO_KEEPALIVE 1 - -/* Have SO_PEERCRED socket option */ -#define ZMQ_HAVE_SO_PEERCRED 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. */ -/* #undef ZMQ_HAVE_TCP_KEEPIDLE */ - -/* Whether TCP_KEEPINTVL is supported. */ -/* #undef ZMQ_HAVE_TCP_KEEPINTVL */ - -/* Have TIPC support */ -#define ZMQ_HAVE_TIPC 1 - -/* Have uio.h header. */ -#define ZMQ_HAVE_UIO 1 - -/* Have VMCI transport */ -/* #undef ZMQ_HAVE_VMCI */ - -/* Have Windows OS */ -/* #undef ZMQ_HAVE_WINDOWS */ - -/* Using websocket */ -/* #undef ZMQ_HAVE_WS */ - -/* WSS enabled */ -/* #undef ZMQ_HAVE_WSS */ - -/* Use 'devpoll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_DEVPOLL */ - -/* Use 'epoll' I/O thread polling system */ -#define ZMQ_IOTHREAD_POLLER_USE_EPOLL 1 - -/* Use 'epoll' I/O thread polling system with CLOEXEC */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_EPOLL_CLOEXEC */ - -/* Use 'kqueue' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_KQUEUE */ - -/* Use 'poll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLL */ - -/* Use 'pollset' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLLSET */ - -/* Use 'select' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_SELECT */ - -/* Use 'poll' zmq_poll(er)_* API polling system */ -#define ZMQ_POLL_BASED_ON_POLL 1 - -/* Use 'select' zmq_poll(er)_* API polling system */ -/* #undef ZMQ_POLL_BASED_ON_SELECT */ - -/* Using built-in sha1 */ -/* #undef ZMQ_USE_BUILTIN_SHA1 */ - -/* Use no condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_NONE */ - -/* Use pthread condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_PTHREADS */ - -/* Use stl11 condition variable implementation. */ -#define ZMQ_USE_CV_IMPL_STL11 1 - -/* Use vxworks condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_VXWORKS */ - -/* fuzz tests will be built with fuzzing engine */ -/* #undef ZMQ_USE_FUZZING_ENGINE */ - -/* Use GNUTLS for TLS */ -/* #undef ZMQ_USE_GNUTLS */ - -/* Using libsodium for curve encryption */ -/* #undef ZMQ_USE_LIBSODIUM */ - -/* Using NSS */ -/* #undef ZMQ_USE_NSS */ - -/* Use radix tree implementation to manage subscriptions */ -/* #undef ZMQ_USE_RADIX_TREE */ - -/* Using tweetnacl for curve encryption */ -/* #define ZMQ_USE_TWEETNACL 1 */ - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or 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 does not define. */ -/* #undef size_t */ - -/* Define to `int' if 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-musl/platform.hpp b/buildutils/include_linux-musl/platform.hpp deleted file mode 100644 index 639be8505..000000000 --- a/buildutils/include_linux-musl/platform.hpp +++ /dev/null @@ -1,450 +0,0 @@ -/* 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 `accept4' function. */ -#define HAVE_ACCEPT4 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ALLOCA_H 1 - -/* Define to 1 if you have the 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 header file. */ -#define HAVE_CONDITION_VARIABLE 1 - -/* define if the compiler supports basic C++11 syntax */ -#define HAVE_CXX11 1 - -/* Define to 1 if you have the declaration of `LOCAL_PEERCRED', and to 0 if - you don't. */ -#define HAVE_DECL_LOCAL_PEERCRED 0 - -/* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you - don't. */ -#define HAVE_DECL_SO_PEERCRED 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the `fork' function. */ -/* #undef HAVE_FORK */ - -/* 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 header file. */ -/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_IFADDRS_H 1 - -/* if_nametoindex is available */ -#define HAVE_IF_NAMETOINDEX 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Enabled GSSAPI security */ -/* #undef HAVE_LIBGSSAPI_KRB5 */ - -/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ -/* #undef HAVE_LIBIPHLPAPI */ - -/* Define to 1 if you have the `network' library (-lnetwork). */ -/* #undef HAVE_LIBNETWORK */ - -/* 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 */ - -/* The libunwind library is to be used */ -/* #undef HAVE_LIBUNWIND */ - -/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ -/* #undef HAVE_LIBWS2_32 */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `memset' function. */ -/* #undef HAVE_MEMSET */ - -/* Define to 1 if you have the `mkdtemp' function. */ -#define HAVE_MKDTEMP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the 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 `posix_memalign' works. */ -#define HAVE_POSIX_MEMALIGN 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 header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* strnlen is available */ -#define HAVE_STRNLEN 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_EVENTFD_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_UIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_WINDOWS_H */ - -/* Define to 1 if the system has the type `_Bool'. */ -/* #undef HAVE__BOOL */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* 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.3.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.3.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 and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Version number of package */ -#define VERSION "4.3.4" - -/* Enable militant API assertions */ -/* #undef ZMQ_ACT_MILITANT */ - -/* Provide draft classes and methods */ -/* #undef ZMQ_BUILD_DRAFT_API */ - -/* Using "$zmq_cacheline_size" bytes alignment for lock-free data structures - */ -#define ZMQ_CACHELINE_SIZE 64 - -/* Force to use mutexes */ -/* #undef ZMQ_FORCE_MUTEXES */ - -/* Have AIX OS */ -/* #undef ZMQ_HAVE_AIX */ - -/* Have Android OS */ -/* #undef ZMQ_HAVE_ANDROID */ - -/* Whether compiler has __atomic_Xxx intrinsics. */ -#define ZMQ_HAVE_ATOMIC_INTRINSICS 1 - -/* Using curve encryption */ -#define ZMQ_HAVE_CURVE 1 - -/* Have Cygwin */ -/* #undef ZMQ_HAVE_CYGWIN */ - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_DRAGONFLY */ - -/* Have eventfd extension */ -#define ZMQ_HAVE_EVENTFD 1 - -/* Whether EFD_CLOEXEC is defined and functioning. */ -#define ZMQ_HAVE_EVENTFD_CLOEXEC 1 - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_FREEBSD */ - -/* Whether getrandom is supported. */ -#define ZMQ_HAVE_GETRANDOM 1 - -/* Have GNU/Hurd OS */ -/* #undef ZMQ_HAVE_GNU */ - -/* Have Haiku OS */ -/* #undef ZMQ_HAVE_HAIKU */ - -/* Have HPUX OS */ -/* #undef ZMQ_HAVE_HPUX */ - -/* Have ifaddrs.h header. */ -#define ZMQ_HAVE_IFADDRS 1 - -/* Have AF_UNIX sockets for ipc transport */ -#define ZMQ_HAVE_IPC 1 - -/* The libbsd library is to be used */ -/* #undef ZMQ_HAVE_LIBBSD */ - -/* Have Linux OS */ -#define ZMQ_HAVE_LINUX 1 - -/* Have LOCAL_PEERCRED socket option */ -/* #undef ZMQ_HAVE_LOCAL_PEERCRED */ - -/* Have MinGW */ -/* #undef ZMQ_HAVE_MINGW */ - -/* Have NetBSD OS */ -/* #undef ZMQ_HAVE_NETBSD */ - -/* Have NORM protocol extension */ -/* #undef ZMQ_HAVE_NORM */ - -/* Have OpenBSD OS */ -/* #undef ZMQ_HAVE_OPENBSD */ - -/* Have OpenPGM extension */ -/* #undef ZMQ_HAVE_OPENPGM */ - -/* Have DarwinOSX OS */ -/* #undef ZMQ_HAVE_OSX */ - -/* Whether O_CLOEXEC is defined and functioning. */ -#define ZMQ_HAVE_O_CLOEXEC 1 - -/* Whether pthread_setname_np() has 1 argument */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_1 */ - -/* Whether pthread_setname_np() has 2 arguments */ -#define ZMQ_HAVE_PTHREAD_SETNAME_2 1 - -/* Whether pthread_setname_np() has 3 arguments */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_3 */ - -/* Whether pthread_setaffinity_np() exists */ -#define ZMQ_HAVE_PTHREAD_SET_AFFINITY 1 - -/* Whether pthread_set_name_np() exists */ -/* #undef ZMQ_HAVE_PTHREAD_SET_NAME */ - -/* 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_BINDTODEVICE is supported. */ -#define ZMQ_HAVE_SO_BINDTODEVICE 1 - -/* Whether SO_KEEPALIVE is supported. */ -#define ZMQ_HAVE_SO_KEEPALIVE 1 - -/* Have SO_PEERCRED socket option */ -#define ZMQ_HAVE_SO_PEERCRED 1 - -/* Whether SO_PRIORITY is supported. */ -#define ZMQ_HAVE_SO_PRIORITY 1 - -/* strlcpy is available */ -#define ZMQ_HAVE_STRLCPY 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 TIPC support */ -/* #undef ZMQ_HAVE_TIPC */ - -/* Have uio.h header. */ -#define ZMQ_HAVE_UIO 1 - -/* Have VMCI transport */ -/* #undef ZMQ_HAVE_VMCI */ - -/* Have Windows OS */ -/* #undef ZMQ_HAVE_WINDOWS */ - -/* Using websocket */ -/* #undef ZMQ_HAVE_WS */ - -/* WSS enabled */ -/* #undef ZMQ_HAVE_WSS */ - -/* Use 'devpoll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_DEVPOLL */ - -/* Use 'epoll' I/O thread polling system */ -#define ZMQ_IOTHREAD_POLLER_USE_EPOLL 1 - -/* Use 'epoll' I/O thread polling system with CLOEXEC */ -#define ZMQ_IOTHREAD_POLLER_USE_EPOLL_CLOEXEC 1 - -/* Use 'kqueue' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_KQUEUE */ - -/* Use 'poll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLL */ - -/* Use 'pollset' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLLSET */ - -/* Use 'select' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_SELECT */ - -/* Use 'poll' zmq_poll(er)_* API polling system */ -#define ZMQ_POLL_BASED_ON_POLL 1 - -/* Use 'select' zmq_poll(er)_* API polling system */ -/* #undef ZMQ_POLL_BASED_ON_SELECT */ - -/* Using built-in sha1 */ -/* #undef ZMQ_USE_BUILTIN_SHA1 */ - -/* Use no condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_NONE */ - -/* Use pthread condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_PTHREADS */ - -/* Use stl11 condition variable implementation. */ -#define ZMQ_USE_CV_IMPL_STL11 1 - -/* Use vxworks condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_VXWORKS */ - -/* fuzz tests will be built with fuzzing engine */ -/* #undef ZMQ_USE_FUZZING_ENGINE */ - -/* Use GNUTLS for TLS */ -/* #undef ZMQ_USE_GNUTLS */ - -/* Using libsodium for curve encryption */ -/* #undef ZMQ_USE_LIBSODIUM */ - -/* Using NSS */ -/* #undef ZMQ_USE_NSS */ - -/* Use radix tree implementation to manage subscriptions */ -/* #undef ZMQ_USE_RADIX_TREE */ - -/* Using tweetnacl for curve encryption */ -#define ZMQ_USE_TWEETNACL 1 - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or 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 does not define. */ -/* #undef size_t */ - -/* Define to `int' if 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 deleted file mode 100644 index f5b2d6a36..000000000 --- a/buildutils/include_linux/platform.hpp +++ /dev/null @@ -1,450 +0,0 @@ -/* 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 `accept4' function. */ -/* #undef HAVE_ACCEPT4 */ - -/* Define to 1 if you have the header file. */ -#define HAVE_ALLOCA_H 1 - -/* Define to 1 if you have the 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 header file. */ -#define HAVE_CONDITION_VARIABLE 1 - -/* define if the compiler supports basic C++11 syntax */ -#define HAVE_CXX11 1 - -/* Define to 1 if you have the declaration of `LOCAL_PEERCRED', and to 0 if - you don't. */ -#define HAVE_DECL_LOCAL_PEERCRED 0 - -/* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you - don't. */ -#define HAVE_DECL_SO_PEERCRED 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the 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 header file. */ -/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_IFADDRS_H 1 - -/* if_nametoindex is available */ -#define HAVE_IF_NAMETOINDEX 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Enabled GSSAPI security */ -/* #undef HAVE_LIBGSSAPI_KRB5 */ - -/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ -/* #undef HAVE_LIBIPHLPAPI */ - -/* Define to 1 if you have the `network' library (-lnetwork). */ -/* #undef HAVE_LIBNETWORK */ - -/* 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 */ - -/* The libunwind library is to be used */ -/* #undef HAVE_LIBUNWIND */ - -/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ -/* #undef HAVE_LIBWS2_32 */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the 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 `mkdtemp' function. */ -#define HAVE_MKDTEMP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the 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 `posix_memalign' works. */ -#define HAVE_POSIX_MEMALIGN 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 header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* strnlen is available */ -#define HAVE_STRNLEN 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_EVENTFD_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_UIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_WINDOWS_H */ - -/* Define to 1 if the system has the type `_Bool'. */ -/* #undef HAVE__BOOL */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* 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.3.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.3.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 and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Version number of package */ -#define VERSION "4.3.4" - -/* Enable militant API assertions */ -/* #undef ZMQ_ACT_MILITANT */ - -/* Provide draft classes and methods */ -/* #undef ZMQ_BUILD_DRAFT_API */ - -/* Using "$zmq_cacheline_size" bytes alignment for lock-free data structures - */ -#define ZMQ_CACHELINE_SIZE 64 - -/* Force to use mutexes */ -/* #undef ZMQ_FORCE_MUTEXES */ - -/* Have AIX OS */ -/* #undef ZMQ_HAVE_AIX */ - -/* Have Android OS */ -/* #undef ZMQ_HAVE_ANDROID */ - -/* Whether compiler has __atomic_Xxx intrinsics. */ -#define ZMQ_HAVE_ATOMIC_INTRINSICS 1 - -/* Using curve encryption */ -#define ZMQ_HAVE_CURVE 1 - -/* Have Cygwin */ -/* #undef ZMQ_HAVE_CYGWIN */ - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_DRAGONFLY */ - -/* Have eventfd extension */ -/* #undef ZMQ_HAVE_EVENTFD */ - -/* Whether EFD_CLOEXEC is defined and functioning. */ -/* #undef ZMQ_HAVE_EVENTFD_CLOEXEC */ - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_FREEBSD */ - -/* Whether getrandom is supported. */ -/* #undef ZMQ_HAVE_GETRANDOM */ - -/* Have GNU/Hurd OS */ -/* #undef ZMQ_HAVE_GNU */ - -/* Have Haiku OS */ -/* #undef ZMQ_HAVE_HAIKU */ - -/* Have HPUX OS */ -/* #undef ZMQ_HAVE_HPUX */ - -/* Have ifaddrs.h header. */ -#define ZMQ_HAVE_IFADDRS 1 - -/* Have AF_UNIX sockets for ipc transport */ -#define ZMQ_HAVE_IPC 1 - -/* The libbsd library is to be used */ -/* #undef ZMQ_HAVE_LIBBSD */ - -/* Have Linux OS */ -#define ZMQ_HAVE_LINUX 1 - -/* Have LOCAL_PEERCRED socket option */ -/* #undef ZMQ_HAVE_LOCAL_PEERCRED */ - -/* Have MinGW */ -/* #undef ZMQ_HAVE_MINGW */ - -/* Have NetBSD OS */ -/* #undef ZMQ_HAVE_NETBSD */ - -/* Have NORM protocol extension */ -/* #undef ZMQ_HAVE_NORM */ - -/* Have OpenBSD OS */ -/* #undef ZMQ_HAVE_OPENBSD */ - -/* Have OpenPGM extension */ -/* #undef ZMQ_HAVE_OPENPGM */ - -/* Have DarwinOSX OS */ -/* #undef ZMQ_HAVE_OSX */ - -/* Whether O_CLOEXEC is defined and functioning. */ -/* #undef ZMQ_HAVE_O_CLOEXEC */ - -/* Whether pthread_setname_np() has 1 argument */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_1 */ - -/* Whether pthread_setname_np() has 2 arguments */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_2 */ - -/* Whether pthread_setname_np() has 3 arguments */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_3 */ - -/* Whether pthread_setaffinity_np() exists */ -#define ZMQ_HAVE_PTHREAD_SET_AFFINITY 1 - -/* Whether pthread_set_name_np() exists */ -/* #undef ZMQ_HAVE_PTHREAD_SET_NAME */ - -/* 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_BINDTODEVICE is supported. */ -#define ZMQ_HAVE_SO_BINDTODEVICE 1 - -/* Whether SO_KEEPALIVE is supported. */ -#define ZMQ_HAVE_SO_KEEPALIVE 1 - -/* Have SO_PEERCRED socket option */ -#define ZMQ_HAVE_SO_PEERCRED 1 - -/* Whether SO_PRIORITY is supported. */ -#define ZMQ_HAVE_SO_PRIORITY 1 - -/* strlcpy is available */ -/* #undef ZMQ_HAVE_STRLCPY */ - -/* 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 TIPC support */ -#define ZMQ_HAVE_TIPC 1 - -/* Have uio.h header. */ -#define ZMQ_HAVE_UIO 1 - -/* Have VMCI transport */ -/* #undef ZMQ_HAVE_VMCI */ - -/* Have Windows OS */ -/* #undef ZMQ_HAVE_WINDOWS */ - -/* Using websocket */ -/* #undef ZMQ_HAVE_WS */ - -/* WSS enabled */ -/* #undef ZMQ_HAVE_WSS */ - -/* Use 'devpoll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_DEVPOLL */ - -/* Use 'epoll' I/O thread polling system */ -#define ZMQ_IOTHREAD_POLLER_USE_EPOLL 1 - -/* Use 'epoll' I/O thread polling system with CLOEXEC */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_EPOLL_CLOEXEC */ - -/* Use 'kqueue' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_KQUEUE */ - -/* Use 'poll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLL */ - -/* Use 'pollset' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLLSET */ - -/* Use 'select' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_SELECT */ - -/* Use 'poll' zmq_poll(er)_* API polling system */ -#define ZMQ_POLL_BASED_ON_POLL 1 - -/* Use 'select' zmq_poll(er)_* API polling system */ -/* #undef ZMQ_POLL_BASED_ON_SELECT */ - -/* Using built-in sha1 */ -/* #undef ZMQ_USE_BUILTIN_SHA1 */ - -/* Use no condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_NONE */ - -/* Use pthread condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_PTHREADS */ - -/* Use stl11 condition variable implementation. */ -#define ZMQ_USE_CV_IMPL_STL11 1 - -/* Use vxworks condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_VXWORKS */ - -/* fuzz tests will be built with fuzzing engine */ -/* #undef ZMQ_USE_FUZZING_ENGINE */ - -/* Use GNUTLS for TLS */ -/* #undef ZMQ_USE_GNUTLS */ - -/* Using libsodium for curve encryption */ -/* #undef ZMQ_USE_LIBSODIUM */ - -/* Using NSS */ -/* #undef ZMQ_USE_NSS */ - -/* Use radix tree implementation to manage subscriptions */ -/* #undef ZMQ_USE_RADIX_TREE */ - -/* Using tweetnacl for curve encryption */ -/* #define ZMQ_USE_TWEETNACL 1 */ - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or 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 does not define. */ -/* #undef size_t */ - -/* Define to `int' if 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_sunos/platform.hpp b/buildutils/include_sunos/platform.hpp deleted file mode 100644 index 57ac68cac..000000000 --- a/buildutils/include_sunos/platform.hpp +++ /dev/null @@ -1,450 +0,0 @@ -/* 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 `accept4' function. */ -#define HAVE_ACCEPT4 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ALLOCA_H 1 - -/* Define to 1 if you have the 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 header file. */ -#define HAVE_CONDITION_VARIABLE 1 - -/* define if the compiler supports basic C++11 syntax */ -#define HAVE_CXX11 1 - -/* Define to 1 if you have the declaration of `LOCAL_PEERCRED', and to 0 if - you don't. */ -#define HAVE_DECL_LOCAL_PEERCRED 0 - -/* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you - don't. */ -#define HAVE_DECL_SO_PEERCRED 0 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the `fork' function. */ -/* #undef HAVE_FORK */ - -/* 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 header file. */ -/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_IFADDRS_H 1 - -/* if_nametoindex is available */ -#define HAVE_IF_NAMETOINDEX 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Enabled GSSAPI security */ -/* #undef HAVE_LIBGSSAPI_KRB5 */ - -/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ -/* #undef HAVE_LIBIPHLPAPI */ - -/* Define to 1 if you have the `network' library (-lnetwork). */ -/* #undef HAVE_LIBNETWORK */ - -/* Define to 1 if you have the `nsl' library (-lnsl). */ -#define HAVE_LIBNSL 1 - -/* 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). */ -#define HAVE_LIBSOCKET 1 - -/* The libunwind library is to be used */ -/* #undef HAVE_LIBUNWIND */ - -/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ -/* #undef HAVE_LIBWS2_32 */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `memset' function. */ -/* #undef HAVE_MEMSET */ - -/* Define to 1 if you have the `mkdtemp' function. */ -#define HAVE_MKDTEMP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the 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 `posix_memalign' works. */ -#define HAVE_POSIX_MEMALIGN 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 header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* strnlen is available */ -#define HAVE_STRNLEN 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_EVENTFD_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_UIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_WINDOWS_H */ - -/* Define to 1 if the system has the type `_Bool'. */ -/* #undef HAVE__BOOL */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* 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.3.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.3.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 and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Version number of package */ -#define VERSION "4.3.4" - -/* Enable militant API assertions */ -/* #undef ZMQ_ACT_MILITANT */ - -/* Provide draft classes and methods */ -/* #undef ZMQ_BUILD_DRAFT_API */ - -/* Using "$zmq_cacheline_size" bytes alignment for lock-free data structures - */ -#define ZMQ_CACHELINE_SIZE 64 - -/* Force to use mutexes */ -/* #undef ZMQ_FORCE_MUTEXES */ - -/* Have AIX OS */ -/* #undef ZMQ_HAVE_AIX */ - -/* Have Android OS */ -/* #undef ZMQ_HAVE_ANDROID */ - -/* Whether compiler has __atomic_Xxx intrinsics. */ -#define ZMQ_HAVE_ATOMIC_INTRINSICS 1 - -/* Using curve encryption */ -#define ZMQ_HAVE_CURVE 1 - -/* Have Cygwin */ -/* #undef ZMQ_HAVE_CYGWIN */ - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_DRAGONFLY */ - -/* Have eventfd extension */ -/* #undef ZMQ_HAVE_EVENTFD */ - -/* Whether EFD_CLOEXEC is defined and functioning. */ -/* #undef ZMQ_HAVE_EVENTFD_CLOEXEC */ - -/* Have DragonFly OS */ -/* #undef ZMQ_HAVE_FREEBSD */ - -/* Whether getrandom is supported. */ -#define ZMQ_HAVE_GETRANDOM 1 - -/* Have GNU/Hurd OS */ -/* #undef ZMQ_HAVE_GNU */ - -/* Have Haiku OS */ -/* #undef ZMQ_HAVE_HAIKU */ - -/* Have HPUX OS */ -/* #undef ZMQ_HAVE_HPUX */ - -/* Have ifaddrs.h header. */ -#define ZMQ_HAVE_IFADDRS 1 - -/* Have AF_UNIX sockets for ipc transport */ -#define ZMQ_HAVE_IPC 1 - -/* The libbsd library is to be used */ -/* #undef ZMQ_HAVE_LIBBSD */ - -/* Have Linux OS */ -/* #undef ZMQ_HAVE_LINUX */ - -/* Have LOCAL_PEERCRED socket option */ -/* #undef ZMQ_HAVE_LOCAL_PEERCRED */ - -/* Have MinGW */ -/* #undef ZMQ_HAVE_MINGW */ - -/* Have NetBSD OS */ -/* #undef ZMQ_HAVE_NETBSD */ - -/* Have NORM protocol extension */ -/* #undef ZMQ_HAVE_NORM */ - -/* Have OpenBSD OS */ -/* #undef ZMQ_HAVE_OPENBSD */ - -/* Have OpenPGM extension */ -/* #undef ZMQ_HAVE_OPENPGM */ - -/* Have DarwinOSX OS */ -/* #undef ZMQ_HAVE_OSX */ - -/* Whether O_CLOEXEC is defined and functioning. */ -#define ZMQ_HAVE_O_CLOEXEC 1 - -/* Whether pthread_setname_np() has 1 argument */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_1 */ - -/* Whether pthread_setname_np() has 2 arguments */ -#define ZMQ_HAVE_PTHREAD_SETNAME_2 1 - -/* Whether pthread_setname_np() has 3 arguments */ -/* #undef ZMQ_HAVE_PTHREAD_SETNAME_3 */ - -/* Whether pthread_setaffinity_np() exists */ -/* #undef ZMQ_HAVE_PTHREAD_SET_AFFINITY */ - -/* Whether pthread_set_name_np() exists */ -/* #undef ZMQ_HAVE_PTHREAD_SET_NAME */ - -/* Have QNX Neutrino OS */ -/* #undef ZMQ_HAVE_QNXNTO */ - -/* Whether SOCK_CLOEXEC is defined and functioning. */ -#define ZMQ_HAVE_SOCK_CLOEXEC 1 - -/* Have Solaris OS */ -#define ZMQ_HAVE_SOLARIS 1 - -/* Whether SO_BINDTODEVICE is supported. */ -/* #undef ZMQ_HAVE_SO_BINDTODEVICE */ - -/* Whether SO_KEEPALIVE is supported. */ -#define ZMQ_HAVE_SO_KEEPALIVE 1 - -/* Have SO_PEERCRED socket option */ -/* #undef ZMQ_HAVE_SO_PEERCRED */ - -/* Whether SO_PRIORITY is supported. */ -/* #undef ZMQ_HAVE_SO_PRIORITY */ - -/* strlcpy is available */ -#define ZMQ_HAVE_STRLCPY 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. */ -/* #undef ZMQ_HAVE_TCP_KEEPIDLE */ - -/* Whether TCP_KEEPINTVL is supported. */ -#define ZMQ_HAVE_TCP_KEEPINTVL 1 - -/* Have TIPC support */ -/* #undef ZMQ_HAVE_TIPC */ - -/* Have uio.h header. */ -#define ZMQ_HAVE_UIO 1 - -/* Have VMCI transport */ -/* #undef ZMQ_HAVE_VMCI */ - -/* Have Windows OS */ -/* #undef ZMQ_HAVE_WINDOWS */ - -/* Using websocket */ -/* #undef ZMQ_HAVE_WS */ - -/* WSS enabled */ -/* #undef ZMQ_HAVE_WSS */ - -/* Use 'devpoll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_DEVPOLL */ - -/* Use 'epoll' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_EPOLL */ - -/* Use 'epoll' I/O thread polling system with CLOEXEC */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_EPOLL_CLOEXEC */ - -/* Use 'kqueue' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_KQUEUE */ - -/* Use 'poll' I/O thread polling system */ -#define ZMQ_IOTHREAD_POLLER_USE_POLL 1 - -/* Use 'pollset' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_POLLSET */ - -/* Use 'select' I/O thread polling system */ -/* #undef ZMQ_IOTHREAD_POLLER_USE_SELECT */ - -/* Use 'poll' zmq_poll(er)_* API polling system */ -#define ZMQ_POLL_BASED_ON_POLL 1 - -/* Use 'select' zmq_poll(er)_* API polling system */ -/* #undef ZMQ_POLL_BASED_ON_SELECT */ - -/* Using built-in sha1 */ -/* #undef ZMQ_USE_BUILTIN_SHA1 */ - -/* Use no condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_NONE */ - -/* Use pthread condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_PTHREADS */ - -/* Use stl11 condition variable implementation. */ -#define ZMQ_USE_CV_IMPL_STL11 1 - -/* Use vxworks condition variable implementation. */ -/* #undef ZMQ_USE_CV_IMPL_VXWORKS */ - -/* fuzz tests will be built with fuzzing engine */ -/* #undef ZMQ_USE_FUZZING_ENGINE */ - -/* Use GNUTLS for TLS */ -/* #undef ZMQ_USE_GNUTLS */ - -/* Using libsodium for curve encryption */ -/* #undef ZMQ_USE_LIBSODIUM */ - -/* Using NSS */ -/* #undef ZMQ_USE_NSS */ - -/* Use radix tree implementation to manage subscriptions */ -/* #undef ZMQ_USE_RADIX_TREE */ - -/* Using tweetnacl for curve encryption */ -#define ZMQ_USE_TWEETNACL 1 - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or 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 does not define. */ -/* #undef size_t */ - -/* Define to `int' if 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_win32/platform.hpp b/buildutils/include_win32/platform.hpp deleted file mode 100644 index eca39b9b7..000000000 --- a/buildutils/include_win32/platform.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// copied from libzmq 4.2.3 -// has been removed since then -// included under LGPLv3 - -#ifndef __PLATFORM_HPP_INCLUDED__ -#define __PLATFORM_HPP_INCLUDED__ - -#define ZMQ_HAVE_WINDOWS - -// MSVC build configuration is controlled via options exposed in the Visual -// Studio user interface. The option to use libsodium is not exposed in the -// user interface unless a sibling `libsodium` directory to that of this -// repository exists and contains the following files: -// -// \builds\msvc\vs2015\libsodium.import.props -// \builds\msvc\vs2015\libsodium.import.xml - -// additional defines required for 4.3 after this file was removed -#define ZMQ_USE_SELECT 1 -#define ZMQ_POLL_BASED_ON_SELECT 1 -#define ZMQ_USE_CV_IMPL_WIN32API 1 -#define ZMQ_IOTHREAD_POLLER_USE_EPOLL 1 - -/* Have AF_UNIX sockets for ipc transport */ -#define ZMQ_HAVE_IPC 1 -#endif diff --git a/buildutils/include_win32/stdint.h b/buildutils/include_win32/stdint.h deleted file mode 100644 index 2cd301fbb..000000000 --- a/buildutils/include_win32/stdint.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _stdint_h__ -#define _stdint_h__ - -#include "../../bundled/zeromq/src/stdint.hpp" - -#define UINT8_MAX 0xff -#define UINT16_MAX 0xffff -#define UINT32_MAX 0xffffffff -#define UINT64_MAX 0xffffffffffffffffull - -#endif /* _stdint_h__ */ diff --git a/buildutils/initlibzmq.cpp b/buildutils/initlibzmq.cpp deleted file mode 100644 index ec299f0a9..000000000 --- a/buildutils/initlibzmq.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* -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 deleted file mode 100644 index 4f88f2a34..000000000 --- a/buildutils/misc.py +++ /dev/null @@ -1,85 +0,0 @@ -"""misc build utility functions""" - -# Copyright (c) PyZMQ Developers -# Distributed under the terms of the Modified BSD License. - -import copy -import logging -import os -import sys -from pprint import pprint -from shlex import quote -from subprocess import PIPE, Popen - -from .msg import warn - -pjoin = os.path.join - - -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') - - -def get_compiler(compiler, **compiler_attrs): - """get and customize a compiler""" - cc = copy.deepcopy(compiler) - - for name, val in compiler_attrs.items(): - setattr(cc, name, val) - - return cc - - -def get_output_error(cmd, **kwargs): - """Return the exit status, stdout, stderr of a command""" - if not isinstance(cmd, list): - cmd = [cmd] - logging.debug("Running: %s", ' '.join(map(quote, cmd))) - try: - result = Popen(cmd, stdout=PIPE, stderr=PIPE, **kwargs) - except OSError as e: - return -1, '', f'Failed to run {cmd!r}: {e!r}' - so, se = result.communicate() - # unicode: - so = so.decode('utf8', 'replace') - se = se.decode('utf8', 'replace') - - return result.returncode, so, se - - -def locate_vcredist_dir(plat): - """Locate vcredist directory and add it to $PATH - - Adding it to $PATH is required to run - executables that link libzmq to find e.g. msvcp140.dll - """ - from setuptools import msvc - - vcvars = msvc.msvc14_get_vc_env(plat) - try: - vcruntime = vcvars["py_vcruntime_redist"] - except KeyError: - warn(f"platform={plat}, vcvars=") - pprint(vcvars, stream=sys.stderr) - - warn( - "Failed to get py_vcruntime_redist via vcvars, may need to set it in %PATH%" - ) - return None - redist_dir, dll = os.path.split(vcruntime) - # add redist dir to $PATH so that it can be found - os.environ["PATH"] += os.pathsep + redist_dir - return redist_dir diff --git a/buildutils/msg.py b/buildutils/msg.py deleted file mode 100644 index 61807bce2..000000000 --- a/buildutils/msg.py +++ /dev/null @@ -1,42 +0,0 @@ -"""logging""" - -# Copyright (c) PyZMQ Developers. -# Distributed under the terms of the Modified BSD License. - - -import logging -import os -import sys - -# ----------------------------------------------------------------------------- -# Logging (adapted from h5py: https://www.h5py.org/) -# ----------------------------------------------------------------------------- - - -logger = logging.getLogger() -if os.environ.get('DEBUG'): - logger.setLevel(logging.DEBUG) -else: - 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/patch.py b/buildutils/patch.py deleted file mode 100644 index 4a8b8fcf3..000000000 --- a/buildutils/patch.py +++ /dev/null @@ -1,69 +0,0 @@ -"""utils for patching libraries""" - -# Copyright (c) PyZMQ Developers. -# Distributed under the terms of the Modified BSD License. - - -import logging -import os -import re -import sys - -from .misc import get_output_error - -pjoin = os.path.join - -# LIB_PAT from delocate -LIB_PAT = re.compile( - r"\s*(.*) \(compatibility version (\d+\.\d+\.\d+), " - r"current version (\d+\.\d+\.\d+)\)" -) - - -def _get_libs(fname): - rc, so, se = get_output_error(['otool', '-L', fname]) - if rc: - logging.error(f"otool -L {fname} failed: {se!r}") - return - for line in so.splitlines()[1:]: - m = LIB_PAT.match(line) - if m: - yield m.group(1) - - -def _find_library(lib, path): - """Find a library""" - for d in path[::-1]: - real_lib = os.path.join(d, lib) - if os.path.exists(real_lib): - return real_lib - - -def _install_name_change(fname, lib, real_lib): - rc, so, se = get_output_error( - ['install_name_tool', '-change', lib, real_lib, fname] - ) - if rc: - logging.error("Couldn't update load path: %s", se) - - -def patch_lib_paths(fname, library_dirs): - """Load any weakly-defined libraries from their real location - - (only on OS X) - - - Find libraries with `otool -L` - - Update with `install_name_tool -change` - """ - if sys.platform != 'darwin': - return - - libs = _get_libs(fname) - for lib in libs: - if not lib.startswith(('@', '/')): - real_lib = _find_library(lib, library_dirs) - if real_lib: - _install_name_change(fname, lib, real_lib) - - -__all__ = ['patch_lib_paths'] diff --git a/buildutils/vers.c b/buildutils/vers.c deleted file mode 100644 index 362564f38..000000000 --- a/buildutils/vers.c +++ /dev/null @@ -1,11 +0,0 @@ -// check libzmq version - -#include -#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; -} diff --git a/setup.cfg.android b/setup.cfg.android deleted file mode 100644 index 95fb6b226..000000000 --- a/setup.cfg.android +++ /dev/null @@ -1,16 +0,0 @@ -[global] -# the prefix with which libzmq was configured / installed -zmq_prefix = /tmp/zeromq-android -have_sys_un_h = False - -[build_ext] -libraries = python2.6 -# path to your python-for-android -# the result of: -# wget http://python-for-android.googlecode.com/files/python-lib_r16.zip -# unzip python-lib_r16.zip -dpython-lib -library_dirs = ../python-lib/lib/ -include_dirs = ../python-lib/include/python2.6 - -[bdist_egg] -plat-name = linux-armv diff --git a/setup.cfg.template b/setup.cfg.template deleted file mode 100644 index 126b9d901..000000000 --- a/setup.cfg.template +++ /dev/null @@ -1,12 +0,0 @@ -[global] -# zmq_prefix = /usr/local # (adds zmq_prefix/include to include_dirs and zmq_prefix/lib to library_dirs) -# have_sys_un_h = False # does sys/un.h exist? pyzmq will try to detect it, but you can override -# skip_check_zmq = True # skip checking zmq version (if it doesn't work for some reason) -# libzmq_extension = True # force building libzmq as an extension (same as --zmq=bundled) -# no_libzmq_extension = True # prevent fallback on building libzmq as an extension if regular build fails -# use_static_zmq = False # Force usage of static libzmq. Right now it does not work with version autodetection so you should also set skip_check_zmq to True - -[build_ext] -# Edit these to add any paths you need to include (e.g. where libzmq is defined) -library_dirs = /usr/local/lib -include_dirs = /usr/local/include diff --git a/setup.py b/setup.py deleted file mode 100755 index 7c6f685d0..000000000 --- a/setup.py +++ /dev/null @@ -1,1338 +0,0 @@ -#!/usr/bin/env python -# -# ----------------------------------------------------------------------------- -# Copyright (C) PyZMQ Developers -# Distributed under the terms of the Modified BSD License. -# -# The `configure` subcommand is copied and adapted from h5py -# h5py source used under the New BSD license -# -# h5py: -# -# The code to bundle libzmq as an Extension is from pyzmq-static -# pyzmq-static source used under the New BSD license -# -# pyzmq-static: -# ----------------------------------------------------------------------------- - -import copy -import errno -import os -import platform -import shutil -import subprocess -import sys -import time -from contextlib import contextmanager -from glob import glob -from os.path import basename -from os.path import join as pjoin -from pathlib import Path -from subprocess import PIPE, CalledProcessError, Popen, check_call -from sysconfig import get_config_var -from traceback import print_exc - -from packaging.version import Version as V -from setuptools import Command, setup -from setuptools.command.bdist_egg import bdist_egg -from setuptools.command.build_ext import build_ext -from setuptools.command.sdist import sdist -from setuptools.errors import OptionError -from setuptools.extension import Extension - -# local script imports: -sys.path.insert(0, os.path.dirname(__file__)) - -from buildutils import ( - bundled_version, - compile_and_forget, - config_from_prefix, - customize_mingw, - detect_zmq, - discover_settings, - fatal, - fetch_libzmq, - info, - line, - localpath, - locate_vcredist_dir, - merge, - patch_lib_paths, - save_config, - stage_platform_hpp, - v_str, - warn, -) - -# ----------------------------------------------------------------------------- -# Flags -# ----------------------------------------------------------------------------- - - -# name of the libzmq library - can be changed by --libzmq -libzmq_name = "libzmq" - -doing_bdist = any(arg.startswith("bdist") for arg in sys.argv[1:]) -pypy = platform.python_implementation() == 'PyPy' - -# reference points for zmq compatibility - -min_legacy_zmq = (2, 1, 4) -min_good_zmq = (3, 2) -target_zmq = bundled_version -dev_zmq = (target_zmq[0], target_zmq[1] + 1, 0) - -# set dylib ext: -if sys.platform.startswith('win'): - lib_ext = '.dll' -elif sys.platform == 'darwin': - lib_ext = '.dylib' -else: - lib_ext = '.so' - -# allow `--zmq=foo` to be passed at any point, -# but always assign it to configure - -configure_idx = -1 -fetch_idx = -1 -for idx, arg in enumerate(list(sys.argv)): - # track index of configure and fetch_libzmq - if arg == 'configure': - configure_idx = idx - elif arg == 'fetch_libzmq': - fetch_idx = idx - - if arg.startswith('--zmq='): - sys.argv.pop(idx) - if configure_idx < 0: - if fetch_idx < 0: - configure_idx = 1 - else: - configure_idx = fetch_idx + 1 - sys.argv.insert(configure_idx, 'configure') - sys.argv.insert(configure_idx + 1, arg) - break - -for idx, arg in enumerate(list(sys.argv)): - if arg.startswith('--libzmq='): - sys.argv.remove(arg) - libzmq_name = arg.split("=", 1)[1] - if arg == '--enable-drafts': - sys.argv.remove(arg) - os.environ['ZMQ_DRAFT_API'] = '1' - - -if not sys.platform.startswith('win'): - cxx_flags = os.getenv("CXXFLAGS", "") - if "-std" not in cxx_flags: - cxx_flags = "-std=c++11 " + cxx_flags - os.environ["CXXFLAGS"] = cxx_flags - if cxx_flags: - # distutils doesn't support $CXXFLAGS - cxx = os.getenv("CXX", get_config_var("CXX")) - # get_config_var is broken on some old versions of pypy, add a fallback - if cxx is None: - cxx = "c++ -pthread" - os.environ["CXX"] = cxx + " " + cxx_flags - -# ----------------------------------------------------------------------------- -# Configuration (adapted from h5py: https://www.h5py.org/) -# ----------------------------------------------------------------------------- - -# --- compiler settings ------------------------------------------------- - - -def bundled_settings(cmd): - """settings for linking extensions against bundled libzmq""" - settings = {} - settings['libraries'] = [] - settings['library_dirs'] = [] - settings['include_dirs'] = [pjoin("bundled", "zeromq", "include")] - settings['runtime_library_dirs'] = [] - # add pthread on freebsd - # is this necessary? - if sys.platform.startswith('freebsd'): - settings['libraries'].append('pthread') - elif sys.platform.startswith('win'): - # link against libzmq in build dir: - if sys.version_info < (3, 9, 2): - # bpo-39825: EXT_SUFFIX is wrong from sysconfig prior to 3.9.2 / 3.8.7 - import distutils.sysconfig - - ext_suffix = distutils.sysconfig.get_config_var("EXT_SUFFIX") - else: - ext_suffix = get_config_var("EXT_SUFFIX") - suffix = os.path.splitext(ext_suffix)[0] - print(f"DEBUG EXT_SUFFIX {suffix!r} {ext_suffix!r}") - - settings['libraries'].append(libzmq_name + suffix) - settings['library_dirs'].append(pjoin(cmd.build_temp, 'buildutils')) - - return settings - - -def check_pkgconfig(): - """pull compile / link flags from pkg-config if present.""" - pcfg = None - zmq_config = None - try: - pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config') - check_call([pkg_config, '--exists', 'libzmq']) - # this would arguably be better with --variable=libdir / - # --variable=includedir, but would require multiple calls - pcfg = Popen( - [pkg_config, '--libs', '--cflags', 'libzmq'], stdout=subprocess.PIPE - ) - except OSError as osexception: - if osexception.errno == errno.ENOENT: - info('pkg-config not found') - else: - warn("Running pkg-config failed - %s." % osexception) - except CalledProcessError: - info("Did not find libzmq via pkg-config.") - - if pcfg is not None: - output, _ = pcfg.communicate() - output = output.decode('utf8', 'replace') - bits = output.strip().split() - zmq_config = {'library_dirs': [], 'include_dirs': [], 'libraries': []} - for tok in bits: - if tok.startswith("-L"): - zmq_config['library_dirs'].append(tok[2:]) - if tok.startswith("-I"): - zmq_config['include_dirs'].append(tok[2:]) - if tok.startswith("-l"): - zmq_config['libraries'].append(tok[2:]) - info("Settings obtained from pkg-config: %r" % zmq_config) - - return zmq_config - - -def _add_rpath(settings, path): - """Add rpath to settings - - Implemented here because setuptools runtime_library_dirs doesn't do anything on darwin - """ - if sys.platform == 'darwin': - settings['extra_link_args'].extend(['-Wl,-rpath', '-Wl,%s' % path]) - else: - settings['runtime_library_dirs'].append(path) - - -def settings_from_prefix(prefix=None): - """load appropriate library/include settings from ZMQ prefix""" - settings = {} - settings['libraries'] = [] - settings['include_dirs'] = [] - settings['library_dirs'] = [] - settings['runtime_library_dirs'] = [] - settings['extra_link_args'] = [] - - if sys.platform.startswith('win'): - global libzmq_name - - if prefix: - # add prefix itself as well, for e.g. libzmq Windows releases - for include_dir in [pjoin(prefix, 'include'), prefix]: - if os.path.exists(pjoin(include_dir, "zmq.h")): - settings['include_dirs'].append(include_dir) - info(f"Found zmq.h in {include_dir}") - break - else: - warn(f"zmq.h not found in {prefix} or {prefix}/include") - for library_dir in [pjoin(prefix, 'lib'), prefix]: - matches = glob(pjoin(library_dir, f"{libzmq_name}*.dll")) - if matches: - libzmq_path = matches[0] - libzmq_lib, libzmq_dll_name = os.path.split(libzmq_path) - libzmq_name, _ = os.path.splitext(libzmq_dll_name) - info(f"Found {libzmq_path} in {libzmq_lib}") - if libzmq_lib not in os.environ["PATH"].split(os.pathsep): - info(f"Adding {libzmq_lib} to $PATH") - os.environ["PATH"] += os.pathsep + libzmq_lib - settings['library_dirs'].append(library_dir) - break - else: - warn(f"{libzmq_name}.dll not found in {prefix} or {prefix}/lib") - settings['libraries'].append(libzmq_name) - - else: - # add pthread on freebsd - if sys.platform.startswith('freebsd'): - settings['libraries'].append('pthread') - - if sys.platform.startswith('sunos'): - if platform.architecture()[0] == '32bit': - settings['extra_link_args'] += ['-m32'] - else: - settings['extra_link_args'] += ['-m64'] - - if prefix: - settings['libraries'].append('zmq') - - settings['include_dirs'] += [pjoin(prefix, 'include')] - if ( - sys.platform.startswith('sunos') - and platform.architecture()[0] == '64bit' - ): - settings['library_dirs'] += [pjoin(prefix, 'lib/amd64')] - settings['library_dirs'] += [pjoin(prefix, 'lib')] - else: - # If prefix is not explicitly set, pull it from pkg-config by default. - # this is probably applicable across platforms, but i don't have - # sufficient test environments to confirm - pkgcfginfo = check_pkgconfig() - if pkgcfginfo is not None: - # we can get all the zmq-specific values from pkgconfg - for key, value in pkgcfginfo.items(): - settings[key].extend(value) - else: - settings['libraries'].append('zmq') - - if sys.platform == 'darwin' and os.path.isdir('/opt/local/lib'): - # allow macports default - settings['include_dirs'] += ['/opt/local/include'] - settings['library_dirs'] += ['/opt/local/lib'] - if os.environ.get('VIRTUAL_ENV', None): - # find libzmq installed in virtualenv - env = os.environ['VIRTUAL_ENV'] - settings['include_dirs'] += [pjoin(env, 'include')] - settings['library_dirs'] += [pjoin(env, 'lib')] - - for path in settings['library_dirs']: - _add_rpath(settings, os.path.abspath(path)) - info(settings) - - return settings - - -class LibZMQVersionError(Exception): - pass - - -# ----------------------------------------------------------------------------- -# Extra commands -# ----------------------------------------------------------------------------- - - -class bdist_egg_disabled(bdist_egg): - """Disabled version of bdist_egg - - Prevents setup.py install from performing setuptools' default easy_install, - which it should never ever do. - """ - - def run(self): - sys.exit( - "Aborting implicit building of eggs. Use `pip install .` to install from source." - ) - - -class Configure(build_ext): - """Configure command adapted from h5py""" - - description = "Discover ZMQ version and features" - - user_options = build_ext.user_options + [ - ('zmq=', None, "libzmq install prefix"), - ( - 'build-base=', - 'b', - "base directory for build library", - ), # build_base from build - ] - - def initialize_options(self): - super().initialize_options() - self.zmq = os.environ.get("ZMQ_PREFIX") or None - self.build_base = 'build' - - def finalize_options(self): - super().finalize_options() - self.tempdir = pjoin(self.build_temp, 'scratch') - self.has_run = False - self.config = discover_settings(self.build_base) - if self.zmq is not None: - merge(self.config, config_from_prefix(self.zmq)) - - # ensure vcredist is on PATH in MSVC toolchain - if sys.platform.startswith("win") and 'MSC' in sys.version: - locate_vcredist_dir(self.plat_name) - # need a dummy extension for run to set up a compiler - self.extensions = [Extension("fake", ["unused.c"])] - - def save_config(self, name, cfg): - """write config to JSON""" - save_config(name, cfg, self.build_base) - # write to zmq.utils.[name].json - save_config(name, cfg, os.path.join('zmq', 'utils')) - # also write to build_lib, because we might be run after copying to - # build_lib has already happened. - build_lib_utils = os.path.join(self.build_lib, 'zmq', 'utils') - if os.path.exists(build_lib_utils): - save_config(name, cfg, build_lib_utils) - - def init_settings_from_config(self): - """set up compiler settings, based on config""" - cfg = self.config - - if cfg['libzmq_extension']: - settings = bundled_settings(self) - else: - settings = settings_from_prefix(cfg['zmq_prefix']) - - if 'have_sys_un_h' not in cfg: - # don't link against anything when checking for sys/un.h - minus_zmq = copy.deepcopy(settings) - try: - minus_zmq['libraries'] = [] - except Exception: - pass - try: - compile_and_forget( - self.tempdir, - pjoin('buildutils', 'check_sys_un.c'), - compiler=self.compiler, - **minus_zmq, - ) - except Exception as e: - warn("No sys/un.h, IPC_PATH_MAX_LEN will be undefined: %s" % e) - cfg['have_sys_un_h'] = False - else: - cfg['have_sys_un_h'] = True - - self.save_config('config', cfg) - - settings.setdefault('define_macros', []) - if cfg['have_sys_un_h']: - settings['define_macros'].append(('HAVE_SYS_UN_H', 1)) - - if cfg['win_ver']: - # set target minimum Windows version - settings['define_macros'].extend( - [ - ('WINVER', cfg['win_ver']), - ('_WIN32_WINNT', cfg['win_ver']), - ] - ) - - if cfg.get('zmq_draft_api'): - settings['define_macros'].append(('ZMQ_BUILD_DRAFT_API', 1)) - - use_static_zmq = cfg.get('use_static_zmq', 'False').upper() - if use_static_zmq in ('TRUE', '1'): - settings['define_macros'].append(('ZMQ_STATIC', '1')) - - if os.environ.get("PYZMQ_CYTHON_COVERAGE", "") not in {"", "0"}: - settings['define_macros'].append(('CYTHON_TRACE', '1')) - - # include internal directories - settings.setdefault('include_dirs', []) - settings['include_dirs'] += [pjoin('zmq', sub) for sub in ('utils',)] - - settings.setdefault('libraries', []) - # Explicitly link dependencies, not necessary if zmq is dynamic - if sys.platform.startswith('win'): - settings['libraries'].extend(('ws2_32', 'iphlpapi', 'advapi32')) - - for ext in self.distribution.ext_modules: - if ext.name.startswith('zmq.lib'): - continue - for attr, value in settings.items(): - setattr(ext, attr, value) - - self.compiler_settings = settings - self.save_config('compiler', settings) - - def create_tempdir(self): - self.erase_tempdir() - os.makedirs(self.tempdir) - - def erase_tempdir(self): - try: - shutil.rmtree(self.tempdir) - except Exception: - pass - - @property - def compiler_type(self): - return self.compiler.compiler_type - - @property - def cross_compiling(self): - return self.config['bdist_egg'].get('plat-name', sys.platform) != sys.platform - - def check_zmq_version(self): - """check the zmq version""" - cfg = self.config - # build test program - zmq_prefix = cfg['zmq_prefix'] - detected = self.test_build(zmq_prefix, self.compiler_settings) - # now check the libzmq version - - vers = tuple(detected['vers']) - vs = v_str(vers) - if cfg['allow_legacy_libzmq']: - min_zmq = min_legacy_zmq - else: - min_zmq = min_good_zmq - if vers < min_zmq: - msg = [ - "Detected ZMQ version: %s, but require ZMQ >= %s" - % (vs, v_str(min_zmq)), - ] - if zmq_prefix: - msg.append(" ZMQ_PREFIX=%s" % zmq_prefix) - if vers >= min_legacy_zmq: - msg.append( - " Explicitly allow legacy zmq by specifying `ZMQ_PREFIX=/zmq/prefix`" - ) - - raise LibZMQVersionError('\n'.join(msg)) - if vers < min_good_zmq: - msg = [ - "Detected legacy ZMQ version: %s. It is STRONGLY recommended to use ZMQ >= %s" - % (vs, v_str(min_good_zmq)), - ] - if zmq_prefix: - msg.append(" ZMQ_PREFIX=%s" % zmq_prefix) - warn('\n'.join(msg)) - elif vers < target_zmq: - warn( - "Detected ZMQ version: %s, but pyzmq targets ZMQ %s." - % (vs, v_str(target_zmq)) - ) - warn( - "libzmq features and fixes introduced after %s will be unavailable." - % vs - ) - line() - elif vers >= dev_zmq: - warn( - "Detected ZMQ version: %s. Some new features in libzmq may not be exposed by pyzmq." - % vs - ) - line() - - if sys.platform.startswith('win'): - # fetch libzmq.dll into local dir - local_dll = localpath('zmq', libzmq_name + '.dll') - if not zmq_prefix and not os.path.exists(local_dll): - fatal( - "ZMQ directory must be specified on Windows via setup.cfg or 'ZMQ_PREFIX=/path/to/libzmq' env" - ) - - def bundle_libzmq_extension(self): - bundledir = "bundled" - ext_modules = self.distribution.ext_modules - if ext_modules and any(m.name == 'zmq.libzmq' for m in ext_modules): - # I've already been run - return - - line() - info("Using bundled libzmq") - - # fetch sources for libzmq extension: - if not os.path.exists(bundledir): - os.makedirs(bundledir) - - fetch_libzmq(bundledir) - - stage_platform_hpp(pjoin(bundledir, 'zeromq')) - - sources = [pjoin('buildutils', 'initlibzmq.cpp')] - sources.extend( - [ - src - for src in glob(pjoin(bundledir, 'zeromq', 'src', '*.cpp')) - # exclude draft ws transport files - if not os.path.basename(src).startswith(("ws_", "wss_")) - ] - ) - - if sys.platform.startswith("win"): # only compile wepoll on windows... - sources.append(pjoin('bundled', 'zeromq', 'external', 'wepoll', 'wepoll.c')) - includes = [pjoin(bundledir, 'zeromq', 'include')] - - if bundled_version < (4, 2, 0): - tweetnacl = pjoin(bundledir, 'zeromq', 'tweetnacl') - tweetnacl_sources = glob(pjoin(tweetnacl, 'src', '*.c')) - - randombytes = pjoin(tweetnacl, 'contrib', 'randombytes') - if sys.platform.startswith('win'): - tweetnacl_sources.append(pjoin(randombytes, 'winrandom.c')) - else: - tweetnacl_sources.append(pjoin(randombytes, 'devurandom.c')) - - sources += tweetnacl_sources - includes.append(pjoin(tweetnacl, 'src')) - includes.append(randombytes) - else: - # >= 4.2 - sources += glob(pjoin(bundledir, 'zeromq', 'src', 'tweetnacl.c')) - - # construct the Extensions: - libzmq = Extension( - 'zmq.libzmq', - sources=sources, - include_dirs=includes, - ) - - # register the extension: - # doing this here means we must be run - # before finalize_options in build_ext - self.distribution.ext_modules.insert(0, libzmq) - - # use tweetnacl to provide CURVE support - libzmq.define_macros.append(('ZMQ_HAVE_CURVE', 1)) - libzmq.define_macros.append(('ZMQ_USE_TWEETNACL', 1)) - - # set draft flag - if self.config["zmq_draft_api"]: - libzmq.define_macros.append(('ZMQ_BUILD_DRAFT_API', 1)) - - # select polling subsystem based on platform - if sys.platform == "darwin" or "bsd" in sys.platform: - libzmq.define_macros.append(('ZMQ_USE_KQUEUE', 1)) - libzmq.define_macros.append(('ZMQ_IOTHREADS_USE_KQUEUE', 1)) - libzmq.define_macros.append(('ZMQ_POLL_BASED_ON_POLL', 1)) - elif 'linux' in sys.platform: - libzmq.define_macros.append(('ZMQ_USE_EPOLL', 1)) - libzmq.define_macros.append(('ZMQ_IOTHREADS_USE_EPOLL', 1)) - libzmq.define_macros.append(('ZMQ_POLL_BASED_ON_POLL', 1)) - elif sys.platform.startswith('win'): - libzmq.define_macros.append(('ZMQ_USE_SELECT', 1)) - libzmq.define_macros.append(('ZMQ_IOTHREADS_USE_SELECT', 1)) - libzmq.define_macros.append(('ZMQ_POLL_BASED_ON_SELECT', 1)) - else: - # this may not be sufficiently precise - libzmq.define_macros.append(('ZMQ_USE_POLL', 1)) - libzmq.define_macros.append(('ZMQ_IOTHREADS_USE_POLL', 1)) - libzmq.define_macros.append(('ZMQ_POLL_BASED_ON_POLL', 1)) - - if sys.platform.startswith('win'): - # include defines from zeromq msvc project: - libzmq.define_macros.append(('FD_SETSIZE', 16384)) - libzmq.define_macros.append(('DLL_EXPORT', 1)) - libzmq.define_macros.append(('_CRT_SECURE_NO_WARNINGS', 1)) - - # When compiling the C++ code inside of libzmq itself, we want to - # avoid "warning C4530: C++ exception handler used, but unwind - # semantics are not enabled. Specify /EHsc". - if self.compiler.compiler_type == 'msvc': - libzmq.extra_compile_args.append('/EHsc') - elif self.compiler.compiler_type == 'mingw32': - libzmq.define_macros.append(('ZMQ_HAVE_MINGW32', 1)) - - # And things like sockets come from libraries that must be named. - libzmq.libraries.extend(['rpcrt4', 'ws2_32', 'advapi32', 'iphlpapi']) - - else: - libzmq.include_dirs.append(bundledir) - - # check if we need to link against Realtime Extensions library - if not sys.platform.startswith(('darwin', 'freebsd')): - line() - info("checking for timer_create") - if not self.compiler.has_function('timer_create'): - info("no timer_create, linking librt") - libzmq.libraries.append('rt') - else: - info("ok") - - # copy the header files to the source tree. - bundledincludedir = pjoin('zmq', 'include') - if not os.path.exists(bundledincludedir): - os.makedirs(bundledincludedir) - if not os.path.exists(pjoin(self.build_lib, bundledincludedir)): - os.makedirs(pjoin(self.build_lib, bundledincludedir)) - - for header in glob(pjoin(bundledir, 'zeromq', 'include', '*.h')): - shutil.copyfile(header, pjoin(bundledincludedir, basename(header))) - shutil.copyfile( - header, pjoin(self.build_lib, bundledincludedir, basename(header)) - ) - - # update other extensions, with bundled settings - self.config['libzmq_extension'] = True - self.init_settings_from_config() - self.save_config('config', self.config) - - def fallback_on_bundled(self): - """Couldn't build, fallback after waiting a while""" - - line() - - warn( - '\n'.join( - [ - "Couldn't find an acceptable libzmq on the system.", - "", - "If you expected pyzmq to link against an installed libzmq, please check to make sure:", - "", - " * You have a C compiler installed", - " * A development version of Python is installed (including headers)", - " * A development version of ZMQ >= %s is installed (including headers)" - % v_str(min_good_zmq), - " * If ZMQ is not in a default location, specify the env ZMQ_PREFIX=", - " * If you did recently install ZMQ to a default location,", - " try rebuilding the ld cache with `sudo ldconfig`", - " or specify zmq's location with `ZMQ_PREFIX=/usr/local`", - "", - ] - ) - ) - - info( - '\n'.join( - [ - "You can skip all this detection/waiting nonsense if you know", - "you want pyzmq to bundle libzmq as an extension by passing:", - "", - " `ZMQ_PREFIX=bundled`", - "", - "I will now try to build libzmq as a Python extension", - "unless you interrupt me (^C) in the next 10 seconds...", - "", - ] - ) - ) - - for i in range(10, 0, -1): - sys.stdout.write('\r%2i...' % i) - sys.stdout.flush() - time.sleep(1) - - info("") - - return self.bundle_libzmq_extension() - - def test_build(self, prefix, settings): - """do a test build ob libzmq""" - self.create_tempdir() - settings = settings.copy() - line() - info("Configure: Autodetecting ZMQ settings...") - info(" Custom ZMQ dir: %s" % prefix) - try: - detected = detect_zmq(self.tempdir, compiler=self.compiler, **settings) - finally: - self.erase_tempdir() - - info(" ZMQ version detected: %s" % v_str(detected['vers'])) - - return detected - - def finish_run(self): - self.save_config('config', self.config) - line() - - def build_extensions(self): - """Need an empty build_extensions so that .run() gives us a configured compiler""" - - def run(self): - # super().run() is what sets up self.compiler - super().run() - self.init_settings_from_config() - - cfg = self.config - - if cfg['libzmq_extension']: - self.bundle_libzmq_extension() - self.finish_run() - return - - # When cross-compiling and zmq is given explicitly, we can't testbuild - # (as we can't testrun the binary), we assume things are alright. - if cfg['skip_check_zmq'] or self.cross_compiling: - warn("Skipping zmq version check") - self.finish_run() - return - - zmq_prefix = cfg['zmq_prefix'] - # There is no available default on Windows, so start with fallback unless - # zmq was given explicitly, or libzmq extension was explicitly prohibited. - if ( - sys.platform.startswith("win") - and not cfg['no_libzmq_extension'] - and not zmq_prefix - ): - self.fallback_on_bundled() - self.finish_run() - return - - # first try with given config or defaults - try: - self.check_zmq_version() - except LibZMQVersionError as e: - info("\nBad libzmq version: %s\n" % e) - except Exception as e: - # print the error as setuptools would if we let it raise: - info("\nerror: %s\n" % e) - else: - self.finish_run() - return - - # try fallback on /usr/local on *ix if no prefix is given - if not zmq_prefix and not sys.platform.startswith('win'): - info("Failed with default libzmq, trying again with /usr/local") - time.sleep(1) - zmq_prefix = cfg['zmq_prefix'] = '/usr/local' - self.init_settings_from_config() - try: - self.check_zmq_version() - except LibZMQVersionError as e: - info("\nBad libzmq version: %s\n" % e) - except Exception as e: - # print the error as setuptools would if we let it raise: - info("\nerror: %s\n" % e) - else: - # if we get here the second run succeeded, so we need to update compiler - # settings for the extensions with /usr/local prefix - self.finish_run() - return - - # finally, fallback on bundled - - if cfg['no_libzmq_extension']: - fatal( - "Falling back on bundled libzmq," - " but config has explicitly prohibited building the libzmq extension." - ) - - self.fallback_on_bundled() - - self.finish_run() - - -class FetchCommand(Command): - """Fetch libzmq, that's it.""" - - description = "Fetch libzmq sources or dll" - - user_options = [ - ('dll', None, "Fetch binary dll (Windows only)"), - ] - - def initialize_options(self): - self.dll = False - - def finalize_options(self): - pass - - def run(self): - # fetch sources for libzmq extension: - if self.dll: - self.fetch_libzmq_dll() - else: - self.fetch_libzmq_src() - - def fetch_libzmq_dll(self): - libdir = "libzmq-dll" - if os.path.exists(libdir): - info("Scrubbing directory: %s" % libdir) - shutil.rmtree(libdir) - if not os.path.exists(libdir): - os.makedirs(libdir) - # fetch_libzmq_dll(libdir) - for archive in glob(pjoin(libdir, '*.zip')): - os.remove(archive) - - def fetch_libzmq_src(self): - bundledir = "bundled" - if os.path.exists(bundledir): - info("Scrubbing directory: %s" % bundledir) - shutil.rmtree(bundledir) - if not os.path.exists(bundledir): - os.makedirs(bundledir) - fetch_libzmq(bundledir) - - -class TestCommand(Command): - """Custom setuptools command to run the test suite.""" - - description = "DEPRECATED, use pytest" - - user_options = [] - - def initialize_options(self): - self._dir = os.getcwd() - - def finalize_options(self): - pass - - def run(self): - """Run the test suite with pytest""" - warn("Running pyzmq's tests with `setup.py test` is deprecated. Use `pytest`.") - time.sleep(10) - # crude check for inplace build: - try: - import zmq - except ImportError: - print_exc() - fatal( - '\n '.join( - [ - "Could not import zmq!", - "You must build pyzmq with 'python setup.py build_ext --inplace' for 'python setup.py test' to work.", - "If you did build pyzmq in-place, then this is a real error.", - ] - ) - ) - sys.exit(1) - - info(f"Testing pyzmq-{zmq.pyzmq_version()} with libzmq-{zmq.zmq_version()}") - p = Popen([sys.executable, '-m', 'pytest', '-v', os.path.join('zmq', 'tests')]) - p.wait() - sys.exit(p.returncode) - - -class GitRevisionCommand(Command): - """find the current git revision and add it to zmq.sugar.version.__revision__""" - - description = "Store current git revision in version.py" - - user_options = [] - - def initialize_options(self): - self.version_py = pjoin('zmq', 'sugar', 'version.py') - - def run(self): - try: - p = Popen('git log -1'.split(), stdin=PIPE, stdout=PIPE, stderr=PIPE) - except OSError: - warn("No git found, skipping git revision") - return - - if p.wait(): - warn("checking git branch failed") - info(p.stderr.read()) - return - - line = p.stdout.readline().decode().strip() - if not line.startswith('commit'): - warn("bad commit line: %r" % line) - return - - rev = line.split()[-1] - - # now that we have the git revision, we can apply it to version.py - with open(self.version_py) as f: - lines = f.readlines() - - for i, line in enumerate(lines): - if line.startswith('__revision__'): - lines[i] = "__revision__ = '%s'\n" % rev - break - with open(self.version_py, 'w') as f: - f.writelines(lines) - - def finalize_options(self): - pass - - -class CleanCommand(Command): - """Custom setuptools command to clean the .so and .pyc files.""" - - user_options = [ - ('all', 'a', "remove all build output, not just temporary by-products") - ] - - boolean_options = ['all'] - - def initialize_options(self): - self.all = None - - def finalize_options(self): - pass - - def run(self): - _clean_me = [] - _clean_trees = [] - - for d in ('build', 'dist', 'conf'): - if os.path.exists(d): - _clean_trees.append(d) - - for root, dirs, files in os.walk('buildutils'): - if any(root.startswith(pre) for pre in _clean_trees): - continue - for f in files: - if os.path.splitext(f)[-1] == '.pyc': - _clean_me.append(pjoin(root, f)) - - if '__pycache__' in dirs: - _clean_trees.append(pjoin(root, '__pycache__')) - - for root, dirs, files in os.walk('zmq'): - if any(root.startswith(pre) for pre in _clean_trees): - continue - - for f in files: - if os.path.splitext(f)[-1] in ('.pyc', '.so', '.o', '.pyd', '.json'): - _clean_me.append(pjoin(root, f)) - - # remove generated cython files - if self.all: - for f in files: - f2 = os.path.splitext(f) - if f2[1] == '.c' and os.path.isfile( - os.path.join(root, f2[0]) + '.pyx' - ): - _clean_me.append(pjoin(root, f)) - - for d in dirs: - if d == '__pycache__': - _clean_trees.append(pjoin(root, d)) - - bundled = glob(pjoin('zmq', 'libzmq*')) - _clean_me.extend([b for b in bundled if b not in _clean_me]) - - bundled_headers = glob(pjoin('zmq', 'include', '*.h')) - _clean_me.extend([h for h in bundled_headers if h not in _clean_me]) - - for clean_me in _clean_me: - print("removing %s" % clean_me) - try: - os.unlink(clean_me) - except Exception as e: - print(e, file=sys.stderr) - for clean_tree in _clean_trees: - print("removing %s/" % clean_tree) - try: - shutil.rmtree(clean_tree) - except Exception as e: - print(e, file=sys.stderr) - - -class CheckSDist(sdist): - """Custom sdist that ensures Cython has compiled all pyx files to c.""" - - def initialize_options(self): - sdist.initialize_options(self) - self._pyxfiles = [] - for root, dirs, files in os.walk('zmq'): - for f in files: - if f.endswith('.pyx'): - self._pyxfiles.append(pjoin(root, f)) - - def run(self): - self.run_command('fetch_libzmq') - if 'cython' in cmdclass: - self.run_command('cython') - else: - for pyxfile in self._pyxfiles: - cfile = pyxfile[:-3] + 'c' - msg = ( - "C-source file '%s' not found." % (cfile) - + " Run 'setup.py cython' before sdist." - ) - assert os.path.isfile(cfile), msg - sdist.run(self) - - -@contextmanager -def use_cxx(compiler): - """use C++ compiler in this context - - used in fix_cxx which detects when C++ should be used - """ - compiler_so_save = compiler.compiler_so[:] - compiler_so_cxx = compiler.compiler_cxx + compiler.compiler_so[1:] - # actually use CXX compiler - compiler.compiler_so = compiler_so_cxx - try: - yield - finally: - # restore original state - compiler.compiler_so = compiler_so_save - - -@contextmanager -def fix_cxx(compiler, extension): - """Fix C++ compilation to use C++ compiler - - See https://bugs.python.org/issue1222585 for Python support for C++, - which apparently doesn't exist and only works by accident. - """ - if compiler.detect_language(extension.sources) != "c++": - # no c++, nothing to do - yield - return - _compile_save = compiler._compile - - def _compile_cxx(obj, src, ext, *args, **kwargs): - if compiler.language_map.get(ext) == "c++": - with use_cxx(compiler): - _compile_save(obj, src, ext, *args, **kwargs) - else: - _compile_save(obj, src, ext, *args, **kwargs) - - compiler._compile = _compile_cxx - try: - yield - finally: - compiler._compile = _compile_save - - -class CheckingBuildExt(build_ext): - """Subclass build_ext to get clearer report if Cython is necessary.""" - - def check_cython_extensions(self, extensions): - for ext in extensions: - for src in ext.sources: - if not os.path.exists(src): - fatal( - """Cython-generated file '%s' not found. - Cython >= %s is required to compile pyzmq from a development branch. - Please install Cython or download a release package of pyzmq. - """ - % (src, min_cython_version) - ) - - def build_extensions(self): - self.check_cython_extensions(self.extensions) - self.check_extensions_list(self.extensions) - - if self.compiler.compiler_type == 'mingw32': - customize_mingw(self.compiler) - - for ext in self.extensions: - self.build_extension(ext) - - def build_extension(self, ext): - with fix_cxx(self.compiler, ext): - super().build_extension(ext) - - ext_path = self.get_ext_fullpath(ext.name) - patch_lib_paths(ext_path, self.compiler.library_dirs) - - def finalize_options(self): - # this is normally done by super().finalize_options() but it - # needs to be done *before* we call configure if cython, - # numpy and pythran are all installed; and we can't call it - # after finalize_options() because that breaks pypy builds - # on Windows; logic copied from distutils/command/build_ext.py - # https://github.com/zeromq/pyzmq/pull/1872 - if isinstance(self.parallel, str): - try: - self.parallel = int(self.parallel) - except ValueError: - raise OptionError("parallel should be an integer") - - # check version, to prevent confusing undefined constant errors - self.distribution.run_command("configure") - return super().finalize_options() - - -class ConstantsCommand(Command): - """Rebuild templated files for constants - - To be run after adding new constants to `utils/constant_names`. - """ - - user_options = [] - - def initialize_options(self): - return - - def finalize_options(self): - pass - - def run(self): - from buildutils.constants import render_constants - - render_constants() - - -cmdclass = { - "bdist_egg": bdist_egg if "bdist_egg" in sys.argv else bdist_egg_disabled, - "clean": CleanCommand, - "configure": Configure, - "constants": ConstantsCommand, - "fetch_libzmq": FetchCommand, - "revision": GitRevisionCommand, - "sdist": CheckSDist, - "test": TestCommand, -} - -# ----------------------------------------------------------------------------- -# Extensions -# ----------------------------------------------------------------------------- - - -zmq_path = Path("zmq").resolve() -backend_cython = zmq_path / "backend" / "cython" -utils = zmq_path / 'utils' - -submodules = { - 'backend.cython': { - '_zmq': [ - backend_cython / "libzmq.pxd", - backend_cython / "_externs.pxd", - utils / "buffers.pxd", - ] - + list(utils.glob("*.h")) - }, -} - -# require cython 3 -min_cython_version = "3.0.0" -cython_language_level = "3str" - -try: - import Cython - - if V(Cython.__version__) < V(min_cython_version): - raise ImportError( - "Cython >= %s required for cython build, found %s" - % (min_cython_version, Cython.__version__) - ) - from Cython.Build import cythonize - from Cython.Distutils.build_ext import new_build_ext as build_ext_cython - - cython = True -except Exception: - warn( - f"Cython >= {min_cython_version} is a build dependency of pyzmq. Cython sources may be out of date." - ) - cython = False - suffix = '.c' - cmdclass['build_ext'] = CheckingBuildExt - - class MissingCython(Command): - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - try: - import Cython - except ImportError: - warn("Cython is missing") - else: - cv = getattr(Cython, "__version__", None) - if cv is None or V(cv) < V(min_cython_version): - warn( - "Cython >= %s is required for compiling Cython sources, " - "found: %s" % (min_cython_version, cv or Cython) - ) - - cmdclass['cython'] = MissingCython - -else: - suffix = '.py' - - class CythonCommand(build_ext_cython): - """Custom setuptools command subclassed from Cython.Distutils.build_ext - to compile pyx->c, and stop there. All this does is override the - C-compile method build_extension() with a no-op.""" - - description = "Compile Cython sources to C" - - def build_extension(self, ext): - pass - - class zbuild_ext(build_ext_cython): - def build_extensions(self): - if self.compiler.compiler_type == 'mingw32': - customize_mingw(self.compiler) - return super().build_extensions() - - def build_extension(self, ext): - with fix_cxx(self.compiler, ext): - super().build_extension(ext) - ext_path = self.get_ext_fullpath(ext.name) - patch_lib_paths(ext_path, self.compiler.library_dirs) - - def finalize_options(self): - # this is normally done by super().finalize_options() but it - # needs to be done *before* we call configure if cython, - # numpy and pythran are all installed; and we can't call it - # after finalize_options() because that breaks pypy builds - # on Windows; logic copied from distutils/command/build_ext.py - # https://github.com/zeromq/pyzmq/pull/1872 - if isinstance(self.parallel, str): - try: - self.parallel = int(self.parallel) - except ValueError: - raise OptionError("parallel should be an integer") - - self.distribution.run_command("configure") - return super().finalize_options() - - cmdclass["cython"] = CythonCommand - cmdclass["build_ext"] = zbuild_ext - -extensions = [] -ext_include_dirs = [pjoin('zmq', sub) for sub in ('utils',)] -ext_kwargs = { - 'include_dirs': ext_include_dirs, -} - -for submod, packages in submodules.items(): - for pkg in sorted(packages): - sources = [pjoin("zmq", submod.replace(".", os.path.sep), pkg + suffix)] - ext = Extension(f"zmq.{submod}.{pkg}", sources=sources, **ext_kwargs) - extensions.append(ext) - -if cython: - # set binding so that compiled methods can be inspected - # set language-level to 3str, requires Cython 0.29 - cython_directives = {"binding": True, "language_level": "3str"} - if os.environ.get("PYZMQ_CYTHON_COVERAGE", "") not in {"", "0"}: - cython_directives["linetrace"] = True - extensions = cythonize(extensions, compiler_directives=cython_directives) - -if pypy: - extensions = [] - -if pypy or os.environ.get("PYZMQ_BACKEND_CFFI"): - cffi_modules = ['buildutils/build_cffi.py:ffi'] -else: - cffi_modules = [] - -package_data = { - 'zmq': ['*.pxd', '*.pyi', '*' + lib_ext, 'py.typed'], - 'zmq.backend': ['*.pyi'], - 'zmq.backend.cython': ['*.pxd', '*.pxi'], - 'zmq.backend.cffi': ['*.h', '*.c'], - 'zmq.devices': ['*.pxd'], - 'zmq.sugar': ['*.pyi'], - 'zmq.tests': ['*.pyx'], - 'zmq.utils': ['*.pxd', '*.h', '*.json'], -} - - -def find_packages(): - """adapted from IPython's setupbase.find_packages()""" - packages = [] - for dir, subdirs, files in os.walk('zmq'): - package = dir.replace(os.path.sep, '.') - if '__init__.py' not in files: - # not a package - continue - packages.append(package) - return packages - - -# ----------------------------------------------------------------------------- -# Main setup -# ----------------------------------------------------------------------------- - -with open('README.md', encoding='utf-8') as f: - long_desc = f.read() - -setup_args = dict( - packages=find_packages(), - ext_modules=extensions, - cffi_modules=cffi_modules, - package_data=package_data, - cmdclass=cmdclass, -) - -setup(**setup_args) From 0c16e4c0af5cfdc08b89d0d5cbf162dbc4abe256 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 5 Jan 2024 13:30:33 +0100 Subject: [PATCH 15/16] no longer have pre-steps for sdists --- .github/workflows/wheels.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f407a5d2e..c45228324 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -56,8 +56,6 @@ jobs: - name: build sdist run: | - python setup.py fetch_libzmq - python setup.py cython python -m build --sdist . - uses: actions/upload-artifact@v4 From 22875ad7472f698c5841c03f745b9bb52b39d7f4 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 13 Feb 2024 15:38:55 +0100 Subject: [PATCH 16/16] add cffi to meson --- .gitignore | 1 + buildutils/build_cffi.py | 3 ++- meson.build | 2 ++ zmq/backend/cffi/meson.build | 20 ++++++++++++++++++++ zmq/backend/cython/meson.build | 18 +++++++++--------- zmq/backend/meson.build | 6 +++++- 6 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 zmq/backend/cffi/meson.build diff --git a/.gitignore b/.gitignore index 193681ea7..479a23cfa 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .vagrant *.pyc zmq/backend/cython/*.c +zmq/backend/cffi/*.[co] zmq/devices/*.c zmq/utils/*.json zmq/include/*.h diff --git a/buildutils/build_cffi.py b/buildutils/build_cffi.py index 936785c71..8c5d76481 100644 --- a/buildutils/build_cffi.py +++ b/buildutils/build_cffi.py @@ -1,5 +1,6 @@ import json import os +import sys import cffi @@ -58,4 +59,4 @@ def load_compiler_config(): ) if __name__ == "__main__": - ffi.compile(verbose=True) + ffi.emit_c_code(sys.argv[1]) diff --git a/meson.build b/meson.build index 0abf33885..ac6d7ea8f 100644 --- a/meson.build +++ b/meson.build @@ -14,6 +14,7 @@ python3 = py.full_path() cfg = configuration_data() foreach key : ['zmq_prefix', 'zmq_draft_api'] + # workaround meson's religious objection to environment variables env_key = key.to_upper() res = run_command(python3, '-c', 'import os; print(os.environ.get("@0@", ""))'.format(env_key), check: true) str_value = res.stdout().strip() @@ -25,6 +26,7 @@ foreach key : ['zmq_prefix', 'zmq_draft_api'] cfg.set(key, str_value) endif endforeach + foreach key: cfg.keys() message('@0@: @1@'.format(key, cfg.get(key))) endforeach diff --git a/zmq/backend/cffi/meson.build b/zmq/backend/cffi/meson.build new file mode 100644 index 000000000..364c372ff --- /dev/null +++ b/zmq/backend/cffi/meson.build @@ -0,0 +1,20 @@ +cffi_c = '_cffi.c' + +cffi = custom_target( + 'cffi_c', + command: [py, meson.source_root() / 'buildutils' / 'build_cffi.py', '@OUTPUT@'], + output: [cffi_c], + # depend_files: [], +) + +incdir = include_directories('../../utils') + +py.extension_module( + '_cffi', + [cffi], + dependencies: libzmq, + subdir: 'zmq/backend/cffi', + include_directories: incdir, + # TODO: link_with for bundled libzmq + install: true, +) diff --git a/zmq/backend/cython/meson.build b/zmq/backend/cython/meson.build index d9cf960a1..707c13d16 100644 --- a/zmq/backend/cython/meson.build +++ b/zmq/backend/cython/meson.build @@ -1,16 +1,16 @@ cython_cli = find_program('cython') cython_gen = generator(cython_cli, - arguments : ['--3str', '@INPUT@', '--output-file', '@OUTPUT@'], - output : '@BASENAME@.c') + arguments : ['--3str', '@INPUT@', '--output-file', '@OUTPUT@'], + output : '@BASENAME@.c') incdir = include_directories('../../utils') py.extension_module( - '_zmq', - cython_gen.process('_zmq.py'), - subdir: 'zmq/backend/cython', - dependencies: libzmq, - include_directories: incdir, - # TODO: link_with for bundled libzmq - install: true, + '_zmq', + cython_gen.process('_zmq.py'), + subdir: 'zmq/backend/cython', + dependencies: libzmq, + include_directories: incdir, + # TODO: link_with for bundled libzmq + install: true, ) diff --git a/zmq/backend/meson.build b/zmq/backend/meson.build index b19a00d26..00fee0e5a 100644 --- a/zmq/backend/meson.build +++ b/zmq/backend/meson.build @@ -1 +1,5 @@ -subdir('cython') +if py.get_variable('SOABI').startswith('pypy') + subdir('cffi') +else + subdir('cython') +endif