diff --git a/.circleci/config.yml b/.circleci/config.yml index 51febd6ae..22b69ccd6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,13 +31,6 @@ jobs: command: | python3 -m pip freeze - - run: - name: Cython - # This assumes pytest is installed via the install-package step above - command: | - python3 setup.py fetch_libzmq - python3 setup.py cython - - run: name: list wheels command: | diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index eb3549a05..0ca2a4df6 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -25,19 +25,6 @@ env: # CIBW_PRERELEASE_PYTHONS: "1" jobs: - check-bundle: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - - name: setup python - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: check bundled libzmq checksums - run: python -m buildutils.bundle checksums - sdist: runs-on: ubuntu-22.04 @@ -56,8 +43,6 @@ jobs: - name: build sdist run: | - python setup.py fetch_libzmq - python setup.py cython python -m build --sdist . - uses: actions/upload-artifact@v4 diff --git a/.gitignore b/.gitignore index 193681ea7..19d2f7afd 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 @@ -39,3 +40,9 @@ htmlcov coverage.xml env .eggs + +CMakeFiles +CMakeCache.txt +cmake_install.cmake +_deps +Makefile diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..3651a8d71 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,350 @@ +# 3.28 needed for EXCLUDE_FROM_ALL +cmake_minimum_required(VERSION 3.28) +project(${SKBUILD_PROJECT_NAME} LANGUAGES C CXX) +set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + +list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +find_package( + Python + COMPONENTS Interpreter Development.Module + REQUIRED) + +# TODO: +# [x] find zmq cmake +# [x] find zmq pkg-config +# [x] find zmq prefix +# [x] bundle static libzmq posix +# [x] bundle static libzmq windows +# [x] support draft API + +set(ZMQ_PREFIX "auto" CACHE STRING "libzmq installation prefix or 'bundled'") +option(ZMQ_DRAFT_API "whether to build the libzmq draft API" OFF) +set(LIBZMQ_BUNDLED_VERSION "4.3.5" CACHE STRING "libzmq version when bundling") +set(LIBSODIUM_BUNDLED_VERSION "1.0.19" CACHE STRING "libsodium version when bundling") +set(LIBZMQ_BUNDLED_URL "" CACHE STRING "full URL to download bundled libzmq") +set(LIBSODIUM_BUNDLED_URL "" CACHE STRING "full URL to download bundled libsodium") +set(LIBSODIUM_CONFIGURE_ARGS "" CACHE STRING "semicolon-separated list of arguments to pass to ./configure for bundled libsodium") +set(LIBSODIUM_MSBUILD_ARGS "" CACHE STRING "semicolon-separated list of arguments to pass to msbuild for bundled libsodium") +set(LIBSODIUM_VS_VERSION "" CACHE STRING "Visual studio solution version for bundled libsodium (default: detect from MSVC_VERSION)") + +if (NOT CMAKE_BUILD_TYPE) + # default to Release + set(CMAKE_BUILD_TYPE "Release") +endif() + +# get options from env +if (DEFINED ENV{ZMQ_PREFIX}) + set(ZMQ_PREFIX "$ENV{ZMQ_PREFIX}") +endif() + +if (DEFINED ENV{ZMQ_DRAFT_API}) + if ("$ENV{ZMQ_DRAFT_API}" STREQUAL "1") + set(ZMQ_DRAFT_API TRUE) + else() + set(ZMQ_DRAFT_API FALSE) + endif() +endif() + +# load options from env with PYZMQ_ prefix +foreach(_optname + LIBZMQ_BUNDLED_VERSION + LIBZMQ_BUNDLED_URL + LIBSODIUM_BUNDLED_VERSION + LIBSODIUM_BUNDLED_URL + LIBSODIUM_CONFIGURE_ARGS + LIBSODIUM_MSBUILD_ARGS + LIBSODIUM_VS_VERSION +) + if (DEFINED ENV{PYZMQ_${_optname}}) + set(${_optname} "$ENV{PYZMQ_${_optname}}") + endif() +endforeach() + +if(ZMQ_DRAFT_API) + message(STATUS "enabling ZMQ_DRAFT_API") + add_compile_definitions(ZMQ_BUILD_DRAFT_API=1) +endif() + +if (LIBSODIUM_BUNDLED_VERSION AND NOT LIBSODIUM_BUNDLED_URL) + set(LIBSODIUM_BUNDLED_URL "https://download.libsodium.org/libsodium/releases/libsodium-${LIBSODIUM_BUNDLED_VERSION}.tar.gz") +endif() + +if (LIBZMQ_BUNDLED_VERSION AND NOT LIBZMQ_BUNDLED_URL) + set(LIBZMQ_BUNDLED_URL "https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_BUNDLED_VERSION}/zeromq-${LIBZMQ_BUNDLED_VERSION}.tar.gz") +endif() + +#------- bundle libzmq ------ + +if (NOT ZMQ_PREFIX) + # empty string is the same as 'auto' + set(ZMQ_PREFIX "auto") +endif() + +# default search paths: + +foreach(prefix $ENV{PREFIX} "/opt/homebrew" "/opt/local" "/usr/local" "/usr") + if (IS_DIRECTORY "${prefix}") + list(APPEND CMAKE_PREFIX_PATH "${prefix}") + endif() +endforeach() + +if (ZMQ_PREFIX STREQUAL "auto") + message(CHECK_START "Looking for libzmq") + find_package(ZeroMQ QUIET) + if (ZeroMQ_FOUND AND TARGET libzmq) + set(libzmq_target "libzmq") + get_target_property(_ZMQ_LOCATION libzmq IMPORTED_LOCATION) + message(CHECK_PASS "Found with cmake: ${_ZMQ_LOCATION}") + endif() + + if (NOT ZeroMQ_FOUND) + find_package(PkgConfig) + if (PkgConfig_FOUND) + message(CHECK_START "Looking for libzmq with pkg-config") + pkg_check_modules(libzmq libzmq IMPORTED_TARGET) + if (TARGET PkgConfig::libzmq) + set(ZeroMQ_FOUND TRUE) + set(libzmq_target "PkgConfig::libzmq") + message(CHECK_PASS "found: -l${libzmq_LIBRARIES}") + else() + message(CHECK_FAIL "no") + endif() + endif() + endif() + + if (NOT ZeroMQ_FOUND) + message(STATUS " Fallback: looking for libzmq in ${CMAKE_PREFIX_PATH}") + find_library(LIBZMQ_LIBRARY NAMES zmq) + find_path(LIBZMQ_INCLUDE_DIR "zmq.h") + + # check if found + if (LIBZMQ_LIBRARY AND LIBZMQ_INCLUDE_DIR) + set(ZeroMQ_FOUND TRUE) + message(CHECK_PASS "${LIBZMQ_LIBRARY}") + endif() + endif() + + if (NOT ZeroMQ_FOUND) + message(CHECK_FAIL "libzmq not found, will bundle libzmq and libsodium") + set(ZMQ_PREFIX "bundled") + endif() +elseif (NOT ZMQ_PREFIX STREQUAL "bundled") + message(CHECK_START "Looking for libzmq in ${ZMQ_PREFIX}") + find_path( + LIBZMQ_INCLUDE_DIR zmq.h + PATHS "${ZMQ_PREFIX}/include" + NO_DEFAULT_PATH + ) + find_library( + LIBZMQ_LIBRARY + NAMES zmq + PATHS "${ZMQ_PREFIX}/lib" + NO_DEFAULT_PATH + ) + if (LIBZMQ_LIBRARY AND LIBZMQ_INCLUDE_DIR) + message(CHECK_PASS "${LIBZMQ_LIBRARY}") + else() + message(CHECK_FAIL "no") + message(FATAL_ERROR "libzmq not found in ZMQ_PREFIX=${ZMQ_PREFIX}") + endif() +else() + # bundled +endif() + +if (ZMQ_PREFIX STREQUAL "bundled") + message(STATUS "Bundling libzmq and libsodium") + include(FetchContent) + add_compile_definitions(ZMQ_STATIC=1) + set(BUNDLE_DIR "${CMAKE_CURRENT_BINARY_DIR}/bundled") + make_directory("${BUNDLE_DIR}/lib") + include_directories(${BUNDLE_DIR}/include) + list(PREPEND CMAKE_PREFIX_PATH ${BUNDLE_DIR}) + + # libsodium + + if (MSVC) + set(libsodium_lib "${BUNDLE_DIR}/lib/libsodium.lib") + else() + set(libsodium_lib "${BUNDLE_DIR}/lib/libsodium.a") + endif() + + FetchContent_Declare(bundled_libsodium + URL ${LIBSODIUM_BUNDLED_URL} + PREFIX ${BUNDLE_DIR} + ) + FetchContent_MakeAvailable(bundled_libsodium) + # run libsodium build explicitly here, so it's available to libzmq next + set(bundled_libsodium_include "${bundled_libsodium_SOURCE_DIR}/src/libsodium/include") + + if(${bundled_libsodium_POPULATED} AND NOT EXISTS "${libsodium_lib}") + message(STATUS "building bundled libsodium") + if (MSVC) + # select vs build solution by msvc version number + if (NOT LIBSODIUM_VS_VERSION) + if(MSVC_VERSION GREATER 1940) + message(STATUS "Unrecognized MSVC_VERSION=${MSVC_VERSION}") + set(MSVC_VERSION 1939) + endif() + + if(MSVC_VERSION GREATER_EQUAL 1930) + set(LIBSODIUM_VS_VERSION "2022") + elseif(MSVC_VERSION GREATER_EQUAL 1920) + set(LIBSODIUM_VS_VERSION "2019") + elseif(MSVC_VERSION GREATER_EQUAL 1910) + set(LIBSODIUM_VS_VERSION "2017") + else() + message(FATAL_ERROR "unsupported bundling libsodium for MSVC_VERSION=${MSVC_VERSION} (need at least VS2017)") + endif() + endif() + find_package(Vcvars REQUIRED) + list(APPEND libsodium_build + ${Vcvars_LAUNCHER} + "msbuild" + "/m" + "/v:n" + "/p:Configuration=Static${CMAKE_BUILD_TYPE}" + "/p:Platform=${CMAKE_GENERATOR_PLATFORM}" + "builds/msvc/vs${LIBSODIUM_VS_VERSION}/libsodium.sln" + ) + list(APPEND libsodium_build ${LIBSODIUM_MSBUILD_ARGS}) + execute_process( + COMMAND ${libsodium_build} + WORKING_DIRECTORY ${bundled_libsodium_SOURCE_DIR} + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + ) + file(GLOB_RECURSE BUILT_LIB "${bundled_libsodium_SOURCE_DIR}/**/libsodium.lib") + message(STATUS "copy ${BUILT_LIB} ${libsodium_lib}") + file(COPY_FILE ${BUILT_LIB} ${libsodium_lib}) + else() + list(APPEND libsodium_configure + ./configure + --prefix=${BUNDLE_DIR} + --with-pic + --disable-shared + --enable-static + # TODO: enable extra arg passthrough + ) + execute_process( + COMMAND ${libsodium_configure} + WORKING_DIRECTORY ${bundled_libsodium_SOURCE_DIR} + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + ) + execute_process( + COMMAND make + WORKING_DIRECTORY ${bundled_libsodium_SOURCE_DIR} + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + ) + execute_process( + COMMAND make install + WORKING_DIRECTORY ${bundled_libsodium_SOURCE_DIR} + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + ) + endif() + endif() + + # use libzmq's own cmake, so we can import the libzmq-static target + set(ENABLE_CURVE ON) + set(ENABLE_DRAFTS ${ZMQ_DRAFT_API}) + set(WITH_LIBSODIUM ON) + set(WITH_LIBSODIUM_STATIC ON) + set(LIBZMQ_PEDANTIC OFF) + set(LIBZMQ_WERROR OFF) + set(WITH_DOC OFF) + set(WITH_DOCS OFF) + set(BUILD_TESTS OFF) + set(BUILD_SHARED OFF) + set(BUILD_STATIC ON) + + FetchContent_Declare(bundled_libzmq + URL ${LIBZMQ_BUNDLED_URL} + PREFIX ${BUNDLE_DIR} + CMAKE_ARGS ${LIBZMQ_CMAKE_ARGS} + EXCLUDE_FROM_ALL + ) + FetchContent_MakeAvailable(bundled_libzmq) + + # target for libzmq static + if (TARGET libzmq-static) + set(libzmq_target "libzmq-static") + else() + message(FATAL_ERROR "libzmq-static target not found in bundled libzmq") + endif() +endif() + +if (NOT TARGET "${libzmq_target}" AND LIBZMQ_LIBRARY AND LIBZMQ_INCLUDE_DIR) + set(libzmq_target "libzmq") + # construct target from find_library results + # what if it was static? + add_library(libzmq SHARED IMPORTED) + set_property(TARGET libzmq PROPERTY IMPORTED_LOCATION ${LIBZMQ_LIBRARY}) + set_property(TARGET libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LIBZMQ_INCLUDE_DIR}) +endif() + +#------- building pyzmq itself ------- + +message(STATUS "Using Python ${Python_INTERPRETER_ID} ${Python_EXECUTABLE}") + +set(ZMQ_BACKEND "${CMAKE_CURRENT_BINARY_DIR}/zmq/backend") +set(ZMQ_BUILDUTILS "${CMAKE_CURRENT_SOURCE_DIR}/buildutils") + +if(Python_INTERPRETER_ID STREQUAL "PyPy") + message(STATUS "Building CFFI backend") + set(ZMQ_EXT_NAME "_cffi") + + set(ZMQ_BACKEND_CFFI "${ZMQ_BACKEND}/cffi") + set(ZMQ_BACKEND_DEST "zmq/backend/cffi") + set(ZMQ_C "${ZMQ_BACKEND_CFFI}/${ZMQ_EXT_NAME}.c") + + add_custom_command( + OUTPUT ${ZMQ_C} + VERBATIM + COMMAND "${Python_EXECUTABLE}" + "${ZMQ_BUILDUTILS}/build_cffi.py" + "${ZMQ_C}" + ) +else() + message(STATUS "Building Cython backend") + find_program(CYTHON "cython") + + set(ZMQ_BACKEND_CYTHON "${ZMQ_BACKEND}/cython") + set(ZMQ_BACKEND_DEST "zmq/backend/cython") + set(ZMQ_EXT_NAME "_zmq") + set(ZMQ_C "${ZMQ_BACKEND_CYTHON}/${ZMQ_EXT_NAME}.c") + set(ZMQ_PYX "${CMAKE_CURRENT_SOURCE_DIR}/zmq/backend/cython/${ZMQ_EXT_NAME}.py") + add_custom_command( + OUTPUT ${ZMQ_C} + DEPENDS ${ZMQ_PYX} + VERBATIM + COMMAND "${CYTHON}" + --3str + --output-file ${ZMQ_C} + ${ZMQ_PYX} + ) +endif() + +make_directory(${ZMQ_BACKEND_DEST}) + +python_add_library( + ${ZMQ_EXT_NAME} MODULE + WITH_SOABI + ${ZMQ_C} +) + +if (TARGET ${libzmq_target}) + message(STATUS "Linking libzmq target ${libzmq_target}") + target_link_libraries(${ZMQ_EXT_NAME} PUBLIC ${libzmq_target}) + if ("${libzmq_target}" STREQUAL "libzmq-static" AND NOT MSVC) + # seem to need stdc++ for static libzmq on non-Windows + # not sure if/when this should be libc++ or how to know + target_link_libraries(${ZMQ_EXT_NAME} PUBLIC stdc++) + endif() +else() + message(FATAL_ERROR "should have a libzmq target ${libzmq_target} to link to...") +endif() + +target_include_directories(${ZMQ_EXT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/zmq/utils") +install(TARGETS ${ZMQ_EXT_NAME} DESTINATION "${ZMQ_BACKEND_DEST}") 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/build_cffi.py b/buildutils/build_cffi.py index b432ce00e..8c5d76481 100644 --- a/buildutils/build_cffi.py +++ b/buildutils/build_cffi.py @@ -1,9 +1,11 @@ import json import os +import sys 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 +21,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 +35,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 +59,4 @@ def load_compiler_config(): ) if __name__ == "__main__": - ffi.compile() + ffi.emit_c_code(sys.argv[1]) diff --git a/buildutils/bundle.py b/buildutils/bundle.py index cfd665746..d37980cd7 100644 --- a/buildutils/bundle.py +++ b/buildutils/bundle.py @@ -1,339 +1,26 @@ -"""utilities for fetching build dependencies.""" +""" +info about the bundled versions of libzmq -# ----------------------------------------------------------------------------- -# 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. -# ----------------------------------------------------------------------------- +no longer any info other than version numbers +""" - -import errno -import hashlib -import os -import platform -import re -import shutil -import stat import sys -import zipfile -from subprocess import PIPE, Popen -from tempfile import TemporaryDirectory -from unittest import mock -from urllib.parse import urlparse -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) - - -# 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 -# ----------------------------------------------------------------------------- - - -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 -# ----------------------------------------------------------------------------- +bundled_libsodium_version = "1.0.19" +bundled_version = "4.3.5" -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 main(): + """print version -def fetch_libzmq(savedir): - """download and extract libzmq""" - fetch_and_extract( - savedir, 'zeromq', url=libzmq_url, fname=libzmq, checksum=libzmq_checksum - ) - - -# On Windows, deleting a local git repo directory with shutil.rmtree -# fails with permission problem on some read-only files in .git/. -# Add a hook trying to fix the permission. -def handle_remove_readonly(func, path, exc): - excvalue = exc[1] - if func in (os.rmdir, os.remove, os.unlink) and excvalue.errno == errno.EACCES: - os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) # 0777 - func(path) - else: - raise - - -def fetch_libzmq_archive(savedir, url): - """fetch libzmq from archive zip""" - dest = pjoin(savedir, 'zeromq') - - fetch_path = urlparse(url) - fetch_name = os.path.basename(fetch_path.path) - dest = pjoin(savedir, 'zeromq') - fname_file = pjoin(dest, fetch_name) - # checks for a file with the name of the zip archive - if os.path.exists(fname_file): - info("already have extracted sources from repo archive %s" % fetch_name) - else: - if os.path.exists(dest): - shutil.rmtree(dest, ignore_errors=False, onerror=handle_remove_readonly) - fetch_and_extract(savedir, 'zeromq', url=url, fname=fetch_name, checksum=None) - with open(fname_file, 'a'): # touch the file with the name of the zip archive - pass - - # get repo version - zmq_hdr = pjoin(dest, 'include', 'zmq.h') - ver_maj = None - ver_min = None - ver_pat = None - repo_version = None - if os.path.exists(zmq_hdr): - for line in open(zmq_hdr): - if re.search('^#define +ZMQ_VERSION_MAJOR +[0-9]+$', line): - ver_maj = line.split()[2] - elif re.search('^#define +ZMQ_VERSION_MINOR +[0-9]+$', line): - ver_min = line.split()[2] - elif re.search('^#define +ZMQ_VERSION_PATCH +[0-9]+$', line): - ver_pat = line.split()[2] - - if ver_maj and ver_min and ver_pat: - repo_version = (int(ver_maj), int(ver_min), int(ver_pat)) - else: - warn('unable to determine bundle_version, build may fail') - else: - warn('zmq header not found, build may fail') - - return repo_version - - -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. + for easier consumption by non-python """ - - 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') + if sys.argv[1:2] == ['libsodium']: + v = bundled_libsodium_version 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 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 - - 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, - ) - 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 + v = bundled_version + sys.stdout.write(v) 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) + main() 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 eef097ba1..000000000 --- a/buildutils/config.py +++ /dev/null @@ -1,190 +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 = {} - prefix_lower = prefix.lower() - 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 - settings['zmq_archive_url'] = None - elif prefix_lower.startswith('https://') and prefix_lower.endswith('.zip'): - settings['zmq_prefix'] = '' - settings['libzmq_extension'] = True - settings['no_libzmq_extension'] = False - settings['zmq_archive_url'] = prefix_lower - 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, - 'zmq_archive_url': 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 fa94d9dfa..000000000 --- a/buildutils/detect.py +++ /dev/null @@ -1,144 +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/cmake/FindVcvars.cmake b/cmake/FindVcvars.cmake new file mode 100644 index 000000000..550d80e81 --- /dev/null +++ b/cmake/FindVcvars.cmake @@ -0,0 +1,337 @@ +# unmodified from: https://raw.githubusercontent.com/scikit-build/cmake-FindVcvars/v1.6/FindVcvars.cmake + +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindVcvars +---------- + +Finds a "vcvars" batch script. + +The module can be used when configuring a project or when running +in cmake -P script mode. + +These variables can be used to choose which "vcvars" batch script is looked up. + +.. variable:: Vcvars_MSVC_ARCH + + Possible values are `32` or `64` + + If not explicitly set in the calling scope, the variable is initialized + based on the value of :variable:`CMAKE_SIZEOF_VOID_P` in configuration mode, and + to 64 in script mode. + +.. variable:: Vcvars_MSVC_VERSION + + Possible values corresponds to :variable:`MSVC_VERSION`. + + If not explicitly set in the calling scope, :variable:`Vcvars_MSVC_VERSION` is + initialized using :variable:`MSVC_VERSION` variable if it is defined, otherwise + the variable :variable:`Vcvars_MSVC_VERSION` is initialized based on the most + recent version of Visual Studio installed on the system. + +This will define the following variables: + +.. variable:: Vcvars_BATCH_FILE + + Path to ``vcvars32.bat``, ``vcvarsamd64.bat`` or ``vcvars64.bat``. + +.. variable:: Vcvars_LAUNCHER + + Path to a generated wrapper script allowing to execute program after + setting environment defined by `Vcvars_BATCH_FILE`. + + It can be used within :module:`ExternalProject` steps + specifying command like this:: + + set(cmd_wrapper) + if(MSVC) + find_package(Vcvars REQUIRED) + set(cmd_wrapper ${Vcvars_LAUNCHER}) + endif() + + ExternalProject_Add(AwesomeProject + [...] + BUILD_COMMAND ${cmd_wrapper} arg1 arg2 [...] + [...] + ) + +This module also defines the following functions + + +.. command:: Vcvars_GetVisualStudioPaths + + The ``Vcvars_GetVisualStudioPaths()`` function returns a list of all + possible Visual Studio registry paths associated with a given ```` + and ````:: + + Vcvars_GetVisualStudioPaths( ) + + The options are: + + ```` + Specify the Visual Studio compiler version. See :variable:`MSVC_VERSION` + for possible values. + + ```` + Specify the Visual Studio architecture. Possible values are `32` or `64`. + + ```` + The name of the variable to be set with the list of registry paths. + + +.. command:: Vcvars_ConvertMsvcVersionToVsVersion + + The ``Vcvars_ConvertMsvcVersionToVsVersion()`` function converts a + :variable:`MSVC_VERSION` of the form ``NNNN`` to a Visual Studio version + of the form ``XX.Y`:: + + Vcvars_ConvertMsvcVersionToVsVersion( ) + + The options are: + + ```` + Specify the Visual Studio compiler version. See :variable:`MSVC_VERSION` + for possible values. + + ```` + The name of the variable to be set with the Visual Studio version. + +#]=======================================================================] + +cmake_minimum_required(VERSION 3.5) + +# Global variables used only in this script (unset at the end) +set(_Vcvars_MSVC_ARCH_REGEX "^(32|64)$") +set(_Vcvars_MSVC_VERSION_REGEX "^[0-9][0-9][0-9][0-9]$") +set(_Vcvars_SUPPORTED_MSVC_VERSIONS + 1939 1938 1937 1936 1935 1934 1933 1932 1931 1930 # VS 2022 + 1929 1928 1927 1926 1925 1924 1923 1922 1921 1920 # VS 2019 + 1916 1915 1914 1913 1912 1911 1910 # VS 2017 + 1900 # VS 2015 + 1800 # VS 2013 + 1700 # VS 2012 + 1600 # VS 2010 + 1500 # VS 2008 + 1400 # VS 2005 + ) + +function(_vcvars_message) + if(NOT Vcvars_FIND_QUIETLY) + message(${ARGN}) + endif() +endfunction() + +function(Vcvars_ConvertMsvcVersionToVsVersion msvc_version output_var) + if(NOT msvc_version MATCHES ${_Vcvars_MSVC_VERSION_REGEX}) + message(FATAL_ERROR "msvc_version is expected to match `${_Vcvars_MSVC_VERSION_REGEX}`") + endif() + # See https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering + if((msvc_version GREATER_EQUAL 1930) AND (msvc_version LESS 1940)) # VS 2022 + set(vs_version "17") + elseif((msvc_version GREATER_EQUAL 1920) AND (msvc_version LESS 1930)) # VS 2019 + set(vs_version "16") + elseif((msvc_version GREATER_EQUAL 1910) AND (msvc_version LESS 1920)) # VS 2017 + set(vs_version "15") + elseif(msvc_version EQUAL 1900) # VS 2015 + set(vs_version "14.0") + elseif(msvc_version EQUAL 1800) # VS 2013 + set(vs_version "12.0") + elseif(msvc_version EQUAL 1700) # VS 2012 + set(vs_version "11.0") + elseif(msvc_version EQUAL 1600) # VS 2010 + set(vs_version "10.0") + elseif(msvc_version EQUAL 1500) # VS 2008 + set(vs_version "9.0") + elseif(msvc_version EQUAL 1400) # VS 2005 + set(vs_version "8.0") + elseif(msvc_version EQUAL 1310) # VS 2003 + set(vs_version "7.1") + elseif(msvc_version EQUAL 1300) # VS 2002 + set(vs_version "7.0") + elseif(msvc_version EQUAL 1200) # VS 6.0 + set(vs_version "6.0") + else() + message(FATAL_ERROR "failed to convert msvc_version [${msvc_version}]. It is not a known version number.") + endif() + set(${output_var} ${vs_version} PARENT_SCOPE) +endfunction() + +function(Vcvars_GetVisualStudioPaths msvc_version msvc_arch output_var) + + if(NOT msvc_version MATCHES ${_Vcvars_MSVC_VERSION_REGEX}) + message(FATAL_ERROR "msvc_version is expected to match `${_Vcvars_MSVC_VERSION_REGEX}`") + endif() + + if(NOT msvc_arch MATCHES ${_Vcvars_MSVC_ARCH_REGEX}) + message(FATAL_ERROR "msvc_arch argument is expected to match '${_Vcvars_MSVC_ARCH_REGEX}'") + endif() + + Vcvars_ConvertMsvcVersionToVsVersion(${msvc_version} vs_version) + + set(_vs_installer_paths "") + set(_vs_registry_paths "") + if(vs_version VERSION_GREATER_EQUAL "15.0") + # Query the VS Installer tool for locations of VS 2017 and above. + string(REGEX REPLACE "^([0-9]+)\.[0-9]+$" "\\1" vs_installer_version ${vs_version}) + cmake_host_system_information(RESULT _vs_dir QUERY VS_${vs_installer_version}_DIR) + if(_vs_dir) + list(APPEND _vs_installer_paths "${_vs_dir}/VC/Auxiliary/Build") + endif() + else() + # Registry keys for locations of VS 2015 and below + set(_hkeys + "HKEY_USERS" + "HKEY_CURRENT_USER" + "HKEY_LOCAL_MACHINE" + "HKEY_CLASSES_ROOT" + ) + set(_suffixes + "" + "_Config" + ) + set(_arch_path "bin/amd64") + if(msvc_arch STREQUAL "32") + set(_arch_path "bin") + endif() + set(_vs_registry_paths) + foreach(_hkey IN LISTS _hkeys) + foreach(_suffix IN LISTS _suffixes) + set(_vc "VC") + if(_vs_version STREQUAL "6.0") + set(_vc "Microsoft Visual C++") + endif() + list(APPEND _vs_registry_paths + "[${_hkey}\\SOFTWARE\\Microsoft\\VisualStudio\\${vs_version}${_suffix}\\Setup\\${_vc};ProductDir]/${_arch_path}" + ) + endforeach() + endforeach() + endif() + set(_vs_installer_paths ${_vs_installer_paths} ${_vs_registry_paths}) + if(_vs_installer_paths STREQUAL "") + set(_vs_installer_paths "${output_var}-${msvc_version}-${msvc_arch}-NOTFOUND") + endif() + set(${output_var} ${_vs_installer_paths} PARENT_SCOPE) +endfunction() + +# default +if(NOT DEFINED Vcvars_MSVC_ARCH) + if(NOT DEFINED CMAKE_SIZEOF_VOID_P) + set(Vcvars_MSVC_ARCH "64") + _vcvars_message(STATUS "Setting Vcvars_MSVC_ARCH to '${Vcvars_MSVC_ARCH}' as CMAKE_SIZEOF_VOID_P was none") + else() + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 4) + set(Vcvars_MSVC_ARCH "32") + elseif("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + set(Vcvars_MSVC_ARCH "64") + else() + message(FATAL_ERROR "CMAKE_SIZEOF_VOID_P [${CMAKE_SIZEOF_VOID_P}] is expected to be either 4 or 8") + endif() + # Display message only once in config mode + if(NOT DEFINED Vcvars_BATCH_FILE) + _vcvars_message(STATUS "Setting Vcvars_MSVC_ARCH to '${Vcvars_MSVC_ARCH}' as CMAKE_SIZEOF_VOID_P was `${CMAKE_SIZEOF_VOID_P}`") + endif() + endif() +endif() + +if(NOT DEFINED Vcvars_MSVC_VERSION) + if(DEFINED MSVC_VERSION) + set(Vcvars_MSVC_VERSION ${MSVC_VERSION}) + # Display message only once in config mode + if(NOT DEFINED Vcvars_BATCH_FILE) + _vcvars_message(STATUS "Setting Vcvars_MSVC_VERSION to '${Vcvars_MSVC_VERSION}' as MSVC_VERSION was `${MSVC_VERSION}`") + endif() + endif() +endif() +if(NOT DEFINED Vcvars_BATCH_FILE) + set(Vcvars_BATCH_FILE "Vcvars_BATCH_FILE-NOTFOUND") +endif() +if(NOT DEFINED Vcvars_LAUNCHER) + set(Vcvars_LAUNCHER "Vcvars_LAUNCHER-NOTFOUND") +endif() + +# check Vcvars_MSVC_ARCH is properly set +if(NOT Vcvars_MSVC_ARCH MATCHES ${_Vcvars_MSVC_ARCH_REGEX}) + message(FATAL_ERROR "Vcvars_MSVC_ARCH [${Vcvars_MSVC_ARCH}] is expected to match `${_Vcvars_MSVC_ARCH_REGEX}`") +endif() + +# which vcvars script ? +if(Vcvars_MSVC_ARCH STREQUAL "64") + set(_Vcvars_SCRIPTS vcvarsamd64.bat vcvars64.bat) +else() + set(_Vcvars_SCRIPTS vcvars32.bat) +endif() + +# set Vcvars_BATCH_FILE +if(NOT DEFINED Vcvars_MSVC_VERSION) + # auto-discover Vcvars_MSVC_VERSION value + _vcvars_message(STATUS "Setting Vcvars_MSVC_VERSION") + foreach(_candidate_msvc_version IN LISTS _Vcvars_SUPPORTED_MSVC_VERSIONS) + Vcvars_GetVisualStudioPaths(${_candidate_msvc_version} "${Vcvars_MSVC_ARCH}" _paths) + Vcvars_ConvertMsvcVersionToVsVersion(${_candidate_msvc_version} _candidate_vs_version) + set(_msg " Visual Studio ${_candidate_vs_version} (${_candidate_msvc_version})") + _vcvars_message(STATUS "${_msg}") + find_program(Vcvars_BATCH_FILE NAMES ${_Vcvars_SCRIPTS} + DOC "Visual Studio ${_candidate_vs_version} ${_Vcvars_SCRIPTS}" + PATHS ${_paths} + ) + if(Vcvars_BATCH_FILE) + _vcvars_message(STATUS "${_msg} - found") + set(Vcvars_MSVC_VERSION ${_candidate_msvc_version}) + _vcvars_message(STATUS "Setting Vcvars_MSVC_VERSION to '${Vcvars_MSVC_VERSION}' as it was the newest Visual Studio installed providing vcvars scripts") + break() + else() + _vcvars_message(STATUS "${_msg} - not found") + endif() + endforeach() + unset(_candidate_msvc_version) + unset(_candidate_vs_version) + unset(_paths) +else() + # use provided Vcvars_MSVC_VERSION value + if(NOT Vcvars_MSVC_VERSION MATCHES ${_Vcvars_MSVC_VERSION_REGEX}) + message(FATAL_ERROR "Vcvars_MSVC_VERSION [${Vcvars_MSVC_VERSION}] is expected to match `${_Vcvars_MSVC_VERSION_REGEX}`") + endif() + Vcvars_GetVisualStudioPaths(${Vcvars_MSVC_VERSION} "${Vcvars_MSVC_ARCH}" _paths) + Vcvars_ConvertMsvcVersionToVsVersion(${Vcvars_MSVC_VERSION} _vs_version) + find_program(Vcvars_BATCH_FILE NAMES ${_Vcvars_SCRIPTS} + DOC "Visual Studio ${_vs_version} ${_Vcvars_SCRIPTS}" + PATHS ${_paths} + ) + unset(_paths) + unset(_vs_version) +endif() + +# configure wrapper script +set(Vcvars_LAUNCHER) +if(Vcvars_BATCH_FILE) + + set(_in "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/Vcvars_wrapper.bat.in") + get_filename_component(_basename ${Vcvars_BATCH_FILE} NAME_WE) + set(_out "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${_basename}_wrapper.bat") + file(WRITE ${_in} "call \"@Vcvars_BATCH_FILE@\" +%* +") + configure_file(${_in} ${_out} @ONLY) + + set(Vcvars_LAUNCHER ${_out}) + unset(_in) + unset(_out) +endif() + +# cleanup +unset(_Vcvars_SCRIPTS) + +# outputs +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Vcvars + FOUND_VAR Vcvars_FOUND + REQUIRED_VARS + Vcvars_BATCH_FILE + Vcvars_LAUNCHER + Vcvars_MSVC_VERSION + Vcvars_MSVC_ARCH + FAIL_MESSAGE + "Failed to find vcvars scripts for Vcvars_MSVC_VERSION [${Vcvars_MSVC_VERSION}] and Vcvars_MSVC_ARCH [${Vcvars_MSVC_ARCH}]" + ) diff --git a/cmake/Findsodium.cmake b/cmake/Findsodium.cmake new file mode 100644 index 000000000..412603b01 --- /dev/null +++ b/cmake/Findsodium.cmake @@ -0,0 +1,43 @@ +# copy libzmq's findsodium, which can't be told where to look +# we want to get our local bundled static libsodium +# not any other +message(CHECK_START "Looking for pyzmq-bundled libsodium") +set(SODIUM_FOUND FALSE) + +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON) +find_package(PkgConfig) +if (PkgConfig_FOUND) + pkg_check_modules(PC_SODIUM "libsodium") + if (PC_SODIUM_STATIC_FOUND) + set(pkg_config_names_private "${pkg_config_names_private} libsodium") + set(SODIUM_LIBRARIES ${PC_SODIUM_STATIC_LIBRARIES}) + set(SODIUM_INCLUDE_DIRS ${PC_SODIUM_STATIC_INCLUDE_DIRS}) + set(SODIUM_FOUND TRUE) + endif() +endif() + +if (NOT SODIUM_FOUND) + set(SODIUM_INCLUDE_DIRS ${bundled_libsodium_include}) + find_library( + SODIUM_LIBRARIES + NAMES libsodium.a libsodium.lib + PATH ${BUNDLE_DIR}/lib + ) + message(STATUS "Found ${SODIUM_LIBRARIES} in ${BUNDLE_DIR}") + if (SODIUM_LIBRARIES) + # pkg-config didn't work, what do we need? + if (NOT MSVC) + list(APPEND SODIUM_LIBRARIES pthread) + endif() + set(SODIUM_FOUND TRUE) + endif() +endif() + +if (NOT SODIUM_FOUND) + message(CHECK_FAIL "no") + message(FATAL_ERROR "Failed to find bundled libsodium") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(sodium DEFAULT_MSG SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS) +mark_as_advanced(SODIUM_FOUND SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS) diff --git a/docs/source/conf.py b/docs/source/conf.py index 1793fca23..4e2cdcc26 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,7 +20,7 @@ # set target libzmq version from buildutils.bundle import bundled_version -target_libzmq = '%i.%i.%i' % bundled_version +target_libzmq = bundled_version # -- General configuration ----------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 388ab5a19..e05fbdf46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,13 @@ requires = [ "cffi; implementation_name == 'pypy'", "cython>=3.0.0; implementation_name == 'cpython'", "packaging", - "setuptools>=61", - "setuptools_scm[toml]", + # "setuptools>=61", + # "setuptools_scm[toml]", + "scikit-build-core", ] -build-backend = "setuptools.build_meta" +build-backend = "scikit_build_core.build" + +# build-backend = "setuptools.build_meta" # Project metadata # ref: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html @@ -19,7 +22,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 +45,7 @@ classifiers = [ ] dependencies = ["cffi; implementation_name == 'pypy'"] description = "Python bindings for 0MQ" -dynamic = ["readme"] +readme = "README.md" [project.urls] Homepage = "https://pyzmq.readthedocs.org" @@ -50,13 +53,22 @@ 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" } +[tool.scikit-build] +wheel.packages = ["zmq"] +cmake.version = ">=3.28" + [tool.autoflake] ignore-init-module-imports = true remove-all-unused-imports = true @@ -129,35 +141,24 @@ 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", -# ] repair-wheel-command = """ delvewheel repair \ -v \ --wheel-dir={dest_dir} \ {wheel} """ - # --add-path=C:/libzmq-dll \ [tool.cibuildwheel.windows.environment] -ZMQ_PREFIX = "libzmq-dll" +ZMQ_PREFIX = "bundled" # mac-arm target is 10.15 [[tool.cibuildwheel.overrides]] select = "*macos*{universal2,arm64}*" environment = { MACOSX_DEPLOYMENT_TARGET = "10.15" } -# manylinux1 for old Python -[[tool.cibuildwheel.overrides]] -select = "cp3{6,7}-*" -manylinux-x86_64-image = "manylinux1" -manylinux-i686-image = "manylinux1" - -# manylinux2010 for (less) old cp38-9, pp37-8 +# manylinux2010 for (less) old cp37-9, pp37-8 [[tool.cibuildwheel.overrides]] -select = "cp3{8,9}-* pp3{7,8}-*" +select = "cp3{7,8,9}-* pp3{7,8}-*" manylinux-x86_64-image = "manylinux2010" manylinux-i686-image = "manylinux2010" 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 32be7a5fb..000000000 --- a/setup.py +++ /dev/null @@ -1,1353 +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, - fetch_libzmq_archive, - fetch_libzmq_dll, - 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): - global bundled_version - 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) - - if self.config['zmq_archive_url']: - repo_version = fetch_libzmq_archive( - bundledir, self.config['zmq_archive_url'] - ) - if repo_version and repo_version != bundled_version: - bundled_version = repo_version - info(f"bundled_version update with repo {bundled_version}") - else: - 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) - elif bundled_version <= (4, 3, 4): - # >= 4.2 and <= 4.3.4 - 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) - - if bundled_version <= (4, 3, 4): - # use tweetnacl to provide CURVE support - libzmq.define_macros.append(('ZMQ_HAVE_CURVE', 1)) - libzmq.define_macros.append(('ZMQ_USE_TWEETNACL', 1)) - else: - if sys.platform.startswith('win'): - libzmq.define_macros.append(('ZMQ_HAVE_STRUCT_SOCKADDR_UN', 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) diff --git a/tools/install_libzmq.sh b/tools/install_libzmq.sh index e4dd2c5e4..aeb03b3de 100644 --- a/tools/install_libzmq.sh +++ b/tools/install_libzmq.sh @@ -1,9 +1,8 @@ #!/usr/bin/env bash # script to install libzmq/libsodium for use in wheels set -ex -LIBSODIUM_VERSION="1.0.19" - -LIBZMQ_VERSION="$(python3 -m buildutils.bundle)" +LIBSODIUM_VERSION=$(python buildutils/bundle.py libsodium) +LIBZMQ_VERSION=$(python buildutils/bundle.py) if [[ "$(uname)" == "Darwin" ]]; then ARCHS="x86_64" @@ -39,7 +38,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 @@ -53,7 +52,7 @@ cd zeromq-${LIBZMQ_VERSION} # avoid error on warning export CXXFLAGS="-Wno-error ${CXXFLAGS:-}" -./configure --prefix="$PREFIX" --with-libsodium --disable-libsodium_randombytes_close +./configure --prefix="$PREFIX" --disable-perf --without-docs --enable-curve --with-libsodium --disable-libsodium_randombytes_close make -j4 make install diff --git a/tools/test_sdist.py b/tools/test_sdist.py index 391ef077c..257f4a9f6 100644 --- a/tools/test_sdist.py +++ b/tools/test_sdist.py @@ -45,15 +45,8 @@ def test_git_files(sdist_files, git_files): @pytest.mark.parametrize( "path", [ - # bundled zeromq - "bundled/zeromq/COPYING", - "bundled/zeromq/COPYING.LESSER", - "bundled/zeromq/include/zmq.h", - "bundled/zeromq/src/zmq.cpp", - "bundled/zeromq/external/wepoll/license.txt", - "bundled/zeromq/external/wepoll/wepoll.h", - # Cython-generated files - "zmq/backend/cython/_zmq.c", + # generated files that should be in the dist + "PKG-INFO", ], ) def test_included(sdist_files, path): @@ -63,9 +56,18 @@ def test_included(sdist_files, path): @pytest.mark.parametrize( "path", [ - "bundled/zeromq/src/platform.hpp", + ".git", + "build", + "dist", + "**/*.dylib", "**/*.so", + "**/*.a", + "**/*.lib", "**/__pycache__", + "bundled", + "CMakeCache.txt", + "CMakeFiles", + "cmake_install.cmake", ], ) def test_excluded(sdist_files, path): diff --git a/tools/test_wheel.py b/tools/test_wheel.py index 8816442c2..40efd08be 100644 --- a/tools/test_wheel.py +++ b/tools/test_wheel.py @@ -14,16 +14,7 @@ def test_has(feature): import zmq - if ( - feature == 'ipc' - and sys.platform == 'win32' - and platform.python_implementation() == "CPython" - ): - # Windows wheels lack IPC - # pending release with https://github.com/zeromq/libzmq/pull/4422 - assert not zmq.has(feature) - else: - assert zmq.has(feature) + assert zmq.has(feature) def test_simple_socket(): @@ -65,6 +56,3 @@ def test_bundle_msvcp(): for dll in should_bundle: assert dll in dlls - - assert any(dll.startswith("libzmq") for dll in dlls) - assert any(dll.startswith("libsodium") for dll in dlls) diff --git a/zmq/__init__.py b/zmq/__init__.py index e15e5c40c..b12ddf64f 100644 --- a/zmq/__init__.py +++ b/zmq/__init__.py @@ -1,66 +1,13 @@ -"""Python bindings for 0MQ.""" +"""Python bindings for 0MQ""" # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. -# load bundled libzmq, if there is one: - import os import sys from contextlib import contextmanager -def _load_libzmq(): - """load bundled libzmq if there is one""" - import platform - - dlopen = hasattr(sys, 'getdlopenflags') # unix-only - # RTLD flags are added to os in Python 3 - # get values from os because ctypes values are WRONG on pypy - PYPY = platform.python_implementation().lower() == 'pypy' - - if dlopen: - import ctypes - - dlflags = sys.getdlopenflags() - # set RTLD_GLOBAL, unset RTLD_LOCAL - flags = ctypes.RTLD_GLOBAL | dlflags - # ctypes.RTLD_LOCAL is 0 on pypy, which is *wrong* - flags &= ~getattr(os, 'RTLD_LOCAL', 4) - # pypy on darwin needs RTLD_LAZY for some reason - if PYPY and sys.platform == 'darwin': - flags |= getattr(os, 'RTLD_LAZY', 1) - flags &= ~getattr(os, 'RTLD_NOW', 2) - sys.setdlopenflags(flags) - try: - from . import libzmq - except ImportError: - # raise on failure to load if libzmq is present - from importlib.util import find_spec - - if find_spec(".libzmq", "zmq"): - # found libzmq, but failed to load it! - # raise instead of silently moving on - raise - else: - # store libzmq as zmq._libzmq for backward-compat - globals()['_libzmq'] = libzmq - if PYPY: - # should already have been imported above, so reimporting is as cheap as checking - import ctypes - - # some versions of pypy (5.3 < ? < 5.8) needs explicit CDLL load for some reason, - # otherwise symbols won't be globally available - # do this unconditionally because it should be harmless (?) - ctypes.CDLL(libzmq.__file__, ctypes.RTLD_GLOBAL) - finally: - if dlopen: - sys.setdlopenflags(dlflags) - - -_load_libzmq() - - @contextmanager def _libs_on_path(): """context manager for libs directory on $PATH diff --git a/zmq/tests/test_cython.py b/zmq/tests/test_cython.py index 78d0204da..a86a657b3 100644 --- a/zmq/tests/test_cython.py +++ b/zmq/tests/test_cython.py @@ -21,6 +21,9 @@ @pytest.mark.skipif( sys.platform.startswith('win'), reason="Don't try runtime Cython on Windows" ) +@pytest.mark.skipif( + os.environ.get("ZMQ_PREFIX") == "bundled", reason="bundled builds don't have zmq.h" +) @pytest.mark.parametrize('language_level', [3, 2]) def test_cython(language_level, request, tmpdir): assert 'zmq.tests.cython_ext' not in sys.modules